获取策略列表

所属服务

sam

接口方法

GET

请求url

/sam?Action=ListPolicies&Version=2018-03-22&Type=

url 参数

参数名称说明参数类型是否必填备注
ActionListPoliciesstring
Version2018-03-22string
Type策略类型(系统策略(System)、用户自定义策略(Custom)、所有(All)),默认 Allstring

返回参数

参数名称类型描述
PoliciesPolicy Object Array策略对象集合

状态码

无状态码

请求示例

https://open.cn-east-1.163yun.com/sam?Action=ListPolicies&Version=2018-03-22&Type=Custom

返回示例

{
	"Policies": [{
		"PolicyName": "Policytest2",
		"Description": "test2",
		"CurrentVersionId": 3.0,
		"AttachmentCount": 0.0,
		"PolicyType": "Custom",
		"PolicyDocument": "{\"version\": 1, \"statement\": [{\"action\": [\"comb:nvm:*\"], \"effect\": \"allow\", \"resource\": [\"comb:nvm:*:*:*\"]}]}",
		"CreateTime": "2020-01-20T02:24:27Z"
	}, {
		"PolicyName": "Policytest",
		"Description": "new_description",
		"CurrentVersionId": 1.0,
		"AttachmentCount": 1.0,
		"PolicyType": "Custom",
		"PolicyDocument": "{\"version\": 1, \"statement\": [{\"action\": [\"comb:nvm:*\"], \"effect\": \"allow\", \"resource\": [\"comb:nvm:*:*:*\"]}]}",
		"CreateTime": "2020-01-17T07:44:41Z"
	}, {
		"PolicyName": "test002",
		"Description": "test",
		"CurrentVersionId": 1.0,
		"AttachmentCount": 1.0,
		"PolicyType": "Custom",
		"PolicyDocument": "{\"version\": 1, \"statement\": [{\"action\": [\"comb:nvm:DescribeFlavors\", \"comb:nvm:CheckCreateParam\", \"comb:nvm:DescribeFlavorsInUse\", \"comb:nvm:DescribeImageQuota\", \"comb:nvm:DescribeImagesInUse\", \"comb:nvm:DescribeInstanceOsStatus\", \"comb:nvm:DescribeInstanceQuota\", \"comb:nvm:DescribeNetworksInUse\", \"comb:nvm:DescribeSnapshotQuota\", \"comb:nvm:DescribeSnapshotStrategyMapQuota\", \"comb:nvm:AssociateEipAddress\", \"comb:nvm:DescribeInstances\", \"comb:nvm:DescribeShareImageQuota\", \"comb:nvm:ModifyImagePermission\", \"comb:nvm:OfflineMigrateInstance\", \"comb:nvm:ReleaseEipAddress\"], \"effect\": \"allow\", \"resource\": [\"comb:nvm:*:*:*\"]}, {\"action\": [\"comb:nvm:*\"], \"effect\": \"allow\", \"resource\": [\"comb:nvm:*:*:instance/8b4c3ea9-dbf3-4a1a-bfbb-ccdd4a06ecc6\", \"comb:nvm:*:*:image/*\", \"comb:nvm:*:*:keypair/*\", \"comb:nvm:*:*:subnet/*\", \"comb:nvm:*:*:vpc/*\", \"comb:nvm:*:*:securityGroup/*\", \"comb:nvm:*:*:resourcepool/*\", \"comb:nvm:*:*:disk/*\"]}]}",
		"CreateTime": "2019-08-14T09:34:47Z"
	}, {
		"PolicyName": "test001",
		"Description": "sfasdf",
		"CurrentVersionId": 2.0,
		"AttachmentCount": 0.0,
		"PolicyType": "Custom",
		"PolicyDocument": "{\"version\": 1, \"statement\": [{\"action\": [\"comb:nvm:DescribeFlavors\", \"comb:nvm:CheckCreateParam\", \"comb:nvm:DescribeFlavorsInUse\", \"comb:nvm:DescribeImageQuota\", \"comb:nvm:DescribeImagesInUse\", \"comb:nvm:DescribeInstanceOsStatus\", \"comb:nvm:DescribeInstanceQuota\", \"comb:nvm:DescribeNetworksInUse\", \"comb:nvm:DescribeSnapshotQuota\", \"comb:nvm:DescribeSnapshotStrategyMapQuota\", \"comb:nvm:AssociateEipAddress\", \"comb:nvm:DescribeInstances\", \"comb:nvm:DescribeShareImageQuota\", \"comb:nvm:ModifyImagePermission\", \"comb:nvm:OfflineMigrateInstance\", \"comb:nvm:ReleaseEipAddress\"], \"effect\": \"allow\", \"resource\": [\"comb:nvm:*:*:*\"]}, {\"action\": [\"comb:nvm:*\"], \"effect\": \"allow\", \"resource\": [\"comb:nvm:*:*:instance/docker01\", \"comb:nvm:*:*:image/*\", \"comb:nvm:*:*:keypair/*\", \"comb:nvm:*:*:subnet/*\", \"comb:nvm:*:*:vpc/*\", \"comb:nvm:*:*:securityGroup/*\", \"comb:nvm:*:*:resourcepool/*\", \"comb:nvm:*:*:disk/*\"]}]}",
		"CreateTime": "2019-08-14T09:18:57Z"
	}],
	"Message": "调用成功",
	"RequestId": "ec20d1e6-b33a-4891-bb36-1f1f3160d7e9",
	"Code": "Success"
}