更新时间:2024-04-29 GMT+08:00
分享

查询合约详情

功能介绍

查询合约详情。

URI

GET /v1/{project_id}/eds/instances/{instance_id}/connectors/{connector_id}/contracts/{contract_id}

表1 路径参数

参数

是否必选

参数类型

描述

instance_id

String

实例ID,开通的数据交换平台实例ID。

获取方法请参考获取实例ID

connector_id

String

连接器ID,指定数据交换平台下连接器的ID。

获取方法请参考获取连接器ID

contract_id

String

合约ID。

参数校验规则:最小长度1,最大长度50,匹配字母数字和符号-。

project_id

String

项目ID。

获取方法请参考获取项目ID

请求参数

表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

错误描述。

表4 ContractDetail

参数

参数类型

描述

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:失败
  • TERMINATED:已终止
  • REJECTED:审批驳回

枚举值:

  • APPROVING
  • RUNNING
  • SUCCESS
  • FAILED
  • TERMINATED
  • REJECTED

create_time

String

创建时间。

need_approval

Boolean

是否需要审批。

注:开启【需要审批】后,下载合约资源的加工产物时需要审批。

can_terminate

Boolean

是否允许提供方删除数据。

use_control_policies

Array of UseControlPoliciesInner objects

合约使用控制策略列表。

artifacts

Array of Artifact objects

合约资产列表。

表5 UseControlPoliciesInner

参数

参数类型

描述

action

String

执行动作过滤:

  • VIEW:查看
  • MODIFY:加工
  • DOWNLOAD:下载

枚举值:

  • VIEW
  • MODIFY
  • DOWNLOAD

when

TimeInterval object

限制使用时间。

how_many

Integer

限制使用次数。

where

Array of strings

限制地点列表。

who

Array of strings

限制用户列表。

application

Array of strings

限制应用列表。

additional_attributes

DatabaseAttributes

object

策略的扩展属性。

user_type

String

限制用户类型。

  • USER :指定用户
  • TEAM :指定团队

枚举值:

USER

TEAM

表6 Artifact

参数

参数类型

描述

data_resource_id

String

所属资源ID。

artifact_id

String

资产ID。

artifact_code

String

资产编码。

artifact_title

String

文件名称。

byte_size

Long

文件大小。

media_type

String

资产格式类型。

表7 TimeInterval

参数

参数类型

描述

start_time

String

起始时间。

end_time

String

截止时间。

表8 DatabaseAttributes

参数

参数类型

描述

column

String

可见行。

rows

Arrays of RowDTO

可见列。

表9 RowDTO

参数

参数类型

描述

column_name

String

参数名称。

condition

String

参数条件。

value

String

参数条件值。

状态码: 400

表10 响应Body参数

参数

参数类型

描述

data

-

返回null

total

Long

总数。

error_code

String

错误码。

error_msg

String

错误描述。

状态码: 500

表11 响应Body参数

参数

参数类型

描述

data

-

返回null

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" : [ ],
          "who" : [ "************" ],
          "user_type": null,
          "application" : [ "321ac118-758e-4324-9d41-************" ],
          "additional_attributes" : {
            "column" : "id,category",
            "rows" : [ {
              "column_name" : null,
              "condition" : "!=",
              "value" : "1"
            } ]
          }
        }, {
          "action" : "MODIFY",
          "when" : {
            "start_time" : "2023-12-05T20:24:37Z",
            "end_time" : "2023-12-25T20:24:37Z"
          },
          "how_many" : null,
          "where" : [ ],
          "who" : [ "************" ],
          "user_type": null,
          "application" : [ "321ac118-758e-4324-9d41-************" ],
          "additional_attributes" : {
            "column" : "id,category",
            "rows" : [ {
              "column_name" : null,
              "condition" : "!=",
              "value" : "1"
            } ]
          }
        }, {
          "action" : "DOWNLOAD",
          "when" : {
            "start_time" : "2023-12-05T20:24:37Z",
            "end_time" : "2023-12-25T20:24:37Z"
          },
          "how_many" : null,
          "where" : [ ],
          "who" : [ "************" ],
          "user_type": null,
          "application" : [ "321ac118-758e-4324-9d41-************" ],
          "additional_attributes" : {
            "column" : "id,category",
            "rows" : [ {
              "column_name" : null,
              "condition" : "!=",
              "value" : "1"
            } ]
          }
        } ],
        "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

错误码

请参见错误码

分享:

    相关文档

    相关产品