提交合约
功能介绍
提交合约。
URI
POST /v1/{project_id}/eds/instances/{instance_id}/connectors/{connector_id}/contracts
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
是 |
String |
用户Token,通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
contract_name |
是 |
String |
合约名称。 |
contract_description |
否 |
String |
合约描述。 |
owner_connector_id |
是 |
String |
提供者连接器ID。 |
subscribe_connector_id |
是 |
String |
订阅连接器ID。 |
subscriber_id |
是 |
String |
订阅人ID。 |
approver_id |
是 |
String |
审批人ID。 |
offer_id |
是 |
String |
Offer ID。 |
need_approval |
是 |
Boolean |
是否需要审批。 注:开启【需要审批】后,下载合约资源的加工产物时需要审批。 |
can_terminate |
是 |
Boolean |
是否允许提供方删除数据。 |
use_control_policies |
是 |
Array of UseControlPoliciesInner objects |
合约使用控制策略列表。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
action |
是 |
String |
执行动作过滤:
枚举值:
|
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 |
限制用户类型。
枚举值:
|
参数 |
参数类型 |
描述 |
---|---|---|
start_time |
String |
起始时间。 |
end_time |
String |
截止时间。 |
参数 |
参数类型 |
描述 |
---|---|---|
column |
String |
可见行。 |
rows |
Arrays of RowDTO |
可见列。 |
参数 |
参数类型 |
描述 |
---|---|---|
column_name |
String |
参数名称。 |
condition |
String |
参数条件。 |
value |
String |
参数条件值。 |
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
data |
ContractResult object |
返回数据。 |
total |
Long |
总数。 |
error_code |
String |
错误码。 |
error_msg |
String |
错误描述。 |
参数 |
参数类型 |
描述 |
---|---|---|
contract_id |
String |
合约ID。 |
contract_name |
String |
合约名称。 |
result_code |
String |
操作结果返回码:
枚举值:
|
result_description |
String |
操作结果描述。 |
状态码: 400
参数 |
参数类型 |
描述 |
---|---|---|
data |
- |
返回null。 |
total |
Long |
总数。 |
error_code |
String |
错误码。 |
error_msg |
String |
错误描述。 |
状态码: 500
参数 |
参数类型 |
描述 |
---|---|---|
data |
- |
返回null。 |
total |
Long |
总数。 |
error_code |
String |
错误码。 |
error_msg |
String |
错误描述。 |
请求示例
提交合约。
POST https://{endpoint}/v1/{project_id}/eds/instances/{instance_id}/connectors/{connector_id}/contracts { "contract_name" : "测试合约3", "approver_id" : "************", "offer_id" : "fbf85846-3782-46dc-affb-************", "owner_connector_id" : "b40b0d94-3201-4687-93aa-************", "subscribe_connector_id" : "c1bf9bd7-52fc-435b-ae55-************", "subscriber_id" : "************", "need_approval" : false, "can_terminate" : true, "use_control_policies" : [ { "action" : "VIEW", "when" : { "start_time" : "2023-11-16T18:18:14Z", "end_time" : "2023-12-16T18:18:14Z" }, "how_many" : null, "where" : [ ], "who" : [ "************" ], "user_type" : null, "application" : [ "321ac118-758e-4324-9d41-************" ], "additional_attributes" : { "column" : "id,category", "rows" : [ { "column_name" : "id", "condition" : "!=", "value" : "1" } ] } }, { "action" : "DOWNLOAD", "when" : { "start_time" : "2023-11-16T18:18:14Z", "end_time" : "2023-12-16T18:18:14Z" }, "how_many" : null, "where" : [ ], "who" : [ "************" ], "user_type" : null, "application" : [ "dae4237f-9880-4fb9-a618-************" ], "additional_attributes" : { "column": null, "rows": null } }, { "action" : "MODIFY", "when" : { "start_time" : "2023-11-16T18:18:14Z", "end_time" : "2023-12-16T18:18:14Z" }, "how_many" : null, "where" : [ ], "who" : [ "************" ], "user_type" : null, "application" : [ "dae4237f-9880-4fb9-a618-************" ], "additional_attributes" : { "column": null, "rows": null } } ], "contract_description" : "OpenApi demo." }
响应示例
状态码: 200
OK
- 提交合约返回结构体。
{ "data" : { "contract_id" : "AGRTconnector-****3b53a05caccd4c53b509************", "contract_name" : "测试合约3", "result_code" : "SUCCESS", "result_description" : "success" }, "total" : 0, "error_code" : null, "error_msg" : null }
状态码
状态码 |
描述 |
---|---|
200 |
OK |
400 |
Bad Request |
500 |
Internal Server Error |
错误码
请参见错误码。