查询仓库权限
功能介绍
查询仓库权限
调用方法
请参见如何调用API。
URI
GET /cloudartifact/v5/repositories/{project_id}/{repo_id}/privileges
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
参数解释: 项目ID,可以从调用API处获取,也可以从控制台获取。获取方式请参考获取项目ID。 约束限制: 只能由英文字母、数字组成,且长度为32个字符。 取值范围: 不涉及。 默认取值: 无。 |
repo_id |
是 |
String |
参数解释: 仓库id。可在私有库仓库概览界面查看。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 无。 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
x-language |
否 |
String |
参数解释: 语言类型。 约束限制: 不涉及。 取值范围: 可选值:zh-cn,en-us。 默认取值: zh-cn。 |
响应参数
状态码:200
参数 |
参数类型 |
描述 |
---|---|---|
status |
String |
参数解释: 请求成功、失败状态。 取值范围: success:请求成功。 error:请求失败。 |
trace_id |
String |
参数解释: 请求id,当前请求唯一标识。 取值范围: 数字及中划线(-)组成的字符串。 |
result |
result object |
参数解释: 查询结果。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 无。 |
参数 |
参数类型 |
描述 |
---|---|---|
$role_name |
Array of Privilege objects |
参数解释: 权限信息。$role_name是动态的角色名称。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 无。 |
参数 |
参数类型 |
描述 |
---|---|---|
role_id |
String |
参数解释: 角色id。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 无。 |
role_name |
String |
参数解释: 角色名称。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 无。 |
role_chinese_name |
String |
参数解释: 角色中文名。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 无。 |
project_id |
String |
参数解释: 项目id。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 无。 |
area_service_id |
String |
参数解释: 地域服务id。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 无。 |
granted_object_path |
String |
参数解释: 授权对象路径。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 无。 |
granted_object_type_id |
String |
参数解释: 授权对象id。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 无。 |
operations |
String |
参数解释: 操作权限,多个权限以英文逗号隔开。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 无。 |
operations_index |
Array of integers |
参数解释: 操作权限索引。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 无。 |
请求示例
查询仓库权限
https://{URL}/cloudartifact/v5/repositories/73e0adda5ace41fxxxxec2a28a06/xx-xxx-x_09d2ca2f5080dxxxc00ae5bad0a0_docker2_5_27/privileges
响应示例
状态码:200
OK
{ "status" : "success", "trace_id" : "9d97e8db2a9348xxx046f0b91e78ee", "result" : { "System engineer" : [ { "operations" : "downloadorview,import,upload,export", "role_id" : "0e9fa4b22c3cxx3128e2eac3ba17", "role_name" : "System engineer", "role_chinese_name" : "系统工程师", "project_id" : "73e0adda5acexx8a1f869ec2a28a06", "area_service_id" : "c0ec24a435axxb07785d882cf23a", "granted_object_path" : "/codeartsartifact/artifact/component/xx-xxx-x_09d2ca2f508xx51c00ae5bad0a0_docker2_5_27", "granted_object_type_id" : "f1ba90c49e174xxc9316b45408921", "operations_index" : null }, { "operations" : "editrepository,restore,physicdelete", "role_id" : "0e9fa4b22c3c41xx3128e2eac3ba17", "role_name" : "System engineer", "role_chinese_name" : "系统工程师", "project_id" : "73e0adda5acexxf869ec2a28a06", "area_service_id" : "c0ec24a435a64xxb07785d882cf23a", "granted_object_path" : "/codeartsartifact/artifact/repo/xx-xxx-x_09d2ca2f5080dxxxf51c00ae5bad0a0_docker2_5_27", "granted_object_type_id" : "f9fa2e82072xxxa7a0b1fa99ce931e", "operations_index" : null } ], "Project manager" : [ { "operations" : "deleteorredeploy,downloadorview,import,upload,export", "role_id" : "1d87e5606e554xxxx982e4baf1a2", "role_name" : "Project manager", "role_chinese_name" : "项目经理", "project_id" : "73e0adda5ace41f2xxxxec2a28a06", "area_service_id" : "c0ec24a435a64xxxx85d882cf23a", "granted_object_path" : "/codeartsartifact/artifact/component/xx-xxx-x_09d2ca2f5xxxx60f51c00ae5bad0a0_docker2_5_27", "granted_object_type_id" : "f1ba90c4xxxxfaec9316b45408921", "operations_index" : null }, { "operations" : "createrepository,editrepository,restore,deleterepository,physicdelete,restoreall,clearall", "role_id" : "1d87e5606e5xxxxc4982e4baf1a2", "role_name" : "Project manager", "role_chinese_name" : "项目经理", "project_id" : "73e0adda5ace41fxxxec2a28a06", "area_service_id" : "c0ec24a435a6407xxxxd882cf23a", "granted_object_path" : "/codeartsartifact/artifact/repo/xx-xxx-x_09d2ca2f50xxxxf51c00ae5bad0a0_docker2_5_27", "granted_object_type_id" : "f9fa2e8207254xxxxa0b1fa99ce931e", "operations_index" : null } ] } }
状态码
状态码 |
描述 |
---|---|
200 |
OK |
错误码
请参见错误码。