Create Policy Set with Policy Attachment and Configuration Override

You can use the Policy Set REST APIs to create a policy set with policy attachment and configuration override properties.

The cURL command examples use the URL structure:
http(s)://host:port/wsm-pmrest/v2/policyset

This use case shows how to create a policy set with policy attachment and configuration override.

To manage the policy set:

  1. Specify the headers on the cURL command line:
    -H Accept:application/json
  2. Attach the policy reference oracle/wss_username_token_service_policy to a new policy set myPolicySet and add two overriding configuration properties keystore.enc.csf.key and keystore.sig.csf.key by running the following command:
    curl -i -X POST -u username:password -H Content-type:application/json http://host:port/wsm-pmrest/v2/policyset

    Example

    curl -i -X POST -u Smith:Password -H Content-type:application/json http://myhost:7001/wsm-pmrest/v2/policyset

    See Create PolicySet(s).

    The following shows an example of the request body.

    [
      {
        "name": "myPolicySet",
        "type": "WS-Service",
        "scope": "Domain('*')",
        "description": "Global policy attachments for SOAP Web Service resources.",
        "status": "enabled",
        "configOverrides": [
          {
            "name": "keystore.enc.csf.key",
            "value": "myKey1"
          },
          {
            "name": "keystore.sig.csf.key",
            "value": "myKey2"
          }
        ],
        "policyReferences": [
          {
            "uri": "oracle/wss_username_token_service_policy",
            "status": "enabled",
            "configOverrides": [
              {
                "name": "keystore.enc.csf.key",
                "value": "myKey2"
              },
              {
                "name": "keystore.sig.csf.key",
                "value": "myKey2"
              }
            ]
          }
        ]
      }
    ]

    The following shows an example of the response indicating the request succeeded.

    {
      "STATUSCODE": "20001",
      "MESSAGE": "PolicySets \"[myPolicySet]\" are successfully created."
    }