Skip to content

Instantly share code, notes, and snippets.

@dstanek
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dstanek/5d6e4380377bef46c765 to your computer and use it in GitHub Desktop.
Save dstanek/5d6e4380377bef46c765 to your computer and use it in GitHub Desktop.

Policy-Endpoint Associations

Create association with endpoint: PUT /OS-ENDPOINT-POLICY/endpoints/{endpoint_id}/policy

Creates an association between the policy and the endpoint. If another association already existed for the specified endpoint, this will replace that association.

Request:

Content-Type: application/json

{
    "policy": "--policy-id--"
}

Response:

Status: 204 No Content

Check association with endpoint: HEAD /OS-ENDPOINT-POLICY/endpoints/{endpoint_id}/policy

Verifies the existence of an association between a policy and an endpoint. A GET version of this API is also supported, with the same response code.

Response:

Status: 200 OK
Link: http://identity:35357/v3/policies/--policy-id--; rel=policy

Get the policy for the endpoint: GET /OS-ENDPOINT-POLICY/endpoints/{endpoint_id}/policy

Response:

Status: 200 OK
Link: http://identity:35357/v3/policies/--policy-id--; rel=policy

{
        "policy": {
            "blob": "--serialized-blob--",
            "id": "--policy-id--",
            "links": {
                "self": "http://identity:35357/v3/policies/--policy-id--"
            },
            "type": "--serialization-mime-type--"
    }
} 

Delete association with endpoint: DELETE /OS-ENDPOINT-POLICY/endpoints/{endpoint_id}/policy

Deletes an association between the policy and the endpoint.

Response:

Status: 204 No Content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment