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 :

EntityType
Application APPLICATION

Tier 

APPLICATION_COMPONENT

Node  

APPLICATION_COMPONENT_NODE
ServerSIM_MACHINE 
Synthetic pageBASE_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 is 25. To extend it till 50, the administrator can update the max.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 is 50000. To extend it till 100000, the administrator can update the max.tags.per.account property in the Administration Console.

Format

POST controller/restui/tags/tagEntitiesInBatch
CODE

Input parameters

Parameter Name

Parameter Type

Value

Mandatory

entityType

RequestPayload

The type of the entity. The values can be APPLICATION, APPLICATION_COMPONENT,APPLICATION_COMPONENT_NODE, SIM_MACHINE, BASE_PAGE

Yes

sourceRequestPayload

The source for custom tags. The values can be CMDB, or API.

Yes
entitiesRequestPayload

Includes the entity details such as entityName, entityId, and the key-values for the custom tags.

Here, entityName is an optional parameter and entityId is a numeric AppDynamics ID of the entity. 

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"
                }
            ]
        }
    ]
}
CODE

Example Response

{
    "entityType": "APPLICATION",
    "success" : {
        "count": 1,
        "entityIds": [10]
    },
    "failure" : {
        "count": 1,
        "entityIds": [12]
    }
}

CODE

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}
CODE

Input parameters

Parameter Name

Parameter Type

Value

Mandatory

entityId

URI

Numeric AppDynamics Id of the entity. 

Yes

entityTypeURI

The type of entity on which you want to remove all tags for the specified entityId. The values can be APPLICATION, APPLICATION_COMPONENT,APPLICATION_COMPONENT_NODE, SIM_MACHINE, BASE_PAGE

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
CODE


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}
CODE


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

entityTypeURI

The type of the entity. The values can be APPLICATION, APPLICATION_COMPONENT,APPLICATION_COMPONENT_NODE, SIM_MACHINE, BASE_PAGE

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
CODE

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
CODE

Input parameters

Parameter Name

Parameter Type

Value

Mandatory

entityType

RequestPayload

The type of the entity from where you are required to delete the custom tags. The values can be APPLICATION, APPLICATION_COMPONENT,APPLICATION_COMPONENT_NODE, SIM_MACHINE, BASE_PAGE

Yes

entityIdsRequestPayload

Array of entityIDs from which you require to remove the tags. 

Yes

Example Request

https://<controller_host>:<controller_port>/controller/restui/tags/removeAllTagsOnEntitiesInBatch
CODE
{
 	"entityType": "APPLICATION",
	"entityIds" : [10, 11, 12]
}
CODE

Example Response

{
    "entityType": "APPLICATION",
    "success": {
        "count": 2,
        "entityIds": [10, 11]
    },
    "failure": {
        "count": 1,
        "entityIds": [12]
    }
}
CODE