Use this API to create a new tag in the Inventory.
Notes:
- You can create a maximum of 5 tags through one request. You cannot create reserved tags.
- You can tag a maximum of 96 systems and 1000 partitions with one tag.
Resource Information
Response formats | JSON |
Requires authentication? | Yes |
Rate limited? | All API calls are automatically rate limited to a maximum of 10 calls per second. |
Request Syntax
POST /api/public/v2/inventory/cmc/tags HTTP/1.1
Host: xxxxxxxxxxxx.powercmc.comx-cmc-client-id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
x-cmc-client-secret: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Content-Type: application/json
[
{
"Name": "string",
"Systems": [
{
"UUID": "string"
}
],
"Partitions": [
{
"UUID": "string"
}
]
}
]
URI Request Parameters
This request does not have any parameters.
Request Headers
Authenticate the API by completing the following steps:
- Set your client ID value in the X-CMC-Client-Id header in every request.
- Set the client secret value in the X-CMC-Client-Secret header in every request.
To form the CMC API full URL, append the relative path of the endpoint you want to use to the Base URL.
Example: https://<portal-url>/api/public/v2/ inventory/cmc/tags
Request Body
The request accepts the following data:
- Name
The name of the tag that you want to create.- Type: String
- Required: Yes
- Systems
The systems that you want to tag by using this new tag.- Type: Array of objects
- Required: No
- Partitions
The partitions that you want to tag by using this new tag.- Type: Array of objects
- Required: No
- UUID
The unique identifier of the resource.- Type: String
- Required Yes
Errors
The following errors are the common errors for this API:
BadRequestException
The submitted request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.
HTTP Status Code: 400
UnauthorizedException
The request is denied because the caller has insufficient permissions.
HTTP Status Code: 401
NotFoundException
The requested resource is not found. Make sure that the request URI is correct.
HTTP Status Code: 404
TooManyRequestsException
The request has reached its throttling limit. Retry after the specified time.
HTTP Status Code: 429
Sample Requests
Review the following examples to understand how the API request and response work.
POST /api/public/v2/inventory/cmc/tags HTTP/1.1
Host: xxxxxxxxxxxx.powercmc.com
x-cmc-client-id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
x-cmc-client-secret: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Content-Type: application/json
[
{
"Name": "Test 3",
"Systems": [
{
"UUID": "XXXXXX-XXXXXXX-XXXXXXX"
}
],
"Partitions": [
{
"UUID": " XXXXXX-XXXXXXX-XXXXXXX"
}
]
}
]
Sample Response
If the action is successful, an HTTP 200 response is received from the service:
{
"message": "Tag(s) created successfully"
}
Comments
0 comments
Please sign in to leave a comment.