Domain name for API request: pts.intl.tencentcloudapi.com.
This API is used to create a scenario.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common Params. The value used for this API: CreateScenario. |
Version | Yes | String | Common Params. The value used for this API: 2021-07-28. |
Region | No | String | Common Params. This parameter is not required for this API. |
Name | Yes | String | Scenario Name. |
Type | Yes | String | Mode type of scenario. Valid values: 'pts-http' represents the simple mode, 'pts-js' represents the script mode, 'pts-jmeter' represents the JMeter mode. |
ProjectId | Yes | String | Project ID. |
Description | No | String | Scenario description. |
Load | No | Load | Load configuration. |
Configs.N | No | Array of String | Deprecated. |
Datasets.N | No | Array of TestData | Test datasets. |
Extensions.N | No | Array of String | Deprecated. |
SLAId | No | String | Deprecated. |
CronId | No | String | Cron job ID. |
Scripts.N | No | Array of String | Deprecated, |
TestScripts.N | No | Array of ScriptInfo | Test scripts. |
Protocols.N | No | Array of ProtocolInfo | Protocol files. |
RequestFiles.N | No | Array of FileInfo | Request files. |
SLAPolicy | No | SLAPolicy | SLA policy. |
Plugins.N | No | Array of FileInfo | Extension plugin files. |
DomainNameConfig | No | DomainNameConfig | Domain name resolution configuration. |
Owner | No | String | Creator name. |
Parameter Name | Type | Description |
---|---|---|
ScenarioId | String | Scenario ID. |
RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
Create scenario
POST / HTTP/1.1
Host: pts.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateScenario
<Common request parameters>
{
"Load": {
"VpcLoadDistribution": {
"VpcId": "abc",
"Region": "ap-guangzhou",
"RegionId": 1
},
"GeoRegionsLoadDistribution": [
{
"Region": "ap-guangzhou",
"RegionId": 1,
"Percentage": 30
},
{
"Region": "ap-shanghai",
"RegionId": 5,
"Percentage": 70
}
],
"LoadSpec": {
"Concurrency": {
"MaxRequestsPerSecond": 1000,
"Stages": [
{
"DurationSeconds": 60,
"TargetVirtualUsers": 1000
}
],
"IterationCount": 5
}
}
},
"Datasets": [
{
"HeaderInFile": true,
"Name": "data.csv",
"LineCount": 300,
"Split": true,
"UpdatedAt": "2020-09-22T00:00:00+00:00",
"HeaderColumns": [
"a1"
],
"Size": 3000
}
],
"Name": "scenario-a",
"ProjectId": "project-a",
"Scripts": [
"b.js"
],
"Configs": [
"c.prop"
],
"Type": "pts-js",
"Description": "Description"
}
{
"Response": {
"RequestId": "31446d02-c4f3-4a53-9efe-b5ad18cfcb7f",
"ScenarioId": "scenario-a"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
AuthFailure | CAM signature/authentication error. |
FailedOperation.ResourceNotFound | The resource does not exist. |
InternalError | Internal error. |
InvalidParameter | Invalid parameter. |
InvalidParameterValue | Invalid parameter value. |