Policy Management
    • PDF

    Policy Management

    • PDF

    Article summary

    Profile Policies

    1. Add Policy to a Profile

    This POST method adds a policy to a profile to grant resources to the end user.

    POST{{url}}/api/resource-manager/profiles/{profileId}/policies

    Request Parameters

    The request parameters used in this method are shown in the following table:

    ParameterDescriptionData TypeRequired
    profileIdProfile IDStringMandatory

    Request Example

    curl --location --request POST '{{url}}/api/resource-manager/profiles/{profileId}/policies' \
    --header 'Authorization: TOKEN {{token}}' \
    --data-raw '{
      "id": "string",
      "name": "string",
      "isActive": true,
      "isDraft": true,
      "isReadOnly": true,
      "condition": {},
      "resource": "string",
      "accessLevel": "string",
      "consumer": "string",
      "members": [
        {
          "id": "string",
          "name": "string",
          "memberType": "User"
        }
      ],
      "resourceLabels": {
        "additionalProp1": [
          "string"
        ],
        "additionalProp2": [
          "string"
        ],
        "additionalProp3": [
          "string"
        ]
      }
    }'

    Response Example 

    Status: 201 Created
    {
      "id": "string",
      "name": "string",
      "isActive": true,
      "isDraft": true,
      "isReadOnly": true,
      "condition": {},
      "resource": "string",
      "accessLevel": "string",
      "consumer": "string",
      "members": [
        {
          "id": "string",
          "name": "string",
          "memberType": "User"
        }
      ],
      "resourceLabels": {
        "additionalProp1": [
          "string"
        ],
        "additionalProp2": [
          "string"
        ],
        "additionalProp3": [
          "string"
        ]
      }
    }

    2. Get All Policies Associated with Profiles

    This GET method is used to get all policies associated with a profile.

    GET{{url}}/api/resource-manager/profiles/{profileId}/policies

    Request Parameters

    The request parameters used in this method are shown in the following table:

    ParameterDescriptionData TypeRequired
    profileIdProfile IDStringMandatory
    filterFilter profiles by key. For example, filter=key eqprofile1StringOptional

    Request Example

    curl --location --request GET '{{url}}/api/resource-manager/profiles/{profileId}/policies' \
    --header 'Authorization: TOKEN {{token}}'

    Response Example 

    Status: 200 OK
    [
      {
        "id": "string",
        "name": "string",
        "isActive": true,
        "isDraft": true,
        "isReadOnly": true,
        "condition": {},
        "resource": "string",
        "accessLevel": "string",
        "consumer": "string",
        "members": [
          {
            "id": "string",
            "name": "string",
            "memberType": "User"
          }
        ],
        "resourceLabels": {
          "additionalProp1": [
            "string"
          ],
          "additionalProp2": [
            "string"
          ],
          "additionalProp3": [
            "string"
          ]
        }
      }
    ]

    3. Get the Policy Details by ID

    This GET method is used to get policy details for a given policy Id.

    GET{{url}}/api/resource-manager/profiles/{profileId}/policies/{policyId}

    Request Parameters

    The request parameters used in this method are shown in the following table:

    ParameterDescriptionData TypeRequired
    profileIdProfile IDStringMandatory
    policyIdPolicy ID to get policy details.StringMandatory

    Request Example

    curl --location -g --request GET '{{url}/api/resource-manager/profiles/{profileId}/policies/{policyId}' \
    --header 'Authorization: TOKEN {{token}}'

    Response Example 

    Status: 200 OK
    
      "id": "string",
      "name": "string",
      "isActive": true,
      "isDraft": true,
      "isReadOnly": true,
      "condition": {},
      "resource": "string",
      "accessLevel": "string",
      "consumer": "string",
      "members": [
        {
          "id": "string",
          "name": "string",
          "memberType": "User"
        }
      ],
      "resourceLabels": {
        "additionalProp1": [
          "string"
        ],
        "additionalProp2": [
          "string"
        ],
        "additionalProp3": [
          "string"
        ]
      }
    }

    4. Update Profile Policy 

    The PATCH method lets you update policy details for a given policy Id.

    PATCH{{url}}/api/resource-manager/profiles/{profileId}/policies/{policyId}

    Request Parameters

    The request parameters used in this method are shown in the following table:

    ParameterDescriptionData TypeRequired
    profileIdProfile IDStringMandatory
    policyIdPolicy ID to update policy details.
    StringMandatory

    Request Example

    curl --location --request PATCH '{{url}}/api/resource-manager/profiles/{profileId}/policies/{policyId}' \
    --header 'Authorization: TOKEN {{token}}' \
    --data-raw '{
      "id": "string",
      "name": "string",
      "isActive": true,
      "isDraft": true,
      "isReadOnly": true,
      "condition": {},
      "resource": "string",
      "accessLevel": "string",
      "consumer": "string",
      "members": [
        {
          "id": "string",
          "name": "string",
          "memberType": "User"
        }
      ],
      "resourceLabels": {
        "additionalProp1": [
          "string"
        ],
        "additionalProp2": [
          "string"
        ],
        "additionalProp3": [
          "string"
        ]
      }
    }

    Response Example 

    Status: 204 No Content

    5. Delete Profile Policy

    The DELETE method allows you to delete the profile policy created in the system.

    DELETE{{url}}/api/resource-manager/profiles/{profileId}/policies/{policyId}

    Request Parameters

    The request parameters used in this method are shown in the following table:

    ParameterDescriptionData TypeRequired
    profileIdProfile IDStringMandatory
    policyIdPolicy ID to delete policy details
    StringMandatory

    Request Example

    curl --location --request DELETE '{{url}}/api/resource-manager/profiles/{profileId}/policies/{policyId}' \
    --header 'Authorization: TOKEN {{token}}'

    Response Example 

    The profile policy is deleted.

    Status: 204 No Content

    Resource Policy

    1. Add Policy

    This POST method is used to add policy to delegate resource access to users.

    POST{{url}}/api/resource-manager/policies


    Request Example

    curl --location --request POST '{{url}}/api/resource-manager/policies' \
    --header 'Authorization: TOKEN {{token}}'
    --data-raw '
    {
      "id": "string",
      "name": "string",
      "isActive": true,
      "isDraft": true,
      "isReadOnly": true,
      "condition": {},
      "resource": "string",
      "accessLevel": "string",
      "consumer": "string",
      "members": [
        {
          "id": "string",
          "name": "string",
          "memberType": "User"
        }
      ],
      "resourceLabels": {
        "additionalProp1": [
          "string"
        ],
        "additionalProp2": [
          "string"
        ],
        "additionalProp3": [
          "string"
        ]
      } 
    }

    Response Example 

    Status: 201 Created
    {
      "id": "string",
      "name": "string",
      "isActive": true,
      "isDraft": true,
      "isReadOnly": true,
      "condition": {},
      "resource": "string",
      "accessLevel": "string",
      "consumer": "string",
      "members": [
        {
          "id": "string",
          "name": "string",
          "memberType": "User"
        }
      ],
      "resourceLabels": {
        "additionalProp1": [
          "string"
        ],
        "additionalProp2": [
          "string"
        ],
        "additionalProp3": [
          "string"
        ]
      }
    }

    2. Get All Resource Policies

    This GET method is used to get all resource policies.

    GET{{url}}/api/resource-manager/policies?filter=name eq test

    Request Parameters

    The request parameters used in this method are shown in the following table:

    ParameterDescriptionData TypeRequired
    filter
    Parameter to filter policy by name.StringOptional

    Request Example

    curl --location --request GET '{{url}}/api/resource-manager/policies?' \
    --header 'Authorization: TOKEN {{token}}'

    Response Example 

    Status: 200 OK
    [
      {
        "id": "string",
        "name": "string",
        "isActive": true,
        "isDraft": true,
        "isReadOnly": true,
        "condition": {},
        "resource": "string",
        "accessLevel": "string",
        "consumer": "string",
        "members": [
          {
            "id": "string",
            "name": "string",
            "memberType": "User"
          }
        ],
        "resourceLabels": {
          "additionalProp1": [
            "string"
          ],
          "additionalProp2": [
            "string"
          ],
          "additionalProp3": [
            "string"
          ]
        }
      }
    ]

    3. Get Policy Details by PolicyId

    This GET method is used to get policy details for a given policy id.

    GET{{url}}/api/resource-manager/policies/{policyId}

    Request Parameters

    The request parameters used in this method are shown in the following table:

    ParameterDescriptionData TypeRequired
    policyIdProfile policy ID.StringMandatory

    Request Example

    curl --location --request GET '{{url}}/api/resource-manager/policies/{policyId}' \
    --header 'Authorization: TOKEN {{token}}' 

    Response Example 

    Status: 201 OK
    {
      "id": "string",
      "name": "string",
      "isActive": true,
      "isDraft": true,
      "isReadOnly": true,
      "condition": {},
      "resource": "string",
      "accessLevel": "string",
      "consumer": "string",
      "members": [
        {
          "id": "string",
          "name": "string",
          "memberType": "User"
        }
      ],
      "resourceLabels": {
        "additionalProp1": [
          "string"
        ],
        "additionalProp2": [
          "string"
        ],
        "additionalProp3": [
          "string"
        ]
      }
    }

    4. Update Resource Policy Details

    The PATCH method allows you to update resource policy details for a given policy id.

    PATCH{{url}}/api/resource-manager/policies/{policyId}

    Request Parameters

    The request parameters used in this method are shown in the following table:

    ParameterDescriptionData TypeRequired
    policyIdPolicy IDStringMandatory

    Request Example

    curl --location --request PATCH '{{url}}/api/resource-manager/policies/{policyId}' \
    --header 'Authorization: TOKEN {{token}}' \
    --data-raw '{
      "id": "string",
      "name": "string",
      "isActive": true,
      "isDraft": true,
      "isReadOnly": true,
      "condition": {},
      "resource": "string",
      "accessLevel": "string",
      "consumer": "string",
      "members": [
        {
          "id": "string",
          "name": "string",
          "memberType": "User"
        }
      ],
      "resourceLabels": {
        "additionalProp1": [
          "string"
        ],
        "additionalProp2": [
          "string"
        ],
        "additionalProp3": [
          "string"
        ]
      }
    }'

    Response Example 

    Status: 204 No Content

    5. Delete Resource Policy

    This DELETE method is used to delete a resource policy.

    DELETE{{url}}/api/resource-manager/policies/{policyId}

    Request Parameters

    The request parameters used in this method are shown in the following table:

    ParameterDescriptionData TypeRequired
    policyIdProfile policy IDStringMandatory

    Request Example

    curl --location --request DELETE '{{url}}/api/resource-manager/policies/{policyId}' \
    --header 'Authorization: TOKEN {{token}}'

    Response Example 

    Status: 200 OK

    Was this article helpful?