Help Center> ServiceStage> API Reference> Application Management V2 APIs> Instance> Obtaining Component Instance Snapshots
Updated on 2023-07-19 GMT+08:00

Obtaining Component Instance Snapshots

Function

This API is used to obtain component instance snapshots.

Instance snapshots refer to the instance information about the source version. They can be used for version rollback.

URI

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

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.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Number of records to be displayed. The value is 1000 or ranges from 0 to 100. If the specified value is not within the range, value 10 is assigned. In the non-pagination scenario, the value is 1000. In the pagination scenario, the value ranges from 0 to 100.

offset

No

Integer

Offset.

order_by

No

String

Sorting field. By default, query results are sorted by creation time.

order

No

String

Sorting order.

  • desc (default)
  • asc

Request

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type or format.

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 4 Response parameters

Parameter

Type

Description

count

Integer

Number of snapshots.

snapshots

Array of objects

Snapshot parameters. See Table 5.

Table 5 snapshot parameters

Parameter

Type

Description

create_time

Integer

Creation time.

description

String

Description.

instance_id

String

Component instance ID.

version

String

Version number.

Example Request

None

Example Response

{
	"snapshots": [
		{
			"version": "1.0.0",
			"description": "{\"action\":\"New Version: 1.0.0\"}",
			"instance_id": "11eddb33-140b-4e51-b1e2-6ec265373ca3",
			"create_time": 1610331830841
		}
	],
	"count": 1
}

Status Code

Table 6 Status codes

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