Help Center/ ServiceStage/ API Reference (Kuala Lumpur Region)/ Application Management APIs/ Instance/ Querying Instance Details Based on the Instance ID
Updated on 2023-06-26 GMT+08:00

Querying Instance Details Based on the Instance ID

Function

This API is used to query instance details based on the instance ID.

URI

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

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

None

Response

Table 2 Response parameters

Parameter

Type

Description

id

String

Component instance ID.

name

String

Component instance name.

environment_id

String

Component environment ID.

platform_type

String

Platform type.

Value: cce or vmapp.

description

String

Instance description.

flavor_id

String

Resource specifications.

artifacts

Map<String, Object>

Artifact. key indicates the component name. In the Docker container scenario, key indicates the container name. See Table 3.

version

String

Component version.

configuration

Map<String, Object>

Component configurations, such as environment variables.

creator

String

Creator.

create_time

Integer

Creation time.

update_time

Integer

Update time.

external_accesses

Array of objects

Access mode. See Table 4.

refer_resources

Array of objects

Deployed resources. See Table 5.

status_detail

Object

Status details. See Table 6.

Table 3 artifact parameters

Parameter

Type

Description

storage

String

Storage mode. Value: swr or obs.

type

String

Type. Value: package (VM-based deployment) or image (container-based 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.

Table 4 external_accesses parameters

Parameter

Type

Description

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.

Table 5 refer_resources parameters

Parameter

Type

Description

id

String

Resource ID.

type

String

Basic resources: cce, and ecs.

Optional resources: dcs, elb, and other services.

refer_alias

String

Application alias, which is provided only in DCS scenario. Value: "distributed_session", "distributed_cache", "distributed_session, distributed_cache".

Default value: "distributed_session, distributed_cache".

parameters

Map<String,Object>

Reference resource parameter.

Table 6 status_detail parameters

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.

last_job_status

String

Latest job status.

Example

Example request

None

Example response

{
	"id": "11eddb33-140b-4e51-b1e2-6ec265373ca3",
	"name": "test-micro-test-env-7iafjk",
	"environment_id": "61b81021-21d5-42f3-b80e-0b6bd10dbf7d",
	"platform_type": "cce",
	"flavor_id": "CUSTOM-10G:250m-250m:0.5Gi-0.5Gi",
	"artifacts": {
		"test-micro": {
			"storage": "swr",
			"type": "image",
			"url": "swr.region_id.development.com/ns/examples:v2",
			"auth": "iam",
			"version": "1.0.0",
			"properties": {}
		}
	},
	"version": "1.0.2",
	"description": "",
	"configuration": {
		"env": [
			{
				"name": "PAAS_PROJECT_ID",
				"value": "e7d2e9c589e5445e808a8ff0d1235aca",
				"internal": true
			}
		],
		"lifecycle": {
			"post-start": null,
			"pre-stop": null
		},
		"scheduler": {
			"affinity": {
				"az": [],
				"node": [],
				"application": []
			},
			"anti-affinity": {
				"az": [],
				"node": [],
				"application": []
			},
			"isSynchronized": true
		},
		"strategy": {
			"upgrade": "RollingUpdate",
			"spec": {
				"maxSurge": 0,
				"maxUnavailable": 1
			}
		}
	},
	"creator": null,
	"create_time": 1610331819996,
	"update_time": 1610522676792,
	"external_accesses": null,
	"refer_resources": [
		{
			"id": "523498f1-36c4-11eb-ae36-0255ac1000c2",
			"type": "cce",
			"parameters": {
				"namespace": "default"
			}
		},
		{
			"id": "default",
			"type": "cse"
		}
	],
	"status_detail": {
		"status": "RUNNING",
		"replica": 1,
		"available_replica": 1,
		"fail_detail": null,
		"last_job_id": "JOB16c33466-41e6-4c5b-a9ac-2059253a1e5c",
		"last_job_status": "SUCCEEDED",
		"enterprise_project_id": "0"
	}
}

Status Code

Table 7 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.