修改事务
功能介绍
修改事务
URI
PUT /v1/{project_id}/templates/{template_id}
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
template_id |
是 |
Integer |
事务ID,通过“创建事务”接口获取响应体中的tempId字段的值。 |
|
project_id |
是 |
String |
表示项目ID,参见获取方法说明。 |
请求参数
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
id |
是 |
Integer |
事务ID,通过“创建事务”接口获取响应体中的tempId字段的值。 |
|
project_id |
是 |
Integer |
工程ID |
|
name |
是 |
String |
事务名称 |
|
temp_type |
否 |
Integer |
事务类型 |
|
description |
否 |
String |
描述信息 |
|
for_loop_params |
否 |
Array of objects |
旧版本逻辑控制器字段,当前已未使用 |
|
enable_pre |
否 |
Boolean |
是否启用预置事务,当前版本已未使用 |
|
contents |
否 |
Array of TempContentInfo objects |
事务脚本信息 |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
content_id |
否 |
Integer |
报文id或者事务ID或者插件ID |
|
content |
否 |
Array of Content objects |
内容 |
|
index |
否 |
Integer |
索引 |
|
data |
否 |
Object |
数据指令内容 |
|
data_type |
否 |
Integer |
数据指令类型(0:默认请求卡片;1:数据指令;201:循环指令;202:条件指令;301:集合点;203:vu百分比控制器;204:吞吐量控制器;302:插件请求) |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
content_type |
否 |
Integer |
用例卡片类型(1:思考时间;2:报文;3:检查点;4:变量提取) |
|
content |
否 |
ContentInfo object |
内容 |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
body_type |
否 |
Integer |
body类型(0:字符串;1:form-data格式;3:x-www-form-urlencoded格式) |
|
bodys |
否 |
Array of objects |
请求体 |
|
check_end_length |
否 |
Object |
TCP/UDP协议返回数据长度 |
|
check_end_str |
否 |
Object |
TCP/UDP协议返回结束符 |
|
check_end_type |
否 |
Object |
TCP/UDP协议返回结束类型,1:返回数据长度;2:结束符 |
|
connect_timeout |
否 |
Integer |
超时时间 |
|
connect_type |
否 |
Integer |
连接设置,当前版本已未使用 |
|
headers |
否 |
Array of ContentHeader objects |
请求头 |
|
http_version |
否 |
String |
HTTP版本 |
|
method |
否 |
String |
HTTP方法 |
|
name |
否 |
String |
用例名称 |
|
protocol_type |
否 |
Integer |
协议类型(1:HTTP;2:HTTPS;3:TCP;4:UDP;7:HLS/RTMP;9:WebSocket;10:HTTP-FLV;11:MQTT) |
|
return_timeout |
否 |
Integer |
响应超时 |
|
return_timeout_param |
否 |
String |
响应超时参数 |
|
url |
否 |
String |
请求地址 |
|
rtmp_url |
否 |
String |
rtmp地址 |
|
flv_url |
否 |
String |
flv地址 |
|
bitrate_type |
否 |
Integer |
分辨率策略 |
|
duration |
否 |
Integer |
持续时间 |
|
retry_delay |
否 |
Integer |
HLS重试延迟时间 |
|
retry_time |
否 |
Integer |
HLS重试次数 |
响应参数
状态码:204
success
状态码:501
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
- |
String |
response message |
请求示例
修改一个事务,事务的id是1,事务所属的工程ID是1,包括修改事务的请求信息。
/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 |
错误码
请参见错误码。