Actions243
- Cable Actions
- Cable Termination Actions
- Connected Device Actions
- Console Port Actions
- Console Port Template Actions
- Console Server Port Actions
- Console Server Port Template Actions
- Device Actions
- Device Bay Actions
- Device Bay Template Actions
- Device Role Actions
- Device Type Actions
- Front Port Actions
- Front Port Template Actions
- Interface Actions
- Interface Template Actions
- Inventory Item Actions
- Inventory Item Role Actions
- Inventory Item Template Actions
- Location Actions
- MAC Address Actions
- Manufacturer Actions
- Module Actions
- Module Bay Actions
- Module Bay Template Actions
- Module Type Actions
- Module Type Profile Actions
- Platform Actions
- Power Feed Actions
- Power Outlet Actions
- Power Outlet Template Actions
- Power Panel Actions
- Power Port Actions
- Power Port Template Actions
- Rack Actions
- Rack Reservation Actions
- Rack Role Actions
- Rack Type Actions
- Rear Port Actions
- Rear Port Template Actions
- Region Actions
- Site Actions
- Site Group Actions
- Virtual Chassis Actions
- Virtual Device Context Actions
- Virtual Link Actions
Device Role → Create
AI-generatedOverview
This node interacts with the NetBox API to create a new Device Role within the DCIM domain. It is useful for network administrators or IT professionals who want to automate the management of device roles in their network infrastructure. For example, it can be used to programmatically add new device roles with specific attributes such as name, color, description, and tags, streamlining the process of organizing and categorizing devices in NetBox.
Use Case Examples
- Creating a new device role named 'Core Router' with a red color code and a description for network documentation.
- Adding a device role for virtual machines with specific tags for easier filtering and management.
Properties
| Name | Meaning |
|---|---|
| Domain | Specifies the domain of the NetBox API to interact with, here it is set to 'dcim' for device roles. |
| Name | The name of the device role to be created. |
| Additional Fields | Optional additional attributes for the device role such as slug, color, VM role flag, description, tags, and custom fields. |
Output
JSON
id- Unique identifier of the created device role.name- Name of the created device role.slug- URL-friendly slug of the device role.color- Color code associated with the device role.vm_role- Indicates if the role applies to virtual machines.description- Description of the device role.tags- Tags associated with the device role.custom_fields- Custom fields data for the device role.
Dependencies
- NetBox API
- An API key credential for authentication
Troubleshooting
- Ensure the API key credential is correctly configured and has permissions to create device roles in NetBox.
- Verify that the 'domain' is set to 'dcim' and the 'resource' is 'deviceRoles' for this operation.
- Check that the 'Name' property is provided if required by the NetBox API to avoid validation errors.
- If the node throws an error, enabling 'Continue on Fail' will output the error message as JSON instead of stopping execution.
Links
- NetBox Device Roles API Documentation - Official documentation for managing device roles via the NetBox API.