NetBox icon

NetBox

Consume NetBox API

Actions243

Location → List

AI-generated

Overview

This node interacts with the NetBox API to list locations within the DCIM domain. It is useful for retrieving location data from a NetBox instance, which can be filtered and limited according to user-defined criteria. Common scenarios include inventory management, asset tracking, and infrastructure monitoring where location data is essential.

Use Case Examples

  1. Retrieve all locations in the DCIM domain to get a comprehensive list of physical or logical locations.
  2. Filter locations by site ID or name to narrow down the search to specific areas.
  3. Limit the number of returned locations to optimize performance and handle large datasets efficiently.

Properties

Name Meaning
Domain Specifies the domain of the NetBox API to interact with, here it is set to 'dcim' for data center infrastructure management.
Return All Determines whether to return all results or limit the number of results.
Limit Maximum number of location results to return when 'Return All' is false.
Filters Collection of filters to refine the list of locations returned, such as search query, site ID, name, slug, parent location ID, status, tenant ID, ID, ordering, and date filters.

Output

JSON

  • id - Unique identifier of the location.
  • name - Name of the location.
  • slug - Slug identifier for the location.
  • status - Current status of the location (e.g., active, planned).
  • site_id - Identifier of the site associated with the location.
  • parent_id - Identifier of the parent location, if any.
  • tenant_id - Identifier of the tenant associated with the location.
  • created - Timestamp when the location was created.
  • last_updated - Timestamp when the location was last updated.

Dependencies

  • NetBox API
  • An API key credential for authentication

Troubleshooting

  • Common issues include authentication failures due to invalid or missing API credentials. Ensure the API key credential is correctly configured.
  • Incorrect domain or resource selection can lead to no data being returned or errors. Verify that the domain is set to 'dcim' and the resource to 'locations' for this operation.
  • Filters must be correctly formatted; invalid filter values may cause the API to reject the request.
  • If 'Return All' is false and the limit is set too low, the returned data may be incomplete. Adjust the limit or enable 'Return All' as needed.
  • Error messages from the API will be logged; enabling 'Continue on Fail' allows the node to output errors as JSON instead of stopping execution.

Links

  • NetBox API Documentation - Official documentation for the NetBox API, useful for understanding available endpoints and parameters.

Discussion