Modifying a Case
Function
This API is used to modify a case.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
codeartsperftest:cpts:updatePerfTestProject
Write
cpts *
g:ResourceTag/<tag-key>
-
-
URI
PUT /v2/{project_id}/test-cases/{case_id}
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
case_id |
Yes |
Integer |
Case ID, which is the value of json.test_case_id in the response body of the API for creating a case. |
|
project_id |
Yes |
String |
Project ID. For details, see Method of obtaining instructions. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Case name. |
|
case_type |
No |
Integer |
Case type (0: normal case). |
|
contents |
Yes |
Array of Contents objects |
Case script information. |
|
for_loop_params |
No |
Array of objects |
Logic controller field of the old edition. This parameter is currently deprecated. |
|
increase_setting |
No |
Array of objects |
Gradient increment. |
|
stages |
Yes |
Array of TestCaseStage objects |
Phase information. |
|
status |
No |
Integer |
Status (0: deleted; 1: enabled; 2: disabled). |
|
temp_id |
No |
Integer |
Case ID, which is the value of json.test_case_id in the response body of the API for creating a case. |
|
sort |
No |
Integer |
Sorting field. |
|
directory_id |
Yes |
Integer |
Directory ID of the case. This parameter is optional for APIs of earlier versions. |
|
setup_contents |
No |
Array of Contents objects |
Preparations. |
|
user_replicas |
No |
Integer |
Actuators. |
|
collect_log_policy |
No |
Integer |
Log collection policy (0: request mode; 1: case mode). |
|
link_app_list |
No |
Array of integers |
Associated full-link application list. |
|
case_info |
No |
CaseDoc object |
Text case information. |
|
case_id |
No |
Integer |
Case ID, which is the value of json.test_case_id in the response body of the API for creating a case. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
operate_mode |
No |
Integer |
Pressure phase mode (0: by duration; 1: by count). |
|
name |
Yes |
String |
Phase name. |
|
time |
Yes |
Integer |
Duration, in seconds. |
|
start_time |
No |
Integer |
Start time. |
|
end_time |
No |
Integer |
End time. |
|
issue_num |
Yes |
Integer |
Maximum concurrency. |
|
count |
No |
Integer |
Total transmission times. |
|
pressure_mode |
No |
Integer |
Pressure mode (0: concurrency; 1: TPS; 2: peakload; 3: surge; 5: oscillation; 7: intelligent peakload). |
|
tps_value |
No |
Integer |
TPS value in TPS mode. |
|
current_user_num |
Yes |
Integer |
Start concurrency. |
|
current_tps |
No |
Integer |
Start TPS value. |
|
voltage_regulating_mode |
No |
Integer |
Load adjustment mode (0: auto; 1: manual). |
|
maximum |
No |
Integer |
Maximum concurrency in the surge mode. |
|
minimum |
No |
Integer |
Minimum concurrency in the surge mode. |
|
loop_count |
No |
Integer |
Oscillation/surge times. |
|
max_duration |
No |
Integer |
Peak duration in the surge mode. |
|
ramp_up |
No |
Integer |
Ramp up (in seconds) in the peakload mode. |
|
peak_load_kpis |
No |
StageKpiItems object |
Expected KPI. |
|
step_duration |
No |
Integer |
Single-step execution duration in the intelligent peakload mode. |
|
step_size |
No |
Integer |
Increase concurrency in the intelligent peakload mode. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
average_response_time |
No |
StageKpiItem object |
Average response time. |
|
success_rate |
No |
StageKpiItem object |
Success rate. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
comparison |
No |
String |
Comparison operator. |
|
value |
No |
Integer |
Comparison value. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
content_id |
No |
Integer |
Transaction ID. This maps to the tempId value returned in the response body of the transaction creation API. A non-zero value indicates that the card is a transaction, whereas a value of 0 indicates it is not. |
|
content |
No |
Array of Content objects |
Content. |
|
index |
No |
Integer |
Sorting index. |
|
selected_temp_name |
No |
String |
Name of the selected transaction or case. |
|
data |
No |
Object |
Data to which the loop and condition controller apply. |
|
data_type |
No |
Integer |
Type (0: default request; 1: data instruction; 201: cycle instruction; 202: condition instruction; 301: rendezvous point). |
|
conditions |
No |
Object |
If the type is 202 (condition instruction), this field configures the condition. |
|
is_disabled |
Yes |
Boolean |
Whether to disable the AW. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
content_type |
Yes |
Integer |
Case card type (1: think time; 2: packet; 3: checkpoint; 4: variable extraction). |
|
content |
Yes |
ContentInfo object |
Content. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
body_type |
Yes |
Integer |
Body type (0: string; 1: form-data format; 3: x-www-form-urlencoded format). |
|
bodys |
No |
Array of objects |
Request body. |
|
check_end_length |
No |
Object |
Length of the data returned through TCP/UDP. |
|
check_end_str |
No |
Object |
End character returned through TCP/UDP. |
|
check_end_type |
No |
Object |
End type (1: data length; 2: end character) returned through TCP/UDP. |
|
connect_timeout |
No |
Integer |
Timeout duration. |
|
connect_type |
No |
Integer |
Connection settings. This parameter is deprecated in the current edition. |
|
headers |
No |
Array of ContentHeader objects |
Request header. |
|
http_version |
Yes |
String |
HTTP version. |
|
method |
Yes |
String |
HTTP method. |
|
name |
Yes |
String |
Case name. |
|
protocol_type |
No |
Integer |
Protocol type (1: HTTP; 2: HTTPS; 3: TCP; 4: UDP; 7: HLS/RTMP; 9: WebSocket; 10: HTTP-FLV; 11: MQTT). |
|
return_timeout |
Yes |
Integer |
Response timeout. |
|
return_timeout_param |
No |
String |
Response timeout parameter. |
|
url |
Yes |
String |
Request URL. |
|
rtmp_url |
No |
String |
RTMP address. |
|
flv_url |
No |
String |
FLV address. |
|
bitrate_type |
No |
Integer |
Resolution policy. |
|
duration |
No |
Integer |
Duration. |
|
retry_delay |
No |
Integer |
HLS retry delay. |
|
retry_time |
No |
Integer |
HLS retries. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
Yes |
String |
Key. |
|
value |
Yes |
String |
Value. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
description |
No |
String |
Case description. |
|
label_names |
No |
Array of strings |
Tags. |
|
preparation |
No |
String |
Preparations. |
|
rank |
No |
Integer |
Case level (0: L0; 1: L1; 2: L2; 3: L3; 4: L4). |
|
status_code |
No |
Integer |
Status (0: new; 5: designing; 6: testing; 7: completed). |
|
steps |
No |
Array of steps objects |
Procedure. |
Response Parameters
Status code: 204
Response status code for successful case modification.
None
Example Requests
Modifying a case, changing its name to new_case, and modifying the request information and phase information of the case.
/v2/{project_id}/test-cases/1
{
"name" : "new_case",
"case_type" : 0,
"setup_contents" : [ ],
"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" : "request_example",
"protocol_type" : 1,
"return_timeout" : 5000,
"return_timeout_param" : null,
"url" : "http://117.xxx.xxx.xxx",
"duration" : 120,
"retry_delay" : 6000,
"retry_time" : 2
},
"content_type" : 2
} ],
"content_id" : 0,
"data" : null,
"data_type" : 0,
"index" : 0,
"conditions" : [ ],
"is_disabled" : false
} ],
"for_loop_params" : [ ],
"increase_setting" : [ ],
"stages" : [ {
"count" : 1,
"current_user_num" : 1,
"issue_num" : 1,
"name" : "Stage-2hih",
"operate_mode" : 0,
"pressure_mode" : 0,
"time" : 60,
"tps_value" : 1,
"voltage_regulating_mode" : 0,
"maximum" : 3,
"minimum" : 1,
"loop_count" : 2,
"max_duration" : 15,
"step_size" : 1,
"step_duration" : 30,
"ramp_up" : 30,
"peak_load_kpis" : {
"average_response_time" : {
"comparison" : "<=",
"value" : 60000
},
"success_rate" : {
"comparison" : ">=",
"value" : 0
}
}
} ],
"user_replicas" : 0,
"collect_log_policy" : 0,
"link_app_list" : [ ],
"case_id" : 1,
"sort" : 1,
"status" : 1,
"directory_id" : 174582,
"case_info" : {
"description" : "",
"label_names" : [ ],
"preparation" : "",
"rank" : 1,
"status_code" : 0,
"steps" : [ {
"expect_result" : "",
"test_step" : ""
} ]
},
"temp_id" : 0
}
Example Responses
None
Status Codes
|
Status Code |
Description |
|---|---|
|
204 |
Response status code for successful case modification. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot