Help Center> Organizations> API Reference> API> Managing Policies> Getting Policy Information
Updated on 2024-03-15 GMT+08:00

Getting Policy Information

Function

This API is used to get the information about the specified policy. It can be called only from the organization's management account or from a member account that is a delegated administrator for a cloud service.

URI

GET /v1/organizations/policies/{policy_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

policy_id

Yes

String

Unique ID of the policy.

Maximum: 130

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Security-Token

No

String

Security token (session token) of your temporary security credentials. If a temporary security credential is used, this header is required.

Minimum: 1

X-Language

No

String

Language of the returned results.

Enumeration values:

  • zh-cn

  • en-us

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

policy

PolicyDto object

Details about a policy.

Table 4 PolicyDto

Parameter

Type

Description

content

String

Text content of the policy.

Minimum: 0

Maximum: 20000

policy_summary

PolicySummaryDto object

Information about a policy (policy content not included).

Table 5 PolicySummaryDto

Parameter

Type

Description

is_builtin

Boolean

A boolean value indicating whether the specified policy is a system policy. If the value is true, the policy is a system policy. You can attach the policy to roots, OUs, or accounts, but you cannot edit it.

description

String

Description of the policy.

Maximum: 512

id

String

Unique ID of the policy.

Minimum: 1

Maximum: 130

urn

String

Uniform resource name of the policy.

Minimum: 1

Maximum: 1500

name

String

Name of the policy.

Minimum: 1

Maximum: 64

type

String

Policy type. It can be service_control_policy or tag_policy.

Minimum: 1

Maximum: 64

Example Requests

Getting Policy Information

GET https://{hostname}/v1/organizations/policies/{policy_id}

Example Responses

Status code: 200

Successful.

{
  "policy" : {
    "content" : "{\"Version\":\"5.0\",\"Statement\":[{\"Sid\":\"Statement1\",\"Effect\":\"Allow\",\"Action\":[\"*\"],\"Resource\":[\"*\"]}]}",
    "policy_summary" : {
      "is_builtin" : false,
      "description" : "auto0923161647582JIeTPolicydesc",
      "id" : "p-scnsbv8byvfjp612ooojkdamzcgtp6l9",
      "urn" : "organizations::0a6d25d23900d45c0faac010e0fb4de0:policy:o-fhkmi6mek7wlqdp6nideqhb47qwtjdsv/service_control_policy/p-b4wpejd02o66g0pvfinvsatp4t9krfum",
      "name" : "auto0923161647583CXosPolicyName",
      "type" : "service_control_policy"
    }
  }
}

Status Codes

Status Code

Description

200

Successful.

Error Codes

See Error Codes.