Updated on 2024-04-19 GMT+08:00

Displaying Batch Details

Function

This API is used to query batch details, which is used to obtain the instance list in a batch by page. Filter criteria: pagination parameter

URI

GET /v1/job/script/orders/{execute_uuid}/batches/{batch_index}

Table 1 Path parameters

Parameter

Mandatory or Not

Type

Description

batch_index

Yes

Integer

Batch index.

Minimum value: 1

Maximum value: 20

execute_uuid

Yes

String

Execution ID of a script service ticket, which is obtained from the response bodies of executeJobScript and ListJobScriptOrders.

Minimum length: 1 character

Maximum length: 26 characters

Table 2 Query parameters

Parameter

Mandatory or Not

Type

Description

status

No

String

Instance execution status. The options are as follows: READY: to be executed; PROCESSING: being executed; ABNORMAL: abnormal; CANCELED: canceled; FINISHED: successful.

The value can be:

  • READY
  • PROCESSING
  • ABNORMAL
  • CANCELED
  • FINISHED

limit

Yes

Integer

Pagination parameter: maximum number of records returned on each page.

Minimum value: 1

Maximum value: 50

marker

Yes

Long

Pagination parameter: ID of the last record on the previous page.

Minimum value: 0

Maximum value: 2147483647

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

batch_index

Integer

Batch index, starting from 1.

total_instances

Integer

Number of instances executed in a batch

execute_instances

Array of ExectionInstanceModel objects

Execution instance list, pagination

Table 4 ExectionInstanceModel

Parameter

Type

Description

id

Long

Primary key ID

target_instance

ResourceInstance object

New instance

gmt_created

Long

Creation time

gmt_finished

Long

Completion time

execute_costs

Long

Timeout interval, in seconds.

status

String

Instance execution status

The value can be:

  • READY
  • PROCESSING
  • ABNORMAL
  • CANCELED
  • FINISHED
  • ROLLBACKED

message

String

Instance execution logs

Table 5 ResourceInstance

Parameter

Type

Description

resource_id

String

Host ID of an ECS

agent_sn

String

Agent management ID

agent_status

String

Agent management status

properties

ResourceInstanceProp object

Additional attributes of the host

Table 6 ResourceInstanceProp

Parameter

Type

Description

host_name

String

Host name

fixed_ip

String

IP address of the internal network

floating_ip

String

Elastic IP Address (EIP)

region_id

String

Region ID

zone_id

String

AZ

application

String

CloudCMDB application. This parameter has a value only in the CloudCMDB application view, which is similar to the cloud services on the management plane.

group

String

CloudCMDB group. This parameter has a value only in the CloudCMDB application view, which is similar to the schema of the management plane.

project_id

String

Project ID of an instance.

Consumption is required. This parameter is mandatory.

Request Example

None

Response Example

Status code: 200

Response

{
  "data" : {
    "batch_index" : 1,
    "total_instances" : 1,
    "execute_instances" : [ {
      "id" : 1588,
      "target_instance" : {
        "resource_id" : "resource_id",
        "agent_sn" : "agent_sn",
        "agent_status" : null,
        "region_id" : null,
        "project_id" : null,
        "properties" : {
          "host_name" : "host_name",
          "fixed_ip" : "x.x.x.x",
          "floating_ip" : null,
          "region_id" : "cn-north-7",
          "zone_id" : "cn-north-7c",
          "application" : null,
          "group" : null,
          "project_id" : null
        }
      },
      "gmt_created" : 1697946452436,
      "gmt_finished" : 1697946763467,
      "execute_costs" : 311031,
      "status" : "CANCELED",
      "message" : "Script execution result"
    } ]
  }
}

Status Code

Status Code

Description

200

Response

Error code

See Error code.