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

Deleting an Environment Resource Based on the Environment ID

Function

This API is used to delete an environment resource based on the environment ID.

URI

DELETE /v3/{project_id}/cas/environments/{environment_id}/iac-resources/{resource_id}

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.

resource_id

Yes

String

Resource ID.

Request

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

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.

Content-Type

Yes

String

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

Response parameters

Table 3 Response body parameter

Parameter

Type

Description

id

String

Environment ID.

name

String

Environment name.

description

String

Environment description.

project_id

String

Project ID.

enterprise_project_id

String

Enterprise project ID.

deploy_mode

String

Environment type.

  • virtualmachine
  • container: Kubernetes
  • mixed: VM and Kubernetes

vpc_id

String

VPC ID.

creator

String

Creator.

create_time

Integer

Creation time.

update_time

Integer

Update time.

labels

Array of objects

Label. You can use TMS to query resources by labels. See Table 5.

type

String

Whether the Kubernetes environment is of the HA type.

  • normal: non-HA environment.
  • high: HA environment.

resource_create_mode

String

Resource configuration mode.

  • none: resource management.
  • iac: resource creation.

iac_resources

Array of objects

Resource template. See Table 4.

iac_task_status

String

Task status.

  • Init: initializing
  • ExecutionPlanCreating: creating
  • ExecutionPlanCreateSuccess: created
  • ExecutionPlanCreateFailed: creation failed
  • ExecutionPlanApplying: deploying
  • ExecutionPlanApplySuccess: deployed
  • ExecutionPlanApplyFailed: deployment failed
  • ResourceExceed: resource limit exceeded

availability_zone

Array of String

List of AZs.

Table 4 iac_resources

Parameter

Type

Description

id

String

Resource ID.

name

String

Resource name.

type

String

Resource type.

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

status

String

Status of an environment resource.

  • CREATION_IN_PROGRESS: The environment resource is being created.
  • CREATION_FAILED: The environment resource fails to be created.
  • CREATION_COMPLETE: The environment resource is created.
  • UPDATE_IN_PROGRESS: The environment resource is being updated.
  • UPDATE_FAILED: The environment resource fails to be updated.
  • UPDATE_COMPLETE: The environment resource is updated.
  • DELETION_IN_PROGRESS: The environment resource is being deleted.
  • DELETION_FAILED: The environment resource fails to be deleted.
  • DELETION_COMPLETE: The environment resource is deleted.

resource_id

String

Resource instance ID.

custom_tf

String

Terraform template.

vars_body

Map<String, Object>

Resource variable.

vars_structure

Array of objects

Variable structure. See Table 6.

Table 5 labels

Parameter

Type

Description

key

String

Label name.

value

String

Label value.

Table 6 var_structure

Parameter

Type

Description

var_key

String

Variable name.

var_value

String

Variable value.

Example Request

None

Example Response

{
	"id" : "17a5baa0-8352-4fa9-94e7-fad2569a20a2",
	"name" : "hldtest1",
	"alias" : null,
	"description" : "",
	"project_id" : "0ada17d53d00d5cc2f8ac00ca4b5b119",
	"enterprise_project_id" : "0",
	"charge_mode" : "provided",
	"vpc_id" : "0000653d-e8b9-47ce-91d2-2c728f3338a4",
	"base_resources" : [],
	"optional_resources" : null,
	"creator" : "paas_roma",
	"create_time" : 1708915381226,
	"update_time" : 1709103342541,
	"deploy_mode" : "virtualmachine",
	"vm_cluster_size" : 50,
	"status" : null,
	"broker_id" : null,
	"labels" : [],
	"offline_hosts" : null,
	"alert_status" : null,
	"resource_create_mode" : "iac",
	"iac_resources" : [{
			"id" : "a12345",
			"name" : "cce12323qq",
			"type" : "rds",
			"status" : "INIT",
			"vars_structure" : [{
					"var_key" : "www",
					"var_value" : ""
				}
			],
			"vars_body" : {
				"var_key" : "11qwqqw"
			}
		}
	],
	"iac_task_status" : null,
	"component_count" : 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.