ListPolicies

Last updated: 2020-01-13 17:38:26

PDF

1. API Description

Domain name for API request: cam.tencentcloudapi.com.

This API (ListPolicies) is used to query the list of policies.

A maximum of 20 requests can be initiated per second for this API.

2. Input Parameters

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 parameter. The value used for this API: ListPolicies
Version Yes String Common parameter. The value used for this API: 2019-01-16
Region No String Common parameter. This parameter is not required for this API.
Rp No Integer Number of entries per page: must be greater than 0 and no greater than 200. Default is 20
Page No Integer Page number. Starts from 1 and cannot be greater than 200. Default is 1
Scope No String Valid values: All, QCS, and Local. All means all policies will be returned; QCS means only preset policies will be returned; Local means only custom policies will be returned. All is the default value
Keyword No String Filter by policy name

3. Output Parameters

Parameter Name Type Description
TotalNum Integer Total number of policies
List Array of StrategyInfo Policy array. Each item in the array has the fields policyId, policyName, addTime, type, description, and createMode
policyId: Policy ID
policyName: Policy name
addTime: Time policy created
type: 1 is custom policy; 2 is preset policy
description: Policy description
createMode: 1 indicates a policy created based on business permissions, while other values indicate that the policy syntax can be viewed and the policy can be updated using the policy syntax.
ServiceTypeList Array of String Reserved field
Note: This field may return null, indicating that no valid value was found.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1

Input Example

https://cam.tencentcloudapi.com/?Action=ListPolicies
&Rp=1
&Page=10
&<common request parameters>

Output Example

{
  "Response": {
    "ServiceTypeList": [],
    "List": [
      {
        "PolicyId": 16313162,
        "PolicyName": "QcloudAccessForCDNRole",
        "AddTime": "2019-04-19 10:55:31",
        "Type": 2,
        "Description": "Tencent Cloud Content Distribution Network (CDN) operation permissions include log service (CLS) additions, deletions, changes, and query log sets, additions, deletions, changes, and query log topics, search download upload logs.",
        "CreateMode": 2,
        "Attachments": 0,
        "ServiceType": "cooperator"
      }
    ],
    "TotalNum": 239,
    "RequestId": "ae2bd2b7-1d55-4b0a-8154-e02407a2b390"
  }
}

5. Developer Resources

API Explorer

This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

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.GroupIdError GroupId field invalid.
InvalidParameter.KeywordError Keyword field invalid.
InvalidParameter.ParamError Invalid input parameter.
InvalidParameter.ScopeError Scope field invalid.
InvalidParameter.ServiceTypeError ServiceType field invalid.
InvalidParameter.UinError Uin field invalid.