Skip to content

Attach/Detach Tags

PUT
/api/v1/label/mapping/{resource_type}/{resource_id}/
curl --request PUT \
--url 'https://api.e2enetworks.com/myaccount/api/v1/label/mapping/{resource_type}/{resource_id}/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \
--header 'Authorization: Bearer <API_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"attach": [
2790
],
"detach": []
}'

This endpoint allows attaching and detaching tags to/from resources (e.g., nodes) in a specific project and location.

resource_type
required
string
Allowed values: load_balancer volumes nodes eos sfs kubernetes dbass images cdp_backup cdn auto_scaling reserve_ip vpc eqs security_groups parameter_group firewall

Type of the resource to attach/detach tag.

resource_id
required
integer

ID of the parent resource.

project_id
required
integer
location
required
string
Allowed values: Delhi Chennai

Deployment region for the resource. Accepted values: Delhi, Chennai.

Mumbai region has been discontinued. Delhi and Chennai are the only supported regions.

Media typeapplication/json
object
attach
required

List of label IDs to attach.

Array<integer>
detach

List of label IDs to detach.

Array<integer>

Example

{
"attach": [
2790
],
"detach": []
}

Successful attachment and/or detachment of labels.

Media typeapplication/json
object
code
integer
data
object
details
object
action
string
parent_resource_id
integer
parent_resource_type
string
label_mapping_ids_to_create
Array<integer>
label_ids_to_delete
Array<integer>
errors
object
message
string

Example

{
"code": 200,
"data": {
"details": {
"action": "attach_and_detach",
"parent_resource_id": 235813,
"parent_resource_type": "nodes",
"label_mapping_ids_to_create": [
2790
],
"label_ids_to_delete": []
}
},
"errors": {},
"message": "Success"
}