获取策略详情

所属服务

sam

接口方法

GET

请求url

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

url 参数

参数名称说明参数类型是否必填备注
PolicyName策略名称(1-32位小写字母、数字、中划线组成,以字母开头,字母或数字结尾)string
Type策略类型(系统策略(System)、用户自定义策略(Custom))string
ActionGetPolicystring
Version2018-03-22string

返回参数

参数名称说明参数类型是否必填备注
PolicyType策略类型string
Description策略描述string
MessageMessagestring
AttachmentCount引用次数long
PolicyName策略名称string
CreateTime创建时间string
PolicyDocument策略授权语言string
CodeCodestring
CurrentVersionId当前使用版本号long

状态码

错误码(Code)错误提示(Message)http status code说明
ProductNotActive400null
MissingParameter400null
EntityNotExist400null

请求示例

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

返回示例

{
	"PolicyType": "Custom",
	"Description": "new_description",
	"Message": "调用成功",
	"AttachmentCount": 1.0,
	"RequestId": "e0ed7efc-2d5a-4cc7-904e-91845227aa17",
	"PolicyName": "Policytest",
	"CreateTime": "2020-01-17T07:44:41Z",
	"PolicyDocument": "{\"version\": 1, \"statement\": [{\"action\": [\"comb:nvm:*\"], \"effect\": \"allow\", \"resource\": [\"comb:nvm:*:*:*\"]}]}",
	"Code": "Success",
	"CurrentVersionId": 1.0
}