ListPolicies

Last updated: 2019-09-09 21:43:45

1. API Description

API domain name: cam.tencentcloudapi.com.

This API (ListPolicies) queries the list of policies.

Default API request rate limit: 20 requests/sec.

2. Input Parameters

The following parameters are required for requesting this API, including action-specific parameters and common parameters. For more information about common parameters for all requests, see Common Request Parameters.

Parameter name Required Type Description
Action Yes String Common parameter; the name of this API: ListPolicies
Version Yes String Common parameter; the version of this API: 2019-01-16
Region No String Common parameter; optional for this API.
Rp No Integer Quantity per page; 20 by default; the value must be greater than 0 and less than or equal to 200
Page No Integer Page number starting from 1; 1 by default; up to 200
Scope No String Valid values: All, QCS, and Local. "All" means to all policies will be returned; "QCS" means only predefined 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 array contains fields such as policyId, policyName, addTime, type, description, and createMode.
policyId: Policy ID
policyName: Policy name
addTime: Creation time of the policy
type: 1 means custom policy; 2 means predefined policy
description: Policy description
createMode: 1 indicates to create a policy by business permissions; other values indicate to view policy syntax and update policies through policy syntax
ServiceTypeList Array of String Reserved field
Note: This field may return null, indicating that no valid values can be obtained.
RequestId String The ID of the request. Each request returns a unique ID. The RequestId is required to troubleshoot issues.

4. Sample

Sample 1. Viewing Policy List

Input Sample Code

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

Output Sample Code

{
  "Response": {
    "ServiceTypeList": [],
    "List": [
      {
        "PolicyId": 16313162,
        "PolicyName": "QcloudAccessForCDNRole",
        "AddTime": "2019-04-19 10:55:31",
        "Type": 2,
        "Description": "CDN permissions (including but not limited to): CLS (create/read/update/delete CLS logsets/log topics, and search for/download/upload logs)." ,
        "CreateMode": 2,
        "Attachments": 0,
        "ServiceType": "cooperator"
      }
    ],
    "TotalNum": 239,
    "RequestId": "ae2bd2b7-1d55-4b0a-8154-e02407a2b390"
  }
}

5. Developer Resources

API Explorer

This tool provides various capabilities such as online call, signature verification, SDK code generation, and quick API retrieval that significantly reduce the difficulty of using TencentCloud API.

SDK

TencentCloud API 3.0 integrates software development toolkits (SDKs) that support various programming languages to make it easier for you to call the APIs.

TCCLI

6. Error Codes

The following error codes are API business logic-related. For other error codes, see Common Error Codes.

Error Code Description
InternalError.SystemError Internal error.
InvalidParameter.GroupIdError The GroupId field is invalid.
InvalidParameter.KeywordError The Keyword field is invalid.
InvalidParameter.ParamError Invalid input parameter.
InvalidParameter.ScopeError The Scope field is invalid.
InvalidParameter.ServiceTypeError The ServiceType field is invalid.
InvalidParameter.UinError The Uin field is invalid.