Updated on 2023-06-26 GMT+08:00

Creating a Plan in a Project

Function

Create a plan in a project.

URI

POST /v1/projects/{project_id}/plans

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Unique ID of a project. The value is a string of 32 characters.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. Call IAM to obtain the user token (value of X-Subject-Token in the response header).

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

assigned_id

No

String

Processor ID. If this parameter is left blank, the current user is used by default.

name

Yes

String

Plan name

plan_cycle

Yes

PlanCycle object

Plan period

service_id_list

Yes

Array of integers

Case types contained in the plan. The array length is less than 10.

Table 4 PlanCycle

Parameter

Mandatory

Type

Description

end_date

No

String

End time of a plan, which must be UTC time. Example, 2020-03-31

start_date

No

String

Start time of a plan, which must be UTC time. Example, 3/4/2020

Response Parameters

Status code: 201

Table 5 Response body parameters

Parameter

Type

Description

plan_id

String

Plan ID returned after the API is called successfully

error_code

String

Error code displayed after an API fails to be called

error_msg

String

Error message displayed after an API fails to be called

Example Requests

post https://{endpoint}/v1/projects/efdb403066474ab08836b9eeaaa23bca/plans

{
  "assigned_id" : "efdb403066474ab08836b9eeaaa23bca",
  "name" : "This is a test plan name",
  "plan_cycle" : {
    "end_date" : "2020-03-31",
    "start_date" : "2020-03-04"
  },
  "service_id_list" : [ 13, 24 ]
}

Example Responses

Status code: 201

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

201

Created

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.