Help Center/ ServiceStage/ API Reference/ Historical APIs/ Application Management V2 APIs/ Instance/ Querying Instance Details Based on the Instance ID
Updated on 2024-10-16 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

Mandatory

Type

Description

project_id

Yes

String

Tenant's project ID. See Obtaining a Project ID.

application_id

Yes

String

Application ID. See Obtaining All Applications.

component_id

Yes

String

Component ID. See Obtaining All Components of an Application.

instance_id

Yes

String

Component instance ID. See Obtaining All Component Instances.

Request

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type (format). Default value: application/json;charset=utf8.

X-Auth-Token

Yes

String

API calling can be authenticated using a token or AK/SK. If you use a token, this parameter is mandatory and must be set to the token. For details about how to obtain a token, see Obtaining a User Token.

Response

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

artifacts

Map<String, Object>

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

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

refer_resources

Array of objects

Deployed resources. See Table 6.

status_detail

Object

Status details. See Table 7.

Table 4 artifact

Parameter

Type

Description

storage

String

Storage mode. Value: swr (software repository), swr (image), obs, or codearts.

type

String

Type.

  • VM-based deployment supports package.
  • Container-based deployment supports package and image.

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 5 external_accesses

Parameter

Type

Description

id

String

Access type 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.

Table 6 refer_resources

Parameter

Type

Description

id

String

Resource ID.

type

String

Basic resources: cce, as, and ecs.

Optional resources: rds, dcs, elb, cse, and other services.

refer_alias

String

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

Default value: "distributed_session, distributed_cache".

parameters

Map<String,Object>

Reference resource parameter.

Table 7 status_detail

Parameter

Type

Description

enterprise_project_id

String

Enterprise project ID.

status

String

Instance status.

  • INITIALIZING
  • UPGRADING
  • FAILED
  • RUNNING
  • DELETING
  • STARTING
  • STOPPING
  • STOPPED
  • RESTARTING
  • PENDING
  • PARTIALLY_FAILED

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

Status Code

Description

200

OK

400

Bad Request

404

Not Found

500

Internal Server Error

Error Code

The error code format is SVCSTG.00100.[Error_ID], for example, SVCSTG.00100400. For details, see ServiceStage Error Codes.