Download PDF
Download page Custom Tag APIs.
Custom Tag APIs
You can import custom tags in the Controller. You can then use the tags to filter and view entities to perform various tasks such as, configure a health rule or create a custom dashboard. The sources for custom tags can be API or CMDB.
For more information about tags, see Tags.
The below entries are currently supported for custom tagging :
Entity | Type |
---|---|
Application | APPLICATION |
Tier | APPLICATION_COMPONENT |
Node | APPLICATION_COMPONENT_NODE |
Server | SIM_MACHINE |
Synthetic page | BASE_PAGE |
Enable Custom Tagging
To use this feature, set the entity.tagging.enabled
account level property to true
in the Administration Console. By default, this property is disabled.
The Administration Console is managed by AppDynamics. Contact AppDynamics Support to update the settings.
Add Custom Tags
Custom tags are required to group entities of the same type. You can import the key-value pairs from the tag sources (CMDB or API) to the Controller by using the tagEntitiesInBatch
POST API.
Guidelines for Tags
Follow the guidelines before you import custom tags to the Controller:
- The tag key names should not include whitespaces before or after the names. If there are whitespaces in the input, they are removed while creating a tag key.
The tag keys and values are case-sensitive.
- The tag keys and values cannot be null, but can have a maximum length of
255
characters (including letters, numbers, punctuation, and symbols). If the length is more than 255 characters, it gets truncated to 255 characters.
Each tag key can have a single value. - The maximum limit for tags per entity is
50
.
The default limit for tags per entity is25
. To extend it till50
, the administrator can update themax.tags.per.entity
property by using the Administration Console. - The maximum limit for tags per account is
100000
.
The default limit for tags per account is50000
. To extend it till100000
, the administrator can update themax.tags.per.account
property in the Administration Console.
Format
POST controller/restui/tags/tagEntitiesInBatch
Input parameters
Parameter Name | Parameter Type | Value | Mandatory |
---|---|---|---|
|
| The type of the entity. The values can be | Yes |
source | RequestPayload | The source for custom tags. The values can be | Yes |
entities | RequestPayload | Includes the entity details such as Here, | Yes |
Example Request
{
"entityType": "APPLICATION",
"source":"API",
"entities" :
[
{
"entityName": "sample App 1",
"entityId": 10,
"tags":
[
{
"key": "owner",
"value": "joe"
},
{
"key": "environment",
"value": "production"
}
]
},
{
"entityName": "sample App 2",
"entityId": 12,
"tags":
[
{
"key": "owner",
"value": "joe"
},
{
"key": "environment",
"value": "development"
},
{
"key": "criticality",
"value": "low"
}
]
}
]
}
Example Response
{
"entityType": "APPLICATION",
"success" : {
"count": 1,
"entityIds": [10]
},
"failure" : {
"count": 1,
"entityIds": [12]
}
}
The response shows how many entities were successfully tagged.
Delete All the Custom Tags for an Entity
You can delete all tags associated with a specific entity.
DELETE /controller/restui/tags/allTagsOnEntity?entityId={entityId}&entityType={entityType}
Input parameters
Parameter Name | Parameter Type | Value | Mandatory |
---|---|---|---|
entityId | URI | Numeric AppDynamics Id of the entity. | Yes |
entityType | URI | The type of entity on which you want to remove all tags for the specified entityId. The values can be | Yes |
Example
This example deletes all tags associated with an application that has an id as 10.
https://<controller_host>:<controller_port>/controller/restui/tags/allTagsOnEntity?entityId=10&entityType=APPLICATION
Delete a Custom Tag for an Entity
You can delete a specific tag associated with a specific entity.
DELETE /controller/restui/tags/tagOnEntity?tagId={tagId}&entityId={entityId}&entityType={entityType}
Input parameters
Parameter Name | Parameter Type | Value | Mandatory |
---|---|---|---|
tagId | URI | The Id of the tag. | Yes |
entityId | URI | The numeric AppDynamics Id of the entity. | Yes |
entityType | URI | The type of the entity. The values can be | Yes |
Example
This example deletes a tag with an id of 5
associated with an application having an id 10
https://<controller_host>:<controller_port>/controller/restui/tags/tagOnEntity?tagId=5&entityId=10&entityType=APPLICATION
Delete Custom Tags for Entities in a Group
You can delete all tags for entities of the same type in a batch.
POST /controller/restui/tags/removeAllTagsOnEntitiesInBatch
Input parameters
Parameter Name | Parameter Type | Value | Mandatory |
---|---|---|---|
|
| The type of the entity from where you are required to delete the custom tags. The values can be | Yes |
entityIds | RequestPayload | Array of entityIDs from which you require to remove the tags. | Yes |
Example Request
https://<controller_host>:<controller_port>/controller/restui/tags/removeAllTagsOnEntitiesInBatch
{
"entityType": "APPLICATION",
"entityIds" : [10, 11, 12]
}
Example Response
{
"entityType": "APPLICATION",
"success": {
"count": 2,
"entityIds": [10, 11]
},
"failure": {
"count": 1,
"entityIds": [12]
}
}