Creating a Task (Old Edition)
Function
This API is used to create a task on the old UI.
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:createPerfTestTask
Write
cpts *
g:ResourceTag/<tag-key>
-
-
URI
POST /v1/{project_id}/tasks
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details, see Method of obtaining instructions. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Name. |
|
project_id |
Yes |
Integer |
Project ID. |
|
temps |
No |
Array of strings |
Transaction information. |
|
operate_mode |
No |
Integer |
Pressure phase mode (0: by duration; 1: by count; 2: both). |
|
bench_concurrent |
No |
Integer |
Benchmark concurrency. |
Response Parameters
Status code: 201
|
Parameter |
Type |
Description |
|---|---|---|
|
code |
String |
Response code. |
|
message |
String |
Response message. |
|
task_id |
Integer |
Task ID. |
Status code: 501
|
Parameter |
Type |
Description |
|---|---|---|
|
- |
String |
response message |
Example Requests
Creating a task named task. The ID of the PerfTest project to which the task belongs is 1.
/v1/{project_id}/tasks
{
"name" : "task",
"project_id" : 1,
"temps" : [ ],
"operate_mode" : 2,
"bench_concurrent" : 100
}
Example Responses
Status code: 201
success
{
"code" : "SVCSTG.CPTS.0000000",
"message" : "success",
"task_id" : 184138
}
Status Codes
|
Status Code |
Description |
|---|---|
|
201 |
success |
|
501 |
unknown error |
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