NetBox icon

NetBox

Consume NetBox API

Actions243

Site → List

AI-generated

Overview

This node interacts with the NetBox API to list sites within the DCIM domain. It allows users to retrieve a list of sites with optional filtering and pagination controls. This is useful for network administrators or IT professionals who want to programmatically access and manage site information stored in NetBox, such as retrieving all sites or filtering sites by attributes like name, status, region, or tenant.

Use Case Examples

  1. Retrieve all sites in the DCIM domain without any filters.
  2. List sites with a specific status, such as 'Active'.
  3. Limit the number of returned sites to a specified number for pagination purposes.
  4. Filter sites by region name or tenant ID to narrow down the results.

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 Boolean flag to determine whether to return all results or limit the number of results.
Limit Maximum number of results to return when 'Return All' is false.
Filters Collection of optional filters to narrow down the list of sites, such as site ID, name, slug, facility, status, region, site group, tenant, latitude, longitude, search term, and tag.

Output

JSON

  • id - Unique identifier of the site.
  • name - Name of the site.
  • slug - Slug identifier for the site.
  • facility - Facility code of the site.
  • status - Current status of the site.
  • region_id - Identifier of the region the site belongs to.
  • region - Name or slug of the region.
  • group_id - Identifier of the site group.
  • group - Name or slug of the site group.
  • tenant_id - Identifier of the tenant associated with the site.
  • tenant - Name or slug of the tenant.
  • latitude - Latitude coordinate of the site.
  • longitude - Longitude coordinate of the site.
  • tag - Tags associated with the site.

Dependencies

  • NetBox API
  • 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 may result in no data or errors. Verify the domain is set to 'dcim' and resource to 'sites' 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 'Limit' is set too low, the returned data may be incomplete. Adjust the limit or enable 'Return All' to retrieve all results.

Links

Discussion