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": []}'import requests
response = requests.put( "https://api.e2enetworks.com/myaccount/api/v1/label/mapping/{resource_type}/{resource_id}/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "attach": [ 2790, ], "detach": [], },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/label/mapping/{resource_type}/{resource_id}/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "PUT", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "attach": [ 2790 ], "detach": [] }),});console.log(await response.json());This endpoint allows attaching and detaching tags to/from resources (e.g., nodes) in a specific project and location.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”resource_type
required
string
Type of the resource to attach/detach tag.
resource_id
required
integer
ID of the parent resource.
Query Parameters
Section titled “Query Parameters”project_id
required
integer
Project ID Find your project id here
location
required
string
Deployment region for the resource. Accepted values: Delhi, Chennai.
Mumbai region has been discontinued. Delhi and Chennai are the only supported regions.
Request Bodyrequired
Section titled “Request Bodyrequired”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": []}Responses
Section titled “Responses”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"}