Creating a Plan in a Project
Function
This API is used to create a plan in a project.
Calling Method
For details, see Calling APIs.
URI
POST /v1/projects/{project_id}/plans
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition Project UUID, which uniquely identifies a project. For details about how to obtain the project UUID, see Obtaining a Project ID. Constraints 32 characters (letters and digits). Range N/A. Default Value N/A. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
assigned_id |
No |
String |
Definition Processor ID. If this parameter is left blank, the current user ID is used by default. Constraints N/A. Range N/A. Default Value N/A. |
|
name |
Yes |
String |
Definition Plan name. Constraints Max. 128 characters. Range N/A. Default Value N/A. |
|
plan_cycle |
Yes |
PlanCycle object |
Plan period. |
|
service_id_list |
Yes |
Array of integers |
Definition Types of cases in the plan. Constraints Max. array length: 10. Range N/A. Default Value N/A. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
end_date |
Yes |
String |
Definition End time of the plan. Constraints In the UTC format. For example, 2020-03-31. Range N/A. Default Value N/A. |
|
start_date |
Yes |
String |
Definition Start time of the plan. Constraints In the UTC format. For example, 2020-03-04. Range N/A. Default Value N/A. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
plan_id |
String |
Definition Plan ID returned after the API is called successfully. Range N/A. |
|
error_code |
String |
Definition Error code returned after API calling fails. Range N/A. |
|
error_msg |
String |
Definition Error message returned after API calling fails. Range N/A. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition Error code displayed after the API fails to be called. Range N/A. |
|
error_msg |
String |
Definition Error message displayed after the API fails to be called. Range N/A. |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition Error code displayed after the API fails to be called. Range N/A. |
|
error_msg |
String |
Definition Error message displayed after the API fails to be called. Range N/A. |
Status code: 404
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition Error code displayed after the API fails to be called. Range N/A. |
|
error_msg |
String |
Definition Error message displayed after the API fails to be called. Range N/A. |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition Error code displayed after the API fails to be called. Range N/A. |
|
error_msg |
String |
Definition Error message displayed after the API fails to be called. Range N/A. |
Example Requests
Create a plan in a project.
post https://{endpoint}/v1/projects/efdb403066474ab08836b9eeaaa23bca/plans
{
"assigned_id" : "efdb403066474ab08836b9eeaaa23bca",
"name" : "Example test plan",
"plan_cycle" : {
"end_date" : "2020-03-31",
"start_date" : "2020-03-04"
},
"service_id_list" : [ 13, 24 ]
}
Example Responses
Status code: 200
Created
{
"plan_id" : "b66aab5469cc4ab39b0dda8e644a42a4",
"error_code" : "CLOUDTEST.00000001",
"error_msg" : "error message displayed after an API fails to be called"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Created |
|
400 |
Bad request |
|
401 |
Unauthorized |
|
404 |
Not found |
|
500 |
Internal server 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.