Adding tags to devices etc. via API #1758

Closed
opened 2025-12-29 16:35:02 +01:00 by adam · 2 comments
Owner

Originally created by @seismiccollision on GitHub (May 30, 2018).

Issue type

[x] Documentation

Environment

  • Python version: 3.4.3
  • NetBox version: 2.4-dev

Description

I'm really looking forward to getting tags working but I'm not figuring out how to assign tags to items using the API. I am able to create tags fine but everything I've thought to try results in "name 'Tag' is not defined"

Originally created by @seismiccollision on GitHub (May 30, 2018). ### Issue type [x] Documentation <!-- Please describe the environment in which you are running NetBox. (Be sure to verify that you are running the latest stable release of NetBox before submitting a bug report.) If you are submitting a bug report and have made any changes to the code base, please first validate that your bug can be recreated while running an official release. --> ### Environment * Python version: 3.4.3 * NetBox version: 2.4-dev <!-- BUG REPORTS must include: * A list of the steps needed for someone else to reproduce the bug * A description of the expected and observed behavior * Any relevant error messages (screenshots may also help) FEATURE REQUESTS must include: * A detailed description of the proposed functionality * A use case for the new feature * A rough description of any necessary changes to the database schema * Any relevant third-party libraries which would be needed --> ### Description I'm really looking forward to getting tags working but I'm not figuring out how to assign tags to items using the API. I am able to create tags fine but everything I've thought to try results in "name 'Tag' is not defined"
adam closed this issue 2025-12-29 16:35:02 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 30, 2018):

Thank you for your interest in NetBox. GitHub issues are intended for reporting reproducible bugs and requesting features, and must be submitted using the template provided here. For general discussion, questions, or assistance with installation issues, please post to our mailing list.

@jeremystretch commented on GitHub (May 30, 2018): Thank you for your interest in NetBox. GitHub issues are intended for reporting reproducible bugs and requesting features, and must be submitted using the template provided [here](https://raw.githubusercontent.com/digitalocean/netbox/develop/.github/ISSUE_TEMPLATE.md). For general discussion, questions, or assistance with installation issues, please post to our [mailing list](https://groups.google.com/forum/#!forum/netbox-discuss).
Author
Owner

@seismiccollision commented on GitHub (May 31, 2018):

Fair enough, just wanted to make sure what I'm attempting should be possible because when I issue a PATCH against a host like:
URL: https://netboxhost.local/api/dcim/devices/5/
Body: {"tags": ["test-tag"]}

I get the error:

                                <class 'NameError'>
                                
name 'Tag' is not defined

Thanks for all you do!

@seismiccollision commented on GitHub (May 31, 2018): Fair enough, just wanted to make sure what I'm attempting should be possible because when I issue a PATCH against a host like: URL: https://netboxhost.local/api/dcim/devices/5/ Body: {"tags": ["test-tag"]} I get the error: > <pre> > <strong>&lt;class &#39;NameError&#39;&gt;</strong> > <br /> > name &#39;Tag&#39; is not defined > </pre> Thanks for all you do!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1758