NetBox icon

NetBox

Consume NetBox API

Actions243

Device → Assign Tag

AI-generated

Overview

This node interacts with the NetBox API to assign or remove tags on a specific device within the DCIM domain. It is useful for managing device metadata by adding or removing tags to organize or categorize devices programmatically. For example, you can add a 'critical' tag to a device to mark it as important or remove a 'deprecated' tag when a device is updated.

Use Case Examples

  1. Add a tag named 'production' to a device with a given device ID to mark it as part of the production environment.
  2. Remove a tag by its ID from a device to update its categorization.

Properties

Name Meaning
Domain Specifies the domain of the NetBox API to interact with, e.g., DCIM.
Device ID The unique identifier of the device to which the tag will be assigned or removed.
Tag Name or ID The identifier or name of the tag to assign or remove from the device.
Action Specifies whether to add or remove the tag from the device.

Output

JSON

  • json - The JSON response from the NetBox API after assigning or removing the tag, typically including the updated device information or confirmation of the action.

Dependencies

  • NetBox API with appropriate credentials

Troubleshooting

  • Ensure the device ID and tag ID or name are correct and exist in the NetBox instance.
  • Verify that the API credentials have sufficient permissions to modify device tags.
  • Common errors include authentication failures, resource not found errors if the device or tag does not exist, and validation errors if the tag assignment is invalid.

Discussion