更新时间:2024-01-09 GMT+08:00
分享

查询事务

功能介绍

查询事务

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

GET /v1/{project_id}/templates/{template_id}

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID,获取方式请参见获取项目ID

最小长度:0

最大长度:64

template_id

Integer

事务id

最小值:0

最大值:2147483647

请求参数

响应参数

状态码: 200

表2 响应Body参数

参数

参数类型

描述

code

String

响应码

最小长度:0

最大长度:1024

message

String

响应消息

最小长度:0

最大长度:1024

temp_info

TempInfo object

事务详情

表3 TempInfo

参数

参数类型

描述

id

Integer

事务id

最小值:0

最大值:2147483647

project_id

Integer

工程id

最小值:0

最大值:2147483647

name

String

事务名称

最小长度:0

最大长度:1024

description

String

事务描述

最小长度:0

最大长度:1024

variables

String

变量

最小长度:0

最大长度:1024

contents

Array of objects

事务脚本信息

数组长度:0 - 1024

temp_type

Integer

事务类型(弃用)

最小值:0

最大值:2147483647

for_loop_params

Array of objects

旧版本逻辑控制器字段,当前已未使用

数组长度:0 - 1024

logic_controller

LogicController object

逻辑控制器信息

enable_pre

Boolean

是否启用预置事务,当前版本已未使用

表4 LogicController

参数

参数类型

描述

for_loop_params

String

旧版本逻辑控制器字段,当前已未使用

最小长度:0

最大长度:1024

condition

String

逻辑控制器条件

最小长度:0

最大长度:1024

请求示例

查询事务的详情信息,事务的id是1。

https://cpts.{region}.domain-example.com/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

错误码

请参见错误码

分享:

    相关文档

    相关产品