查询事务
功能介绍
查询事务
URI
GET /v1/{project_id}/templates/{template_id}
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
project_id |
是 |
String |
表示项目ID,参见获取方法说明。 |
|
template_id |
是 |
Integer |
事务ID,通过“创建事务”接口获取响应体中的tempId字段的值。 |
请求参数
无
响应参数
状态码:200
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
code |
String |
响应码 |
|
message |
String |
响应消息 |
|
temp_info |
TempInfo object |
事务详情 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
id |
Integer |
事务ID,通过“创建事务”接口获取响应体中的tempId字段的值。 |
|
project_id |
Integer |
工程ID |
|
name |
String |
事务名称 |
|
description |
String |
事务描述 |
|
variables |
String |
变量 |
|
contents |
Array of objects |
事务脚本信息 |
|
temp_type |
Integer |
事务类型(弃用) |
|
for_loop_params |
Array of objects |
旧版本逻辑控制器字段,当前已未使用 |
|
logic_controller |
LogicController object |
逻辑控制器信息 |
|
enable_pre |
Boolean |
是否启用预置事务,当前版本已未使用 |
状态码:501
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
- |
String |
response message |
请求示例
查询事务的详情信息,事务的id是1。
/v1/{project_id}/templates/1
{
"code" : "SVCSTG.CPTS.0000000",
"message" : "success",
"temp_info" : {
"id" : 155175,
"project_id" : 403931,
"name" : "test",
"description" : "",
"variables" : null,
"contents" : [ {
"content_id" : 155175,
"content" : [ {
"content_type" : 2,
"content" : {
"_adressValue" : "http://1.1.1.1",
"body_type" : 0,
"bodys" : [ ],
"check_end_length" : null,
"check_end_str" : null,
"check_end_type" : null,
"connect_timeout" : 5000,
"connect_type" : 1,
"headers" : [ {
"key" : "Content-Type",
"value" : "application/json"
} ],
"http_version" : "HTTP/1.1",
"method" : "GET",
"name" : "Msg-8015",
"protocol_type" : 1,
"return_timeout" : 5000,
"return_timeout_param" : null,
"url" : "http://1.1.1.1"
}
} ],
"index" : -1,
"selected_temp_name" : "",
"data" : null,
"data_type" : 0,
"conditions" : null,
"is_disabled" : false,
"is_continue" : false
} ],
"temp_type" : 0,
"for_loop_params" : [ ],
"logic_controller" : {
"for_loop_params" : null,
"condition" : null
},
"enable_pre" : false
}
}
响应示例
状态码:200
success
{
"code" : "SVCSTG.CPTS.0000000",
"message" : "success",
"temp_info" : {
"id" : 21531,
"project_id" : 17543,
"name" : "transaction",
"description" : "",
"variables" : null,
"contents" : [ {
"content_id" : 21531,
"content" : [ {
"content_type" : 2,
"content" : {
"body_type" : 0,
"bodys" : [ ],
"check_end_length" : null,
"check_end_str" : null,
"check_end_type" : null,
"connect_timeout" : 5000,
"connect_type" : 1,
"headers" : [ {
"key" : "Content-Type",
"value" : "application/json"
} ],
"http_version" : "HTTP/1.1",
"method" : "GET",
"name" : "Msg-73387",
"protocol_type" : 2,
"return_timeout" : 5000,
"return_timeout_param" : null,
"url" : "https://www.domain-example.com"
}
} ],
"index" : -1,
"selected_temp_name" : "",
"data" : null,
"data_type" : 0,
"conditions" : null,
"is_disabled" : false,
"is_continue" : false
} ],
"temp_type" : 0,
"for_loop_params" : [ ],
"logic_controller" : {
"for_loop_params" : null,
"condition" : null
},
"enable_pre" : false
}
}
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
success |
|
501 |
unknown error |
错误码
请参见错误码。