查询策略组应用对象
功能介绍
查询指定策略组所应用的对象。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
URI
GET /v2/{project_id}/policy-groups/{policy_group_id}/targets
| 
        参数  | 
      
        是否必选  | 
      
        参数类型  | 
      
        描述  | 
     
|---|---|---|---|
| 
        project_id  | 
      
        是  | 
      
        String  | 
      
        项目ID。  | 
     
| 
        policy_group_id  | 
      
        是  | 
      
        String  | 
      
        策略组id。  | 
     
| 
        参数  | 
      
        是否必选  | 
      
        参数类型  | 
      
        描述  | 
     
|---|---|---|---|
| 
        target_type  | 
      
        否  | 
      
        String  | 
      
        应用对象的类型。 
  | 
     
| 
        target_name  | 
      
        否  | 
      
        String  | 
      
        对象名称,支持模糊查询。  | 
     
| 
        limit  | 
      
        否  | 
      
        Integer  | 
      
        每页数量。范围0-1000。  | 
     
| 
        offset  | 
      
        否  | 
      
        String  | 
      
        偏移量。  | 
     
请求参数
| 
        参数  | 
      
        是否必选  | 
      
        参数类型  | 
      
        描述  | 
     
|---|---|---|---|
| 
        X-Auth-Token  | 
      
        否  | 
      
        String  | 
      
        用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。  | 
     
| 
        Content-Type  | 
      
        是  | 
      
        String  | 
      
        发送的实体的MIME类型,如:application/json。  | 
     
响应参数
状态码:200
| 
        参数  | 
      
        参数类型  | 
      
        描述  | 
     
|---|---|---|
| 
        targets  | 
      
        Array of Target objects  | 
      
        应用对象列表。  | 
     
| 
        total_count  | 
      
        Integer  | 
      
        用户列表数量。  | 
     
| 
        参数  | 
      
        参数类型  | 
      
        描述  | 
     
|---|---|---|
| 
        target_id  | 
      
        String  | 
      
        对象ID。  | 
     
| 
        target_name  | 
      
        String  | 
      
        对象名称,长度不能超过55个字符。  | 
     
| 
        target_type  | 
      
        String  | 
      
        对象类型。 
 target_id:为桌面的SID。 target_name:为桌面name。 target_id:为用户ID。 target_name:为用户name。 target_id:为用户组ID。 target_name:为用户组name。 target_id:终端IP地址。 target_name:终端IP地址。 target_id:OUID。 target_name:OU名称。 target_id:为桌面池的ID。 target_name:为桌面池name。 target_id:default-apply-all-targets。 target_name:All-Targets。  | 
     
状态码:400
| 
        参数  | 
      
        参数类型  | 
      
        描述  | 
     
|---|---|---|
| 
        error_code  | 
      
        String  | 
      
        错误码。  | 
     
| 
        error_msg  | 
      
        String  | 
      
        错误描述。  | 
     
| 
        encoded_authorization_message  | 
      
        String  | 
      
        加密后的详细拒绝原因,用户可以自行调用STS服务的decode-authorization-message接口进行解密。  | 
     
状态码:401
| 
        参数  | 
      
        参数类型  | 
      
        描述  | 
     
|---|---|---|
| 
        error_code  | 
      
        String  | 
      
        错误码。  | 
     
| 
        error_msg  | 
      
        String  | 
      
        错误描述。  | 
     
| 
        encoded_authorization_message  | 
      
        String  | 
      
        加密后的详细拒绝原因,用户可以自行调用STS服务的decode-authorization-message接口进行解密。  | 
     
状态码:403
| 
        参数  | 
      
        参数类型  | 
      
        描述  | 
     
|---|---|---|
| 
        error_code  | 
      
        String  | 
      
        错误码。  | 
     
| 
        error_msg  | 
      
        String  | 
      
        错误描述。  | 
     
| 
        encoded_authorization_message  | 
      
        String  | 
      
        加密后的详细拒绝原因,用户可以自行调用STS服务的decode-authorization-message接口进行解密。  | 
     
状态码:404
| 
        参数  | 
      
        参数类型  | 
      
        描述  | 
     
|---|---|---|
| 
        error_code  | 
      
        String  | 
      
        错误码。  | 
     
| 
        error_msg  | 
      
        String  | 
      
        错误描述。  | 
     
| 
        encoded_authorization_message  | 
      
        String  | 
      
        加密后的详细拒绝原因,用户可以自行调用STS服务的decode-authorization-message接口进行解密。  | 
     
状态码:405
| 
        参数  | 
      
        参数类型  | 
      
        描述  | 
     
|---|---|---|
| 
        error_code  | 
      
        String  | 
      
        错误码。  | 
     
| 
        error_msg  | 
      
        String  | 
      
        错误描述。  | 
     
| 
        encoded_authorization_message  | 
      
        String  | 
      
        加密后的详细拒绝原因,用户可以自行调用STS服务的decode-authorization-message接口进行解密。  | 
     
状态码:500
| 
        参数  | 
      
        参数类型  | 
      
        描述  | 
     
|---|---|---|
| 
        error_code  | 
      
        String  | 
      
        错误码。  | 
     
| 
        error_msg  | 
      
        String  | 
      
        错误描述。  | 
     
| 
        encoded_authorization_message  | 
      
        String  | 
      
        加密后的详细拒绝原因,用户可以自行调用STS服务的decode-authorization-message接口进行解密。  | 
     
状态码:503
| 
        参数  | 
      
        参数类型  | 
      
        描述  | 
     
|---|---|---|
| 
        error_code  | 
      
        String  | 
      
        错误码。  | 
     
| 
        error_msg  | 
      
        String  | 
      
        错误描述。  | 
     
| 
        encoded_authorization_message  | 
      
        String  | 
      
        加密后的详细拒绝原因,用户可以自行调用STS服务的decode-authorization-message接口进行解密。  | 
     
请求示例
GET /v2/29dfe82ada564ac2b927e1ff036d9a9b/policy-groups/401a23865cae63f3015cceb9affe0049/targets?target_type=INSTANCE&limit=1&offset=1
响应示例
状态码:200
查询策略应用对象的响应。
{
  "targets" : [ {
    "target_id" : "S-1-5-21-1065092785-1316984780-3147557180-9999",
    "target_type" : "USER",
    "target_name" : "All-Targets-123"
  }, {
    "target_id" : "192.168.1.1",
    "target_type" : "CLIENTIP",
    "target_name" : "192.168.1.1"
  } ]
}
 状态码
| 
        状态码  | 
      
        描述  | 
     
|---|---|
| 
        200  | 
      
        查询策略应用对象的响应。  | 
     
| 
        400  | 
      
        由于包含语法错误,当前请求无法被服务器理解。  | 
     
| 
        401  | 
      
        鉴权失败。  | 
     
| 
        403  | 
      
        没有操作权限。  | 
     
| 
        404  | 
      
        找不到资源。  | 
     
| 
        405  | 
      
        请求中指定的方法不被允许。  | 
     
| 
        500  | 
      
        服务内部错误,具体返回错误码请参见错误码说明。  | 
     
| 
        503  | 
      
        服务不可用。  | 
     
错误码
请参见错误码。