NetBox icon

NetBox

Consume NetBox API

Actions243

Device Role → List

AI-generated

Overview

This node interacts with the NetBox API to list device roles within the DCIM domain. It is useful for retrieving information about different device roles configured in a NetBox instance, which can help in network management and inventory tasks. For example, a user can fetch all device roles or filter them by name, slug, color, VM role status, or tag to get specific subsets of device roles.

Use Case Examples

  1. Retrieve all device roles in the DCIM domain to display in a network management dashboard.
  2. Filter device roles by a specific color or tag to organize devices by role characteristics.

Properties

Name Meaning
Domain Specifies the domain of the NetBox API to interact with, here it is set to 'dcim' for device roles.
Return All Determines whether to return all device roles or limit the number of results.
Limit Maximum number of device roles to return when 'Return All' is false.
Filters Filters to narrow down the list of device roles based on name, slug, color, VM role status, or tag.

Output

JSON

  • id - Unique identifier of the device role.
  • name - Name of the device role.
  • slug - Slug identifier for the device role.
  • color - Color code associated with the device role.
  • vm_role - Boolean indicating if the device role is a VM role.
  • tag - Tags associated with 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 access the DCIM domain and device roles resource.
  • If the node returns an error, check the network connectivity to the NetBox API endpoint.
  • When using filters, ensure the filter values are valid and correctly formatted.
  • If 'Return All' is set to false and the limit is too low, you might not get all expected results; adjust the limit accordingly.

Links

Discussion