
# 查询合约详情 - ShowContract
#### 功能介绍
查询合约详情。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-eds/eds_06_0017.html)。
#### URI
GET /v1/{project_id}/eds/instances/{instance_id}/connectors/{connector_id}/contracts/{contract_id}
表1路径参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                |
|:---|:---|:---|:---|
| project_id   | 是    | String | 项目ID。 获取方法请参考[获取项目ID](https://support.huaweicloud.com/api-eds/eds_06_0023.html)。                  |
| instance_id  | 是    | String | 实例ID，开通的交换数据平台实例ID。 获取方法请参考[获取实例ID](https://support.huaweicloud.com/api-eds/eds_06_0025.html)。     |
| connector_id | 是    | String | 连接器ID，指定交换数据平台下连接器的ID。 获取方法请参考[获取连接器ID](https://support.huaweicloud.com/api-eds/eds_06_0026.html)。 |
| contract_id  | 是    | String | 合约ID。 参数校验规则：最小长度1，最大长度50，匹配字母、数字和符号-。                                                            |
   
#### 请求参数
表2请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                         |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token，通过调用IAM服务"获取用户Token"接口获取（响应消息头中X-Subject-Token的值）。 |
   
#### 响应参数
**状态码： 200**
表3响应Body参数 
| 参数         | 参数类型                                                            | 描述    |
|:---|:---|:---|
| data       | [ContractDetail] object | 返回数据。 |
| total      | Long                                                            | 总数。   |
| error_code | String                                                          | 错误码。  |
| error_msg  | String                                                          | 错误描述。 |
   
 表4ContractDetail 
| 参数                       | 参数类型                                                                                        | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|:---|:---|:---|
| contract_id              | String                                                                                      | 合约ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| contract_name            | String                                                                                      | 合约名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| contract_description     | String                                                                                      | 合约描述。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| owner_connector_id       | String                                                                                      | 提供者连接器ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| owner_connector_name     | String                                                                                      | 提供者连接器名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| subscribe_connector_id   | String                                                                                      | 订阅连接器ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| subscribe_connector_name | String                                                                                      | 订阅连接器名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| subscriber_name          | String                                                                                      | 订阅人名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| subscriber_id            | String                                                                                      | 订阅人ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| approver_id              | String                                                                                      | 审批人ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| approver_name            | String                                                                                      | 审批人名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| offer_id                 | String                                                                                      | Offer ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| offer_name               | String                                                                                      | offer名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| transactional_mode       | String                                                                                      | 交换模式： - PEER_TO_PEER： 点对点   - SUBSCRIBE：订阅    枚举值： - **PEER_TO_PEER**   - **SUBSCRIBE**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| status                   | String                                                                                      | 合约状态： - APPROVING： 审批中   - RUNNING：数据传输中   - SUCCESS：成功   - FAILED：失败   - CLOSED：到期关闭   - TERMINATED：已终止   - REJECTED：审批驳回    枚举值： - **APPROVING**   - **RUNNING**   - **SUCCESS**   - **FAILED**   - **CLOSED**   - **TERMINATED**   - **REJECTED**    |
| create_time              | String                                                                                      | 创建时间。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| need_approval            | Boolean                                                                                     | 是否需要审批。 注：开启【需要审批】后，下载合约资源的加工产物时需要审批。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| can_terminate            | Boolean                                                                                     | 是否允许提供方删除数据。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| use_control_policies     | Array of [UseControlPoliciesInner] objects | 合约使用控制策略列表。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| artifacts                | Array of [Artifact] objects                               | 合约资产列表。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
   
 表5UseControlPoliciesInner 
| 参数                    | 参数类型                                                                    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
|:---|:---|:---|
| action                | String                                                                  | 执行动作过滤： - VIEW：查看   - MODIFY：加工   - DOWNLOAD：下载    枚举值： - **VIEW**   - **MODIFY**   - **DOWNLOAD**    |
| when                  | [TimeInterval] object             | 限制使用时间。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| how_many              | Integer                                                                 | 限制使用次数。 参数校验规则：最小值1，最大值10000。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| where                 | [Where] object                           | 限制地点列表。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| who                   | Array of strings                                                        | 限制用户/团队列表。（目前不支持多个用户或者团队）                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| user_type             | String                                                                  | 限制用户类型。（团队订阅时who和user_type必填） - USER ：指定用户   - TEAM ：指定团队    枚举值： - **USER**   - **TEAM**                                                                                                                                                                                                                                                 |
| application           | Array of strings                                                        | 限制应用列表。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| additional_attributes | [DatabaseAttributes] object | 策略的扩展属性。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
   
 表6TimeInterval 
| 参数         | 参数类型   | 描述            |
|:---|:---|:---|
| start_time | String | 起始时间，UTC时间格式。 |
| end_time   | String | 截止时间，UTC时间格式。 |
   
 表7Where 
| 参数         | 参数类型             | 描述         |
|:---|:---|:---|
| device_ip  | Array of strings | 限定访问IP。    |
| device_mac | Array of strings | 限定访问设备MAC。 |
   
 表8DatabaseAttributes 
| 参数     | 参数类型                                                      | 描述   |
|:---|:---|:---|
| column | String                                                    | 可见列。 |
| rows   | Array of [RowDTO] objects | 可见行。 |
   
 表9RowDTO 
| 参数          | 参数类型   | 描述                                  |
|:---|:---|:---|
| column_name | String | 参数名称，需要与condition、value配合生效。        |
| condition   | String | 参数条件，需要与column_name、value配合生效。      |
| value       | String | 参数条件值，需要与column_name、condition配合生效。 |
   
 表10Artifact 
| 参数               | 参数类型   | 描述      |
|:---|:---|:---|
| data_resource_id | String | 所属资源ID。 |
| artifact_id      | String | 资产ID。   |
| artifact_code    | String | 资产编码。   |
| artifact_title   | String | 文件名称。   |
| byte_size        | Long   | 文件大小。   |
| media_type       | String | 资产格式类型。 |
   
**状态码： 400**
表11响应Body参数 
| 参数         | 参数类型   | 描述    |
|:---|:---|:---|
| data       | Object | 返回数据。 |
| total      | Long   | 总数。   |
| error_code | String | 错误码。  |
| error_msg  | String | 错误描述。 |
   
**状态码： 500**
表12响应Body参数 
| 参数         | 参数类型   | 描述    |
|:---|:---|:---|
| data       | Object | 返回数据。 |
| total      | Long   | 总数。   |
| error_code | String | 错误码。  |
| error_msg  | String | 错误描述。 |
   
#### 请求示例
查询合约详情。
```
GET https://{endpoint}/v1/{project_id}/eds/instances/{instance_id}/connectors/{connector_id}/contracts/AGRTconnector-****3b53a05caccd4c53b509************
```
#### 响应示例
**状态码： 200**
OK
- 合约详情。
  ```
  {
    "data" : {
      "contract_id" : "AGRTconnector-****3b53a05caccd4c53b509************",
      "contract_name" : "测试合约3",
      "contract_description" : "OpenApi demo.",
      "owner_connector_id" : "b40b0d94-3201-4687-93aa-************",
      "owner_connector_name" : "连接器A",
      "subscribe_connector_id" : "c1bf9bd7-52fc-435b-ae55-************",
      "subscribe_connector_name" : "连接器B",
      "subscriber_name" : "************",
      "subscriber_id" : "************",
      "approver_id" : "************",
      "approver_name" : "************",
      "offer_id" : "fbf85846-3782-46dc-affb-************",
      "offer_name" : "offer-mysql-20231129AA",
      "transactional_mode" : "SUBSCRIBE",
      "status" : "SUCCESS",
      "create_time" : "2023-12-05T20:24:37Z",
      "need_approval" : false,
      "can_terminate" : true,
      "use_control_policies" : [ {
        "action" : "VIEW",
        "when" : {
          "start_time" : "2023-12-05T20:24:37Z",
          "end_time" : "2023-12-25T20:24:37Z"
        },
        "how_many" : null,
        "where" : {
          "device_ip" : [ ],
          "device_mac" : [ ]
        },
        "who" : [ "************" ],
        "user_type" : null,
        "application" : [ "321ac118-758e-4324-9d41-************" ],
        "additional_attributes" : {
          "column" : "",
          "rows" : [ ]
        }
      }, {
        "action" : "MODIFY",
        "when" : {
          "start_time" : "2023-12-05T20:24:37Z",
          "end_time" : "2023-12-25T20:24:37Z"
        },
        "how_many" : null,
        "where" : {
          "device_ip" : [ ],
          "device_mac" : [ ]
        },
        "who" : [ "************" ],
        "user_type" : null,
        "application" : [ "321ac118-758e-4324-9d41-************" ],
        "additional_attributes" : {
          "column" : "",
          "rows" : [ ]
        }
      }, {
        "action" : "DOWNLOAD",
        "when" : {
          "start_time" : "2023-12-05T20:24:37Z",
          "end_time" : "2023-12-25T20:24:37Z"
        },
        "how_many" : null,
        "where" : {
          "device_ip" : [ ],
          "device_mac" : [ ]
        },
        "who" : [ "************" ],
        "user_type" : null,
        "application" : [ "321ac118-758e-4324-9d41-************" ],
        "additional_attributes" : {
          "column" : "",
          "rows" : [ ]
        }
      } ],
      "artifacts" : [ {
        "data_resource_id" : "25546208-0854-49a0-9023-************",
        "artifact_id" : "303b4f5f-596e-41c9-ad50-************",
        "artifact_code" : null,
        "artifact_title" : "animals",
        "byte_size" : 16384,
        "media_type" : "jdbc"
      } ]
    },
    "total" : 0,
    "error_code" : null,
    "error_msg" : null
  }
  ```
  
 
#### 状态码
| 状态码 | 描述                    |
|:---|:---|
| 200 | OK                    |
| 400 | Bad Request           |
| 500 | Internal Server Error |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-eds/ErrorCode.html)。
