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 |
| Business Transaction | BUSINESS_TRANSACTION |
| Dashboard | DASHBOARD |
カスタムタグ付けの有効化
この機能を使用するには、管理コンソールで entity.tagging.enabled アカウントレベルプロパティを true に設定します。デフォルトでは、このプロパティは無効になっています。
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. However, tag keys can differ in case when associated with separate entities.
For example, consider the tags
[OWNER: Joe]and[owner: John]. Although the key name "owner" is the same, the letter case differs.If these tags are associated with the same entity, the entity recognizes only the last tag applied,
[owner: John], because the tag key name is the same regardless of case. Conversely, if the tags are associated with different entities, each entity recognizes its respective tag because the tag keys are unique to each entity. - The tag keys and values cannot be null, but can have a maximum length of
255characters (including letters, numbers, punctuation, and symbols).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.entityproperty 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.accountproperty in the Administration Console.
Format
POST controller/restui/tags/tagEntitiesInBatchInput parameters
| Parameter Name | Parameter Type | Value | Mandatory |
|---|---|---|---|
entityType | RequestPayload | 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 /controller/restui/tags/allTagsOnEntity?entityId={entityId}&entityType={entityType}
Input parameters
| パラメータ名 | Parameter Type | 値 | 必須 |
|---|---|---|---|
|
entityId |
URI |
エンティティの Splunk AppDynamics ID(数値)。 |
あり |
| entityType | URI |
指定した entityId の、すべてのタグを削除するエンティティのタイプ。値には、 | あり |
例
この例では、ID が であるアプリケーションに関連付けられたすべてのタグを削除します。
https://<controller_host>:<controller_port>/controller/restui/tags/allTagsOnEntity?entityId=10&entityType=APPLICATION
エンティティのカスタムタグの削除
特定のエンティティに関連付けられている特定のタグを削除できます。
DELETE /controller/restui/tags/tagOnEntity?tagId={tagId}&entityId={entityId}&entityType={entityType}
Input parameters
| パラメータ名 | Parameter Type | 値 | 必須 |
|---|---|---|---|
|
tagId |
URI |
タグの ID。 |
あり |
|
entityId |
URI |
エンティティの Splunk AppDynamics ID(数値)。 |
あり |
| entityType | URI |
エンティティのタイプ。値には、 | あり |
Example
この例では、ID が 10 であるアプリケーションに関連付けられた ID が 5 であるタグを削除します
https://<controller_host>:<controller_port>/controller/restui/tags/tagOnEntity?tagId=5&entityId=10&entityType=APPLICATION
グループ内のエンティティのカスタムタグの削除
同じタイプのエンティティのすべてのタグを一括で削除できます。
POST /controller/restui/tags/removeAllTagsOnEntitiesInBatch
Input parameters
| パラメータ名 | Parameter Type | 値 | 必須 |
|---|---|---|---|
|
entityType |
RequestPayload |
カスタムタグを削除する必要があるエンティティのタイプ。値には、 |
あり |
entityIds | RequestPayload |
タグを削除する必要がある entityID の配列。 | あり |
要求の例
https://<controller_host>:<controller_port>/controller/restui/tags/removeAllTagsOnEntitiesInBatch
{
"entityType": "APPLICATION",
"entityIds" : [10, 11, 12]
}
応答の例
{
"entityType": "APPLICATION",
"success": {
"count": 2,
"entityIds": [10, 11]
},
"failure": {
"count": 1,
"entityIds": [12]
}
}