Help Center/ ServiceStage/ API Reference/ Application Management V3 APIs/ Environment/ Querying a Created Resource Based on the Environment ID
Updated on 2024-12-16 GMT+08:00

Querying a Created Resource Based on the Environment ID

Function

This API is used to query a created resource based on the environment ID.

URI

GET /v3/{project_id}/cas/environments/{environment_id}/iac-resources

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

environment_id

Yes

String

Environment ID. See Obtaining All Environments.

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 the token, see Authentication.

Response parameters

Table 3 Response body parameter

Parameter

Type

Description

iac_resources

Array of iac_resource objects

Environment resource list.

Table 4 iac_resources

Parameter

Type

Description

id

String

Resource ID.

resource_id

String

ID of a real resource.

name

String

Resource name.

type

String

Resource type.

  • vpc
  • subnet
  • eip
  • elb
  • cce
  • ecs
  • acl
  • ccenamespace

status

String

Resource status.

custom_tf

String

Terraform template.

vars_body

Map<String,Object>

Variable request body.

vars_structure

Array of var_structure objects

Variable structure. See Table 5.

Table 5 var_structure

Parameter

Type

Description

var_key

String

Variable name.

var_value

String

Variable value.

Example Request

None

Example Response

"iac_resources" : [{
			"id" : "a12345",
			"name" : "cce12323qq",
			"type" : "rds",
			"status" : "INIT",
			"vars_structure" : [{
					"var_key" : "www",
					"var_value" : ""
				}
			],
			"vars_body" : {
				"var_key" : "11qwqqw"
			}
		}
	]

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.