
# 查询目标数据源列表 - ListDestinations
#### 功能介绍
查询目标数据源列表。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/ROMA/doc?api=ListDestinations)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-roma/roma_06_0018.html)。
#### URI
GET /v2/{project_id}/link/instances/{instance_id}/rules/{rule_id}/destinations
表1路径参数 
| 参数          | 是否必选 | 参数类型   | 描述                                                                                                           |
|:---|:---|:---|:---|
| project_id  | 是    | String | 项目ID。兼容20.0场景默认为default。项目ID，获取方式请参见API参考的"附录 \> 获取项目ID"章节。                                                  |
| instance_id | 是    | String | 实例ID。兼容20.0场景默认为default。                                                                                     |
| rule_id     | 是    | String | 规则ID，该字段为数据库中的自增唯一标识符；通过调用查询规则接口：GET /v2/{project_id}/link/instances/{instance_id}/rules获取响应体中对应的rule_id字段值。 |
表2Query参数 
| 参数     | 是否必选 | 参数类型    | 描述                             |
|:---|:---|:---|:---|
| limit  | 否    | Integer | 每页显示条目数量，最大数量999，超过999后只返回999。 |
| offset | 否    | Integer | 偏移量，表示从此偏移量开始查询， offset大于等于0。  |
#### 请求参数
表3请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                       |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token。通过调用IAM服务获取用户Token接口获取（响应消息头中X-Subject-Token的值）。 |
   
#### 响应参数
**状态码：200**
表4响应Body参数 
| 参数    | 参数类型                                                                    | 描述       |
|:---|:---|:---|
| total | Integer                                                                 | 总数       |
| size  | Integer                                                                 | 本次返回数量。  |
| items | Array of [Destination] objects | 目标数据源列表。 |
   
 表5Destination 
| 参数               | 参数类型    | 描述                                   |
|:---|:---|:---|
| destination_id   | Integer | 目标数据源ID。                             |
| destination_type | Integer | 操作类型，枚举值：0-目标端为本ROMA实例内MQS；7-目标端为设备。 |
| app_id           | String  | 应用ID，目标端为0时需明确对方的APP_ID。             |
| destination_name | String  | 目标数据源名称。                             |
| topic            | String  | 目标数据源主题。                             |
| server           | String  | 目标端数据源服务。                            |
| token            | String  | 目标端数据源Token。                         |
| tag              | String  | 目标数据源标签。                             |
| mqs_sasl_ssl     | Boolean | 目标端数据源MQS的SASL字段是否需要支持SSL加密。         |
| user_name        | String  | 目标数据源用户名。                            |
| password         | String  | 目标数据源密码。                             |
   
**状态码：400**
表6响应Body参数 
| 参数         | 参数类型   | 描述                             |
|:---|:---|:---|
| error_code | String | 系统错误码，针对4xx和5xx类HTTP错误码的详细错误码。 |
| error_msg  | String | 错误描述。                          |
| request_id | String | 消息ID。                          |
   
**状态码：404**
表7响应Body参数 
| 参数         | 参数类型   | 描述                             |
|:---|:---|:---|
| error_code | String | 系统错误码，针对4xx和5xx类HTTP错误码的详细错误码。 |
| error_msg  | String | 错误描述。                          |
| request_id | String | 消息ID。                          |
   
**状态码：500**
表8响应Body参数 
| 参数         | 参数类型   | 描述                             |
|:---|:---|:---|
| error_code | String | 系统错误码，针对4xx和5xx类HTTP错误码的详细错误码。 |
| error_msg  | String | 错误描述。                          |
| request_id | String | 消息ID。                          |
   
#### 请求示例
```
GET /{project_id}/link/instances/{instance_id}/rules/{rule_id}/destinations
```
#### 响应示例
**状态码：200**
OK
```
{
  "total" : 1,
  "size" : 1,
  "items" : [ {
    "destination_id" : 27678,
    "destination_type" : 7,
    "app_id" : null,
    "destination_name" : null,
    "topic" : "8si8ST122893/in/214",
    "server" : "server",
    "token" : "token",
    "tag" : "device",
    "mqs_sasl_ssl" : "false",
    "user_name" : null,
    "password" : null
  } ]
}
```
**状态码：400**
Bad Request
```
{
  "error_code" : "SCB.00000000",
  "error_msg" : "Parameter is not valid for operation [romalink.link-ruledest.query]. Parameter is [rule_oid]. Processor is [path].",
  "request_id" : "cb39e78a-afd3-4e04-901d-70468b1c23dc-1619602712496-cnnorth7a-P-romalink-service01"
}
```
**状态码：404**
Not Found
```
{
  "error_code" : "ROMA.00110006",
  "error_msg" : "The resource does not exist. Check whether the resource ID 1 is correct.",
  "request_id" : "13984193-ca65-4954-9b7f-4b7d680399d6-1619678681445-cnnorth7a-P-romalink-service01"
}
```
**状态码：500**
Internal Server Error
```
{
  "error_code" : "ROMA.00110002",
  "error_msg" : "The instance does not exist. project_id: 397cd10b30544c588b2f4a56d83856c4, instance_id: f3bb386a-23ec-47aa-9943-4c60ac658611",
  "request_id" : "c8c06d0a-be92-4fdf-9d10-bc20131ab158-1619593104919-cnnorth7a-P-romalink-service01"
}
```
#### 状态码
| 状态码 | 描述                    |
|:---|:---|
| 200 | OK                    |
| 400 | Bad Request           |
| 404 | Not Found             |
| 500 | Internal Server Error |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-roma/ErrorCode.html)。
