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

修改事务

功能介绍

修改事务

调试

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

URI

PUT /v1/{project_id}/templates/{template_id}

表1 路径参数

参数

是否必选

参数类型

描述

template_id

Integer

事务id

最小值:0

最大值:2147483647

project_id

String

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

最小长度:0

最大长度:64

请求参数

表2 请求Body参数

参数

是否必选

参数类型

描述

id

Integer

事务id

最小值:0

最大值:2147483647

project_id

Integer

工程id

最小值:0

最大值:2147483647

name

String

事务名称

最小长度:1

最大长度:42

temp_type

Integer

事务类型

最小值:0

最大值:2147483647

description

String

描述信息

最小长度:0

最大长度:1024

for_loop_params

Array of objects

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

数组长度:0 - 1024

enable_pre

Boolean

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

contents

Array of TempContentInfo objects

事务脚本信息

数组长度:0 - 1024

表3 TempContentInfo

参数

是否必选

参数类型

描述

content_id

Integer

报文id或者事务id或者插件id

最小值:0

最大值:2147483647

content

Array of Content objects

内容

数组长度:0 - 1000

index

Integer

索引

最小值:0

最大值:2147483647

data

Object

数据指令内容

data_type

Integer

数据指令类型(0:默认请求卡片;1:数据指令;201:循环指令;202:条件指令;203:vu百分比控制器;204:吞吐量控制器;301:集合点;302:插件请求)

最小值:0

最大值:2147483647

表4 Content

参数

是否必选

参数类型

描述

content_type

Integer

用例卡片类型(1:思考时间;2:报文;3:检查点;4:变量提取)

最小值:0

最大值:2147483647

content

ContentInfo object

内容

表5 ContentInfo

参数

是否必选

参数类型

描述

body_type

Integer

body类型(0:字符串;1:form-data格式;3:x-www-form-urlencoded格式)

最小值:0

最大值:2147483647

bodys

Array of objects

bodys

check_end_length

Object

TCP/UDP协议返回数据长度

check_end_str

Object

TCP/UDP协议返回结束符

check_end_type

Object

TCP/UDP协议返回结束类型,1:返回数据长度;2:结束符

connect_timeout

Integer

超时时间

最小值:0

最大值:2147483647

connect_type

Integer

连接设置,当前版本已未使用

最小值:0

最大值:2147483647

headers

Array of ContentHeader objects

请求头

数组长度:0 - 1024

http_version

String

HTTP版本

最小长度:0

最大长度:1024

method

String

HTTP方法

最小长度:0

最大长度:1024

name

String

用例名称

最小长度:0

最大长度:1024

protocol_type

Integer

协议类型(1:HTTP;2:HTTPS;3:TCP;4:UDP;7:HLS/RTMP;9:WebSocket;10:HTTP-FLV)

最小值:0

最大值:2147483647

return_timeout

Integer

响应超时

最小值:0

最大值:2147483647

return_timeout_param

String

响应超时参数

最小长度:0

最大长度:40960

url

String

请求地址

最小长度:0

最大长度:40960

rtmp_url

String

rtmp地址

最小长度:0

最大长度:40960

flv_url

String

flv地址

最小长度:0

最大长度:40960

bitrate_type

Integer

分辨率策略

最小值:0

最大值:128

duration

Integer

持续时间

最小值:0

最大值:2147483647

retry_delay

Integer

HLS重试延迟时间

最小值:0

最大值:2147483647

retry_time

Integer

HLS重试次数

最小值:0

最大值:2147483647

表6 ContentHeader

参数

是否必选

参数类型

描述

key

String

最小长度:0

最大长度:40960

value

String

最小长度:0

最大长度:40960

响应参数

请求示例

修改一个事务,事务的id是1,事务所属的工程id是1,包括修改事务的请求信息。

https://cpts.{region}.domain-example.com/v1/{project_id}/templates/1

{
  "contents" : [ {
    "content" : [ {
      "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-31445",
        "protocol_type" : 2,
        "return_timeout" : 5000,
        "return_timeout_param" : null,
        "url" : "https://www.domain-example.com"
      },
      "content_type" : 2
    } ],
    "content_id" : 2346,
    "index" : 0
  } ],
  "description" : "",
  "enable_pre" : false,
  "for_loop_params" : [ ],
  "id" : 1,
  "name" : "transaction_test",
  "project_id" : 1,
  "temp_type" : 0
}

响应示例

状态码

状态码

描述

204

success

501

unknown error

错误码

请参见错误码

分享:

    相关文档

    相关产品