Assigned Policies

You can use REST API v2 calls to assign policies to DPSK pools and cerfiticate templates.

The following table lists the properties that can be used in the body of an assigned-policy-related request and/or are provided in the response body. (In the "Optional" column, if a default value is applicable, it is listed in angle brackets (< >).

Resource: AssignedPolicy

Property Name Type Editable Sort/Filter Optional in Request/Response Body? Description
priority Long Yes No Optional on create only, but not on any subsequent uses The priority, within the list of assigned policies, that this policy should be evaluated.
useCount Long Yes (can only be edited to 0) No No The number of times this policy has been assigned, or reassigned, to the pool. Can be reset to 0.
link Link No No Yes This includes three href links that can be used in other API calls:
  • self: This link includes both the ID of the DPSK pool (the parent of the assigned policy) and the ID of the assigned policy.
  • policy: This link contains the ID of the assigned policy.
  • parent: This link contains the ID of the parent of the assigned policy, which in this case is the DPSK pool.

Assigned Policies URIs and Actions

The following table indicates the URIs that you can append to the root URI, along with the actions you can take, and possible return codes you can receive.

Assigned Policies URIs and Actions

URI Action Description Return Codes
/dpskPools/{dpskPoolId}/policies GET Returns the list of policies assigned to this DPSK pool, and includes the use count for each policy and its priority in the list of policies.

200 - OK

401 - Unauthorized

404 -Not Found

/dpskPools/{dpskPoolId}/policies/{policyId} GET Returns information about the specified policy assigned to this DPSK pool, including the use count for this policy, its priority in the list, and all its href links.

200 - OK

401 - Unauthorized

404 - Not Found

DELETE Removes the policy from the list of assigned policies and reorders the list accordingly.

200 - OK

201 - No Content

401-Unauthorized

404 - Not Found

PUT Adds the policy to the list of assigned policies. If the policy is already in the list, you can use the allowed properties to reset the use count to 0 and to re-prioritize this policy in the list. This policy can also be the first one assigned to the pool.
Note: You can perform a GET request on policies to obtain the ID of the policy you want to assign to the pool. Refer to Policies URIs and Actions.

200 - OK

401-Unauthorized

404 -Not Found

/certificateTemplates/{guid}/policies
new for 5.8
GET Returns the list of policies assigned to this certificate template, and includes the use count and the priority of each policy in the list.

200 - OK

401 - Unauthorized

404 -Not Found

/certificateTemplates/{guid}/policies/{policyId}
new for 5.8
GET Returns information about the specified policy assigned to this certificate template, including the use count for this policy, its priority in the list, and all its href links.

200 - OK

401 - Unauthorized

404 - Not Found

DELETE Removes the policy from the list of assigned policies and reorders the list accordingly.

200 - OK

201 - No Content

401-Unauthorized

404 - Not Found

PUT Adds the policy to the list of assigned policies. If the policy is already in the list, you can use the allowed properties to reset the use count to 0 and to re-prioritize this policy in the list. This policy can also be the first one assigned to the certificate.
Note: You can perform a GET request on policies to obtain the ID of the policy you want to assign to the certificate. Refer to Policies URIs and Actions.

200 - OK

401-Unauthorized

404 -Not Found

Example of Using PUT to Assign a Policy to a DPSK Pool

This example demonstrates how to assign an existing policy to a DPSK pool by using a REST API PUT call.

URI:

This example uses the following URI:

 https://Jeff243.cloudpath.net/admin/apiv2/5XcTc6SjkHDL/dpskPools/AccountDpskPool-14dc1ed8-ba2a-43bd-8cad-e30dc5f20fb8/policies/2

where:

  • https://Jeff243.cloudpath.net/admin/apiv2 is the root URI of the Cloudpath system being used (must include https, as shown)
  • 5XcTc6SjkHDL is an example of an API key generated from the Configuration > API Keys section of the Cloudpath UI
  • AccountDpskPool-14dc1ed8-ba2a-43bd-8cad-e30dc5f20fb8 is the GUID of the DPSK pool to which this policy is being assigned.
  • 2 is the ID of the policy being assigned.
    Note: You can perform a GET request on policies to obtain the ID of the policy you want to assign to the pool. Refer to Policies URIs and Actions.

Request Headers:

The following table shows the required request headers for this URI example, with an example value of an active token that must be pasted into the Authorization header value:

Request Headers

Key Value
Content-type application/json
Authorization eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJqZWZmLnJob2RpZUBjb21tc2NvcGUuY29tIiwicm9sZVBrIjoiMjEwMDAiLCJhY2NvdW50QWRtaW5QayI6IjIiLCJhcGlLZXkiOiJaV2NjTGpQZUdZMGUiLCJpYXQiOjE1NzU1NzUxNTcsImV4cCI6MTU3NTU3NTQ1N30.2q4KTyDUevkAAz7mJyp529Be1-ip3EC8P06Xarmz5ao

Request Body:

The following is an example of a request body for assigning a policy to a DPSK pool.

{
        "useCount": 0,
        "priority": 0
        
}

Action:

Use the PUT action to send the request.

Response Body:

Once the request is sent, you will receive a "Status: 200 OK" if the PUT is successful. You can see that the response body below matches what was requested in the request body above.

{
    "useCount": 0,
    "priority": 0,
    "links": [
        {
            "rel": "self",
            "href": "https://jeff243.cloudpath.net/admin/apiv2/5XcTc6SjkHDL/dpskPools/AccountDpskPool-14dc1ed8-ba2a-43bd-8cad-e30dc5f20fb8/policies/2",
            "hreflang": null,
            "media": null,
            "title": null,
            "type": null,
            "deprecation": null
        },
        {
            "rel": "policy",
            "href": "https://jeff243.cloudpath.net/admin/apiv2/5XcTc6SjkHDL/policies/2",
            "hreflang": null,
            "media": null,
            "title": null,
            "type": null,
            "deprecation": null
        },
        {
            "rel": "parent",
            "href": "https://jeff243.cloudpath.net/admin/apiv2/5XcTc6SjkHDL/dpskPools/AccountDpskPool-14dc1ed8-ba2a-43bd-8cad-e30dc5f20fb8",
            "hreflang": null,
            "media": null,
            "title": null,
            "type": null,
            "deprecation": null
        }
    ]
}