Manage Tags (Reserved)


Overview

Add or remove tags from objects within an application. You can specify different sets of objects for adding and removing tags in a single request.

URI

POST /rest/applications/{name}/tags

Path parameters

name (string)

This parameter identifies the analyzed application. The application name must be properly encoded if it is required. Character back-quote is not allowed.

Request Body

{
    "addTags": ["tag1", "tag2"],
    "deleteTags": ["oldTag"],
    "nodes": ["1803", "1804"],
    "nodesForAdd": ["1803"],
    "nodesForDelete": ["1804"]
}

A JSON object describing the tags to add or remove:

PropertyTypeRequiredDescription
addTags[]stringNo*List of tag names to add to the specified nodes.
deleteTags[]stringNo*List of tag names to remove from the specified nodes.
nodes[]stringNoList of AipIds. Used as fallback for both add and delete operations if specific node arrays are not provided.
nodesForAdd[]stringNoList of AipIds to add tags to. Takes priority over nodes for add operations.
nodesForDelete[]stringNoList of AipIds to remove tags from. Takes priority over nodes for delete operations.

* At least one of addTags or deleteTags must be provided along with corresponding nodes.

Usage Examples

Add tags to objects

{
    "addTags": ["critical", "reviewed"],
    "nodes": ["1803", "1804"]
}

Remove tags from objects

{
    "deleteTags": ["deprecated"],
    "nodes": ["1803", "1804"]
}

Add and remove tags in a single request (same objects)

{
    "addTags": ["newTag"],
    "deleteTags": ["oldTag"],
    "nodes": ["1803", "1804"]
}

Add and remove tags from different objects

{
    "addTags": ["tag1", "tag2"],
    "nodesForAdd": ["1803", "1804"],
    "deleteTags": ["tag3"],
    "nodesForDelete": ["1805", "1806"]
}

Responses

application/json

Success Response

When tags are added only:

{
    "success": true,
    "added": {
        "count": 2,
        "nodes": ["1803", "1804"]
    }
}

When tags are removed only:

{
    "success": true,
    "deleted": {
        "count": 2,
        "nodes": ["1803", "1804"]
    }
}

When both adding and removing tags:

{
    "success": true,
    "added": {
        "count": 2,
        "nodes": ["1803", "1804"]
    },
    "deleted": {
        "count": 1,
        "nodes": ["1805"]
    }
}

Error Response

{
    "code": 2,
    "message": "no matching nodes found for tagging",
    "status": 400
}

JSON representation

Response

PropertyTypeDescription
successbooleanIndicates whether the operation was successful.
addedstructureDetails about the add operation (if tags were added).
added.countintegerNumber of nodes that tags were added to.
added.nodes[]stringList of AipIds that tags were added to.
deletedstructureDetails about the delete operation (if tags were removed).
deleted.countintegerNumber of nodes that tags were removed from.
deleted.nodes[]stringList of AipIds that tags were removed from.