Apply a tag to an object

post

/api/tags/objects/{notused}

Applies an existing tag to the specified pool or host.

To identify the host or resource pool, use the ID and kind parameters within the body of the request. Use the Tags parameter to identify the tags you want to apply to the host or resource pool.

Note: This endpoint is deprecated and will no longer be available in the future release.

Request

Supported Media Types
Path Parameters
Body ()
Body parameters
Root Schema : schema
Type: object
Show Source
Nested Schema : Tags
Type: array
Show Source
Security
Back to Top

Response

Supported Media Types

200 Response

200 Response
Body ()
Root Schema : schema
Type: array
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : tags
Type: array
Show Source

Default Response

Error Payload
Body ()
Root Schema : schema
Type: array
Show Source
Back to Top

Examples

The following example shows how to apply a tag to a resource pool or host. You perform this task by submitting a POST request to the REST resource using cURL. For more information about cURL, see Use cURL.

Note: The command in this example uses the URL structure https://rest_server_url/resource-path, where rest_server_url is the manager node for the Oracle Cloud Container instance. See Send Requests for the appropriate URL structure to use for Oracle Public Cloud.

cURL Command

curl -sk 
     -X "POST" 
     -H "Authorization: Bearer b39f09c71c297f1d" 
     "https://rest_server_url/api/tags/objects/host_id" 
     -d '{"tags":["100"],"id":"host_id","kind":"host"}'

In this example, replace host_id with the ID of the host, which you can find by sending a GET method to the /api/hosts endpoint.

Example of Response Body

{
  "kind": "host",
  "id": "host_id",
  "tags": [
    "100"
  ]
}
Back to Top