Help Center> ServiceStage> API Reference (ME-Abu Dhabi Region)> Application Management APIs> Instance> Querying the Operations Performed on a Component Instance
Updated on 2023-06-25 GMT+08:00

Querying the Operations Performed on a Component Instance

Function

This API is used to query the operations performed on a component instance.

URI

POST /v2/{project_id}/cas/applications/{application_id}/components/{component_id}/instances/{instance_id}/action

Table 1 Path parameters

Parameter

Type

Mandatory

Description

project_id

String

Yes

Tenant's project ID.

application_id

String

Yes

Application ID.

component_id

String

Yes

Component ID.

instance_id

String

Yes

Component instance ID.

Request

Table 2 Request parameters

Parameter

Type

Mandatory

Description

action

String

Yes

Operation. Value: start, stop, restart, scale, or rollback.

parameters

Object

No

Operation parameter, which is mandatory when action is set to scale or rollback. See Table 3.

Table 3 parameters description

Parameter

Type

Mandatory

Description

replica

Integer

No

Number of instances, which is mandatory when action is set to scale.

hosts

Array

No

ECS ID list. This parameter specifies the ECS deployed during VM scaling, and is mandatory for scaling.

version

String

No

Version number, which is mandatory when action is set to rollback. You can obtain the version number by using the API in Obtaining Component Instance Snapshots.

Response

Table 4 Response parameters

Parameter

Type

Description

job_id

String

Job ID.

Example

Example request

{
  "action": "scale",
  "parameters": {
    "replica": 4
  }
}

Example response

{
    "job_id": "JOB66761060-f209-407c-a093-4df6f531b9dc"
}

Status Code

Table 5 Status codes

Status Code

Description

200

OK

400

Bad Request

404

Not Found

500

Internal Server Error

Error Code

Error code must be in the format of SVCSTG.00100.[Error_ID]. Example: SVCSTG.00100400. See Error Codes of Application Management APIs.