MENU
      Get policy

        Get policy


        Article summary

        Available in Classic and VPC

        Get policy details.

        Request

        This section describes the request format. The method and URI are as follows:

        MethodURI
        GET/api/v1/policies/{policyId}

        Request headers

        For information about the headers common to all Sub Account APIs, see Sub Account request headers.

        Request path parameters

        You can use the following path parameters with your request:

        FieldTypeRequiredDescription
        policyIdStringRequiredPolicy ID

        Request query parameters

        You can use the following query parameters with your request:

        FieldTypeRequiredDescription
        withPermissionsBooleanOptionalWhether to display detailed permissions for a policy
        • true | false (default)
          • true: display
          • false: not display

        Request example

        The request example is as follows:

        curl --location --request GET 'https://subaccount.apigw.ntruss.com/api/v1/policies/48ac3260-****-****-****-246e96591594?withPermissions=true' \
        --header 'x-ncp-apigw-timestamp: {Timestamp}' \
        --header 'x-ncp-iam-access-key: {Access Key}' \
        --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
        --header 'Accept: application/json'
        Shell

        Response

        This section describes the response format.

        Response body

        The response body includes the following data:

        FieldTypeRequiredDescription
        policyIdString-Policy ID
        policyNameString-Policy Name
        policyTypeString-Policy type
        • SYSTEM_MANAGED | USER_CREATED
          • SYSTEM_MANAGED: System Managed Policies
          • USER_CREATED: User Created Policies
        policyDescString-Policy description
        nrnString-NAVER Cloud Platform resource identification value for policy
        permissionsArray-Allowed permission list
        • Display if withPermissions is true

        permissions

        The following describes permissions.

        FieldTypeRequiredDescription
        effectString-Permission allowance
        • Allow (Valid value)
        targetsArray-Permission allowance target
        conditionObject-Policy condition
        • Display if the policy includes a condition
        condition.{operator}Object-Policy condition operator
        condition.{operator}.{key}Object-Policy condition key
        condition.{operator}.{value}Array-Policy condition value

        targets

        The following describes targets.

        FieldTypeRequiredDescription
        productString-Allowable service code
        actionsArray-Allowable action
        resourceNrnsArray-NAVER Cloud Platform resource identification value for allowable target

        Response status codes

        For information about the HTTP status codes common to all Sub Account APIs, see Sub Account status codes.

        Response example

        The response example is as follows:

        {
          "policyId": "b38802f0-****-****-****-246e966ebec4",
          "policyName": "mypolicy",
          "policyType": "USER_CREATED",
          "policyDesc": "my policy",
          "nrn": "nrn:PUB:IAM::5*****8:Policy/b38802f0-****-****-****-246e966ebec4",
          "permissions": [
            {
              "effect": "Allow",
              "targets": [
                {
                  "product": "VPCServer",
                  "actions": [
                    "Change*",
                    "View*"
                  ],
                  "resourceNrns": [
                    "nrn:PUB:VPCServer::5*****8:*"
                  ]
                }
              ],
              "condition": {
                "StringEquals": {
                  "ncp:principalName": [
                    "abc"
                  ]
                }
              }
            },
            {
              "effect": "Allow",
              "targets": [
                {
                  "product": "ExternalAccess",
                  "actions": [
                    "Change*",
                    "View*"
                  ],
                  "resourceNrns": [
                    "nrn:PUB:ExternalAccess::5*****8:*"
                  ]
                }
              ],
              "condition": {}
            }
          ]
        }
        JSON

        Was this article helpful?

        Changing your password will log you out immediately. Use the new password to log back in.
        First name must have atleast 2 characters. Numbers and special characters are not allowed.
        Last name must have atleast 1 characters. Numbers and special characters are not allowed.
        Enter a valid email
        Enter a valid password
        Your profile has been successfully updated.