Saves a new scenario or updates an existing one.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
pts:SavePtsScene |
update |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Scene |
object |
Yes |
The details of the scenario. |
|
| AdvanceSetting |
object |
No |
The advanced settings. |
|
| ConnectionTimeoutInSecond |
integer |
No |
The timeout period. Unit: seconds. |
5 |
| DomainBindingList |
array |
No |
The mappings between domain names and IP addresses. |
|
|
object |
No |
|||
| Domain |
string |
No |
The domain name. |
www.example.com |
| Ips |
array |
No |
The IP addresses. |
|
|
string |
No |
["192.168.1.1","192.168.1.2"] |
||
| LogRate |
integer |
No |
The log sampling rate. Valid values: 1 to 50. If the value is greater than 2, it must be a multiple of 10. Valid values: 1, 10, 20, 30, 40, and 50. |
1 |
| SuccessCode |
string |
No |
The custom success status codes. Separate multiple status codes with commas (,). |
205 |
| FileParameterList |
array |
No |
The file parameters. |
|
|
object |
No |
|||
| FileName |
string |
No |
The file name. |
test.csv |
| FileOssAddress |
string |
No |
The URL of your Object Storage Service (OSS) file. The file must be accessible over the Internet. |
https://jmeter-pts-testing-version.oss-cn-shanghai.aliyuncs.com/param-file.csv |
| GlobalParameterList |
array |
No |
The global custom parameters. |
|
|
object |
No |
|||
| ParamName |
string |
No |
The parameter name. |
global |
| ParamValue |
string |
No |
The value of the global parameter. This value cannot be parameterized. |
11111 |
| LoadConfig |
object |
Yes |
The stress testing configuration. |
|
| AgentCount |
integer |
No |
The number of agents. This parameter is used when the number of concurrent users is greater than 250 or the number of records per second (RPS) is greater than 2,000. The maximum number of extended agents cannot exceed `Maximum number of concurrent users/250` or `Maximum RPS/2000`. |
1 |
| ApiLoadConfigList |
array |
No |
The initial and maximum RPS for the API. This parameter is used in RPS mode. |
|
|
object |
No |
|||
| ApiId |
string |
Yes |
The API ID. |
1 |
| RpsBegin |
integer |
Yes |
The initial RPS. |
100 |
| RpsLimit |
integer |
Yes |
The maximum RPS. |
100 |
| AutoStep |
boolean |
No |
Specifies whether to enable auto-step. This parameter is valid only in concurrent mode, which is when testMode is set to |
true |
| Configuration |
object |
Yes |
The stress testing configuration of the scenario. |
|
| AllConcurrencyBegin |
integer |
No |
The total initial number of concurrent users for all connections. The value is evenly distributed to each connection. This parameter is used in concurrent mode. If you do not set this parameter, you must set relationLoadConfig. |
100 |
| AllConcurrencyLimit |
integer |
No |
The total maximum number of concurrent users for all connections. The value is evenly distributed to each connection. This parameter is used in concurrent mode. If you do not set this parameter, you must set relationLoadConfig. |
100 |
| AllRpsBegin |
integer |
No |
The total initial RPS for all APIs. The value is evenly distributed to each API. This parameter is used in RPS mode. If you do not set this parameter, you must set apiLoadConfig. |
100 |
| AllRpsLimit |
integer |
No |
The total maximum RPS for all APIs. The value is evenly distributed to each API. This parameter is used in RPS mode. If you do not set this parameter, you must set apiLoadConfig. |
100 |
| Increment |
integer |
No |
The increment percentage. Valid values: 10 to 100. The value must be a multiple of 10. This parameter is valid only in concurrent mode and when auto-step is enabled. This means testMode is concurrency_mode and |
30 |
| KeepTime |
integer |
No |
The duration of a single stress level. Unit: minutes. The duration must be shorter than the value of maxRunningTime. |
3 |
| MaxRunningTime |
integer |
Yes |
The duration of the stress test. Unit: minutes. Valid values: 1 to 1440. |
10 |
| RelationLoadConfigList |
array |
No |
The initial and maximum number of concurrent users for the connection. This parameter is used in concurrent mode. |
|
|
object |
No |
|||
| ConcurrencyBegin |
integer |
Yes |
The initial number of concurrent users. |
100 |
| ConcurrencyLimit |
integer |
Yes |
The maximum number of concurrent users. |
100 |
| RelationId |
string |
No |
The connection ID. |
1 |
| TestMode |
string |
Yes |
The stress testing mode. Valid values:
|
concurrency_mode |
| VpcLoadConfig |
object |
No |
The VPC configuration. |
|
| RegionId |
string |
Yes |
The region ID. |
cn-beijing |
| SecurityGroupId |
string |
Yes |
The security group ID. |
sg-jkasgfieiajidsjakjscb |
| VSwitchId |
string |
Yes |
The vSwitch ID. |
vsw-skjfhlahsljkhsfalkjdoiw |
| VpcId |
string |
Yes |
The VPC ID. |
vpc-akjhsdajgjsfggahjkga |
| RelationList |
array |
Yes |
The connection configuration. |
|
|
array<object> |
No |
|||
| ApiList |
array |
Yes |
The information about the APIs in the connection. |
|
|
array<object> |
No |
|||
| ApiId |
string |
No |
The API ID. |
1 |
| ApiName |
string |
Yes |
The API name. |
api |
| Body |
object |
No |
The request body. |
|
| BodyValue |
string |
No |
The content of the request body. For example, `{\"key1\":\"value2\",\"key2\":\"value2\"}`. |
{\"global\":\"${global}\",\"name\":\"${name}\"} |
| ContentType |
string |
No |
The type of the request body. Default value: |
application/x-www-form-urlencoded |
| CheckPointList |
array |
No |
The checkpoints. |
|
|
object |
No |
|||
| CheckPoint |
string |
No |
The object to check. If type is HEADER, this parameter specifies a field in the header. If |
userId |
| CheckType |
string |
No |
The type of the checkpoint. Valid values:
|
EXPORTED_PARAM |
| ExpectValue |
string |
No |
The content to check, which is the expected value. |
111 |
| Operator |
string |
No |
The checkpoint condition. |
ctn |
| ExportList |
array |
No |
The response parameters. |
|
|
object |
No |
|||
| Count |
string |
No |
The sequence number of the matching item. The value can be a number or `Random`. This parameter is required when the response parameter is extracted from the request body (BODY_TEXT). |
0 |
| ExportName |
string |
No |
The name of the response parameter. |
test |
| ExportType |
string |
No |
The source of the response parameter. Valid values:
|
BODY_JSON |
| ExportValue |
string |
No |
The expression used to parse the response parameter. |
data.itemlist[0] |
| HeaderList |
array |
No |
The request headers. |
|
|
object |
No |
|||
| HeaderName |
string |
No |
The name of the header field. |
Accept-Encoding |
| HeaderValue |
string |
No |
The value of the header field. |
gzip, deflate, br |
| Method |
string |
Yes |
The request method. |
GET |
| RedirectCountLimit |
integer |
Yes |
The number of redirections. Set the value to 0 to allow redirections or 10 to disallow redirections. Configure this parameter as needed. |
0 |
| TimeoutInSecond |
integer |
No |
The timeout period for the API call. Unit: seconds. Default value: 5. Valid values: 1 to 60. |
5 |
| Url |
string |
Yes |
The URL for stress testing. |
http://www.example.com |
| FileParameterExplainList |
array |
No |
The configurations of the file parameters in the connection. |
|
|
object |
No |
|||
| BaseFile |
boolean |
No |
Specifies whether the file is a baseline file. |
true |
| CycleOnce |
boolean |
No |
Specifies whether to poll the file once. |
true |
| FileName |
string |
Yes |
The file name. |
fileName.csv |
| FileParamName |
string |
Yes |
The names of the parameter columns in the file. |
name,uid,age |
| RelationId |
string |
No |
The connection ID. |
1 |
| RelationName |
string |
Yes |
The connection name. |
链路1 |
| SceneId |
string |
No |
The scenario ID. If you do not specify this parameter, a scenario is created. If you specify this parameter, the specified scenario is updated. |
IUYAHGJ |
| SceneName |
string |
Yes |
The scenario name. |
test |
Response parameters
|
Parameter |
Type |
Description |
Example |
|
object |
|||
| Code |
string |
The system status code. |
200 |
| HttpStatusCode |
integer |
The HTTP status code. |
200 |
| Message |
string |
The error message. This message is empty if the request is successful. |
空 |
| RequestId |
string |
The request ID. |
A8E16480-15C1-555A-922F-B736A005E52D |
| SceneId |
string |
The scenario ID. |
IUYAHGJ |
| Success |
boolean |
Indicates whether the request was successful.
|
true |
Examples
Success response
JSON format
{
"Code": "200",
"HttpStatusCode": 200,
"Message": "空",
"RequestId": "A8E16480-15C1-555A-922F-B736A005E52D",
"SceneId": "IUYAHGJ",
"Success": true
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | ModifyPtsSceneFail | The scene does not exit |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.