文档中心 API文档 查询指定用户已关联的策略列表

查询指定用户已关联的策略列表

更新时间:2023-09-04 10:37:38

适用产品

访问控制

接口描述

根据用户登录名查询该用户已关联的权限策略列表

调用频率

单用户调用频率:30/5min

推荐使用 Open API在线调试

Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试

请求参数

请求头

参数名称描述
*Accept-LanguageString

Path 参数

参数名称描述
*loginNameString
用户登录名(可传主子用户)

返回参数

Body 参数

参数名称描述
code
请求结果状态码
message
请求结果信息
policyId
策略id
policyName
策略名称
policyDescribe
国际化策略描述
languageCode
语言类型
languageValue
策略描述内容
policyType
策略类型:system:系统策略、custom自定义策略

错误码

错误代码(code)描述(message)HTTP状态码语义
24192000Param is null or invalid.200入参为空或非法
24192202Account is not exist200账号不存在
24192210The account in the parameter cannot be managed by api200传入的账号暂不支持使用接口管理
24192210The current account type does not support calling this api200当前账号类型不支持调用该接口
24191001The operator/loginName does not have the operating authority.200操作人无权限操作

示例

JSON
JSON
请求示例
复制代码 复制成功
#!/bin/bash
username="example_username"
apiKey="example_apiKey"
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://open.chinanetcenter.com/user/policy-attached/<loginName>" \
-X "GET" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-H "Accept-Language::zh_CN" \
返回示例
复制代码 复制成功
{
		"msg":"success",
		"code":"0",
		"data":[
			{
				"policyId":23639,
				"policyName":"glntest2222",
				"policyType":"CUSTOM",
				"policyDescribe":"testLanguage"
			},
			{
				"policyId":10,
				"policyName":"ActionReadOnly",
				"policyType":"SYSTEM",
				"policyDescribe":"ActionReadOnly"
			},
			{
				"policyId":11,
				"policyName":"ResourceReadOnly",
				"policyType":"SYSTEM",
				"policyDescribe":"ResourceReadOnly"
			},
			{
				"policyId":108,
				"policyName":"ReadOnlyAccess",
				"policyType":"SYSTEM",
				"policyDescribe":""
			}
		],
		"requestId":"eb7b67f3-d408-48dd"
	}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!