Querying Custom Job Details
Function
This API is used to query details about a custom job.
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
coc:document:getDocument
Read
document *
-
-
-
URI
GET /v1/documents/{document_id}
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
document_id |
Yes |
String |
Definition: Job UUID. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
version |
No |
String |
Definition: Job version. The value can be v1 or v2. If this parameter is not specified, the latest version is queried by default. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
document_type |
No |
String |
Definition: Type of the job to be executed. Constraints: Value range: PUBLIC or PRIVATE. Default value: N/A. |
Request Parameters
None
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Definition: Job ID. Value range: N/A. |
|
document_id |
String |
Definition: Job UUID. Value range: N/A. |
|
name |
String |
Definition: Job name. Value range: N/A. |
|
content |
String |
Definition: Job content, which is a DSL statement. Value range: N/A. |
|
create_time |
Long |
Definition: Creation time. Value range: N/A. |
|
update_time |
Long |
Definition: Update time. Value range: N/A. |
|
version |
String |
Definition: Job version, for example, v1 Value range: N/A. |
|
creator |
String |
Definition: Creator. Value range: N/A. |
|
modifier |
String |
Definition: Modifier. Value range: N/A. |
|
enterprise_project_id |
String |
Definition: Enterprise project ID. Value range: N/A. |
|
versions |
Array of DocumentVersionVo objects |
Definition: Version set. Value range: N/A. |
|
Parameter |
Type |
Description |
|---|---|---|
|
version |
String |
Definition: Version number, for example, v1. Value range: N/A. |
|
version_uuid |
String |
Definition: Version ID. Value range: N/A. |
|
create_time |
String |
Definition: Time when a version is created. Value range: N/A. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition: Error code. Value range: For details, see Error Codes. |
|
error_msg |
String |
Definition: Error description. Value range: For details, see Error Codes. |
Example Requests
Query details about a specified user-defined job.
GET https://{Endpoint}/v1/documents/{document_id}
Example Responses
Status code: 200
Request succeeded.
{
"data" : {
"document_id" : "DM2025070118023xxxxxxxxxx",
"name" : "test_document",
"content" : "meta:\n name: test_document\n schemaVersion: 3\n description: \"\"\ninputs: {}\nsteps:\n - name: pause\n description: pause\n task: hwc:runbook:suspend@1.0.0\n inputs: {}\n outputs: []",
"create_time" : 1751364159273,
"update_time" : 1751374833988,
"version" : "v2",
"creator" : "COC-xxxxx",
"modifier" : "COC-xxxx",
"enterprise_project_id" : "0",
"risk_level" : "LOW",
"description" : "",
"versions" : [ {
"version_uuid" : "573634e7-5e69-4b4b-b4a1-b74xxxx",
"create_time" : 1751374833988,
"version" : "v2"
}, {
"version_uuid" : "4530982f-f60b-479e-8145-b6d3xxxx",
"create_time" : 1751364159273,
"version" : "v1"
} ]
}
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Request succeeded. |
|
400 |
The contained error information is returned. For more status codes, see Status Codes. |
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