調(diào)用ListControlPolicies查詢管控策略列表。

本文將提供一個示例,查詢資源目錄內(nèi)的系統(tǒng)管控策略列表。返回結(jié)果顯示,該資源目錄內(nèi)只有一條名為FullAliyunAccess的系統(tǒng)管控策略。

調(diào)試

您可以在OpenAPI Explorer中直接運行該接口,免去您計算簽名的困擾。運行成功后,OpenAPI Explorer可以自動生成SDK代碼示例。

請求參數(shù)

名稱 類型 是否必選 示例值 描述
Action String ListControlPolicies

要執(zhí)行的操作。取值:ListControlPolicies

PolicyType String System

管控策略類型。取值:

  • System:系統(tǒng)管控策略。
  • Custom:自定義管控策略。
PageNumber Integer 1

頁碼。

起始值:1。默認值:1。

PageSize Integer 10

分頁時每頁顯示的數(shù)據(jù)條數(shù)。

取值范圍:1~100。默認值:10。

Language String zh-CN

指定返回結(jié)果中管控策略描述的語言。取值:

  • zh-CN(默認值):中文。
  • en:英文。
  • ja:日文。
說明 該參數(shù)僅在系統(tǒng)管控策略時有效。

關(guān)于公共請求參數(shù)的詳情,請參見公共參數(shù)

返回數(shù)據(jù)

名稱 類型 示例值 描述
TotalCount Integer 1

管控策略數(shù)量。

RequestId String 9424A34C-3471-45AD-B6AB-924BBDFE42F9

請求ID。

PageSize Integer 10

分頁時每頁顯示的數(shù)據(jù)條數(shù)。

PageNumber Integer 1

頁碼。

ControlPolicies Array of ControlPolicy

管控策略列表。

ControlPolicy
UpdateDate String 2020-08-05T06:32:24Z

管控策略更新時間。

Description String 支持阿里云所有操作的系統(tǒng)管控策略

管控策略描述。

EffectScope String All

管控策略生效范圍。取值:

  • All:表示該管控策略針對阿里云賬號、RAM用戶或RAM角色生效。
  • RAM:表示該管控策略僅針對RAM用戶或RAM角色生效。
AttachmentCount String 44

管控策略被引用的次數(shù)。

PolicyName String FullAliyunAccess

管控策略名稱。

PolicyId String cp-FullAliyunAccess

管控策略ID。

CreateDate String 2020-08-05T06:32:24Z

管控策略創(chuàng)建時間。

PolicyType String System

管控策略類型。取值:

  • System:系統(tǒng)管控策略。
  • Custom:自定義管控策略。

示例

請求示例

https://resourcemanager.aliyuncs.com/?Action=ListControlPolicies
&PolicyType=System
&<公共請求參數(shù)>

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<?xml version="1.0" encoding="UTF-8" ?>
<ListControlPoliciesResponse>
	<TotalCount>1</TotalCount>
	<RequestId>9424A34C-3471-45AD-B6AB-924BBDFE42F9</RequestId>
	<PageSize>10</PageSize>
	<PageNumber>1</PageNumber>
	<ControlPolicies>
		<ControlPolicy>
			<PolicyType>System</PolicyType>
			<UpdateDate>2020-08-05T06:32:24Z</UpdateDate>
			<Description>支持阿里云所有操作的系統(tǒng)管控策略</Description>
			<AttachmentCount>44</AttachmentCount>
			<PolicyName>FullAliyunAccess</PolicyName>
			<CreateDate>2020-08-05T06:32:24Z</CreateDate>
			<PolicyId>cp-FullAliyunAccess</PolicyId>
			<EffectScope>All</EffectScope>
		</ControlPolicy>
	</ControlPolicies>
</ListControlPoliciesResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "TotalCount" : 1,
  "RequestId" : "9424A34C-3471-45AD-B6AB-924BBDFE42F9",
  "PageSize" : 10,
  "PageNumber" : 1,
  "ControlPolicies" : {
    "ControlPolicy" : [ {
      "PolicyType" : "System",
      "UpdateDate" : "2020-08-05T06:32:24Z",
      "Description" : "支持阿里云所有操作的系統(tǒng)管控策略",
      "AttachmentCount" : 44,
      "PolicyName" : "FullAliyunAccess",
      "CreateDate" : "2020-08-05T06:32:24Z",
      "PolicyId" : "cp-FullAliyunAccess",
      "EffectScope" : "All"
    } ]
  }
}

錯誤碼

訪問錯誤中心查看更多錯誤碼。