Domain name for API request: cam.tencentcloudapi.com.
This API (GetPolicy) is used to query and view policy details.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common Params. The value used for this API: GetPolicy. |
Version | Yes | String | Common Params. The value used for this API: 2019-01-16. |
Region | No | String | Common Params. This parameter is not required for this API. |
PolicyId | Yes | Integer | Policy ID |
Parameter Name | Type | Description |
---|---|---|
PolicyName | String | Policy name Note: This field may return null, indicating that no valid value was found. |
Description | String | Policy description Note: This field may return null, indicating that no valid value was found. |
Type | Integer | 1: Custom policy; 2: Preset policy Note: This field may return null, indicating that no valid value was found. |
AddTime | Timestamp | Time created Note: This field may return null, indicating that no valid value was found. |
UpdateTime | Timestamp | Time of latest update Note: This field may return null, indicating that no valid value was found. |
PolicyDocument | String | Policy document Note: This field may return null, indicating that no valid value was found. |
PresetAlias | String | Remarks Note: this field may return null, indicating that no valid values can be obtained. |
IsServiceLinkedRolePolicy | Integer | Whether it is a service-linked policy Note: this field may return null, indicating that no valid values can be obtained. |
RequestId | String | The unique request ID, which is returned for each request. RequestId is required for locating a problem. |
https://cam.tencentcloudapi.com/?Action=GetPolicy
&PolicyId=17698703
&<Common request parameters>
{
"Response": {
"PolicyDocument": "{\"version\":\"2.0\",\"statement\":[{\"effect\":\"allow\",\"action\":[\"name\\/cos:*\"],\"resource\":[\"*\"]}]}",
"UpdateTime": "2019-04-29 21:28:32",
"AddTime": "2019-04-29 21:18:40",
"PolicyName": "test-2019-04-29",
"Description": "Test policy",
"Type": 1,
"RequestId": "845b309d-e531-402d-a4f6-ec124f06738b",
"PresetAlias": "Remarks",
"IsServiceLinkedRolePolicy": 0
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
InternalError.SystemError | Internal error. |
InvalidParameter.ParamError | Invalid input parameter. |
InvalidParameter.PolicyIdError | Input parameter PolicyId invalid. |
ResourceNotFound.PolicyIdNotFound | Resources specified by PolicyId does not exist. |
本页内容是否解决了您的问题?