All Products
Search
Document Center

Performance Testing:SavePtsScene

Last Updated:Aug 14, 2025

Saves a new scenario or updates an existing one.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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 concurrency_mode.

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 autoStep is true.

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: concurrent mode

  • tps_mode: RPS mode

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.

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 type is EXPORTED_PARAM, this parameter specifies the name of a response parameter.

userId

CheckType

string

No

The type of the checkpoint. Valid values:

  • BODY_TEXT: response body

  • HEADER: response header

  • STATUS_CODE: response status code

  • EXPORTED_PARAM: response parameter

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_TEXT: request body

  • BODY_JSON: request body

  • HEADER: request header

  • STATUS_CODE: response status code

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: The request was successful.

  • false: The request failed.

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.