Obtaining All Instances of a Component
Function
This API is used to obtain all instances of a component.
URI
GET /v2/{project_id}/cas/applications/{application_id}/components/{component_id}/instances
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| project_id | String | Yes | Tenant's project ID. |
| application_id | String | Yes | Application ID. |
| component_id | String | Yes | Component ID. |
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| limit | Integer | No | Number of records to be queried. Value range: 0–100. Default value: 1000, indicating that a maximum of 1000 records can be queried and all records are displayed on the same page. |
| offset | Integer | No | Offset. |
| order_by | String | No | Sorting field. By default, query results are sorted by creation time. The following enumerated values are supported: create_time, name, version, and update_time. |
| order | String | No | Descending or ascending order. Default value: desc. |
Request Parameters
Request parameters
None
Response Parameters
Response parameters
| Parameter | Type | Description |
|---|---|---|
| count | Integer | Total number of instances. |
| instances | Array of objects | Instance parameters. See Table 4. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Component instance ID. |
| application_id | String | Application ID. |
| application_name | String | Application name. |
| component_id | String | Component ID. |
| component_name | String | Component name. |
| name | String | Component instance name. |
| environment_id | String | Component environment ID. |
| environment_name | String | Environment name. |
| platform_type | String | Platform type. Value: cce or vmapp. |
| artifacts | Map<String, Object> | Artifact. key indicates the component name. In the Docker container scenario, key indicates the container name. See Table 5. |
| version | String | Component version. |
| creator | String | Creator. |
| create_time | Integer | Creation time. |
| update_time | Integer | Update time. |
| external_accesses | Array of objects | Access mode. See Table 6. |
| status_detail | Object | Status details. See Table 7. |
| Parameter | Type | Description |
|---|---|---|
| storage | String | Storage mode. Value: swr or obs. |
| type | String | Type. Value: package (VM deployment) or image (container deployment). |
| url | String | Software package or image address. |
| auth | String | Authentication mode. Value: iam or none. Default value: iam. |
| version | String | Version number. |
| properties | Map<String,String> | Property information. |
| Parameter | Type | Description |
|---|---|---|
| id | String | ID |
| protocol | String | Protocol. |
| address | String | Access address. |
| forward_port | Integer | Port for listening to an application component process. |
| type | String | Type. |
| status | String | Status. |
| create_time | Integer | Creation time. |
| update_time | Integer | Update time. |
| Parameter | Type | Description |
|---|---|---|
| enterprise_project_id | String | Enterprise project ID. |
| status | String | Instance status. |
| available_replica | Integer | Number of normal instance replicas. |
| replica | Integer | Number of instance replicas. |
| fail_detail | String | Failure description. |
| last_job_id | String | Latest job ID. |
Example
Example request
None
Example response
{
"count": 10,
"instances": [
{
"id": "string",
"application_id": "string",
"application_name": "string",
"component_id": "string",
"component_name": "string",
"name": "string",
"environment_id": "string",
"environment_name": "string",
"platform_type": "string",
"version": "string",
"external_accesses": [
{
"id": "xxx",
"protocol": "HTTP",
"address": "string",
"forward_port": 80,
"type": "AUTO_GENERATED",
"status": "NORMAL",
"create_time": 1571626146765,
"update_time": 1571626146765
}
],
"artifacts": {
"container-name": {
"storage": "swr",
"type": "image",
"url": "{IP}:20202/xxxxxxxx/junit-platformstest:1.0",
"auth": "iam"
}
},
"creator": "string",
"create_time": 0,
"update_time": 0,
"status_detail": {
"enterprise_project_id": "0",
"status": "RUNNING",
"available_replica": 1,
"replica": 1,
"fail_detail": "cluster_deleted",
"last_job_id": "xxx"
}
}
]
} Status Code
| HTTP Status Code | Description |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 404 | Not Found |
| 500 | Internal Server Error |
Error code must be in the format of SVCSTG.00100.[Error_ID]. Example: SVCSTG.00100400. See Error Codes of Application Management APIs.
Last Article: Creating an Application Component Instance
Next Article: Performing Operations on a Component Instance
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.