Creating a DevServer Job
Function
This API is used to create a DevServer job.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
POST /v1/{project_id}/dev-servers/jobs
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition: Project ID. For details, see Obtaining a Project ID and Name. Constraints: The value can contain 1 to 64 characters. Letters, digits, and hyphens (-) are allowed. Range: N/A Default Value: N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Name. |
|
description |
No |
String |
Description. |
|
server_ids |
Yes |
Array of strings |
The list of DevServer instance IDs. |
|
type |
Yes |
String |
Task template type. |
|
is_reboot |
No |
Boolean |
Specifies whether to automatically restart the task after the task is executed. |
|
items |
Yes |
Array of DevServerJobItem objects |
Task instance list. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
create_at |
String |
Definition: Creation time. Range: N/A |
|
update_at |
String |
Definition: Update time. Range: N/A |
|
id |
String |
Definition: Task ID. Range: N/A |
|
name |
String |
Definition: Task name. Range: N/A |
|
type |
String |
Definition: Task template type. Range: N/A |
|
status |
String |
Definition: Status. Range: N/A |
|
items |
Array of DevServerJobItem objects |
Definition: Task instance list information. |
|
tasks |
Array of DevServerTaskResponse objects |
Definition: Task details list. |
|
template_id |
String |
Definition: Task template ID. Range: N/A |
|
user_name |
String |
Definition: Information about the user who delivers the task. Range: N/A |
|
abnormal_count |
Integer |
Definition: number of nodes where the task fails. Range: N/A |
|
description |
String |
Definition: Description. Range: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
type |
String |
Definition: Fine-grained task type. Range: N/A |
|
spec |
Map<String,String> |
Definition: Parameters required by the task. |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Definition: task ID. Range: N/A |
|
server_id |
String |
DevServer ID. |
|
server_name |
String |
DevServer name. |
|
status |
String |
Task status. Options: PROCESSING: The task is being executed. SUCCESS: The task is complete. FAILED: The task fails to be executed. DELETE: The task has been deleted. |
|
cloud_server |
Map<String,String> |
Underlying ECS/BMS/HPS ID. |
|
message |
String |
Output information. |
|
create_at |
String |
Creation time. |
|
update_at |
String |
Update time. |
Example Requests
POST https://{endpoint}/v1/{project_id}/dev-servers/jobs
{
"server_ids" : [ "66d210bc-023c-490a-8664-afd321a163ad" ],
"type" : "HDK_UPGRADE",
"items" : [ {
"spec" : {
"version" : "24.1.rc3.10"
},
"type" : "HDK_UPGRADE"
} ],
"name" : "hdk_upgrade_task",
"description" : "Task description."
}
Example Responses
Status code: 200
OK
{
"create_at" : 1755005748201,
"update_at" : 1755005931007,
"id" : "64e004ec-6cb0-401f-a7c0-ec2557626b16",
"name" : "hdk_upgrade_task",
"description" : "Task description.",
"type" : "ASCEND_SOFTWARE_UPGRADE",
"status" : "FINISHED",
"items" : [ {
"spec" : {
"version" : "24.1.rc3.10"
},
"type" : "HDK_UPGRADE"
} ],
"tasks" : [ {
"create_at" : 1755005748201,
"update_at" : 1755005931355,
"id" : "64e004ec-ad30-4038-9af1-afd321a163ad",
"server_id" : "66d210bc-023c-490a-8664-afd321a163ad",
"server_name" : "liteserver-978c-00001",
"cloud_server" : {
"hps_ecs_id" : "e2cb187a-4c4d-495c-a5f8-3de83a4e44ce",
"id" : "39aab8e4-add9-4c2a-8fb7-c3e477e23855",
"type" : "HPS"
},
"status" : "SUCCESS",
"message" : "the message"
} ],
"template_id" : "6f02d33b-a5d6-485c-8d73-480da5870512",
"user_name" : "modelarts_user",
"abnormal_count" : 0
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK |
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