Pcornel
Automation · IPAM Automation

API Integration

Cheat sheet · https://pcornel.dk/topic.php?topic=5869

Back to the Topic

Answer

IPAM API integration lets provisioning tools request the next free address, reserve it and record the owner through the IPAM's REST API, such as NetBox's available-ips endpoint, in the same run that builds the system.

Remember

  • Request and reserve in one call.
  • Record owner and description.
  • Handle API errors and retries.

First checks

  • curl -s -H 'Authorization: Token <t>' https://<netbox>/api/status/ — API status
  • python3 -c 'import pynetbox' — SDK
  • API token permissions — least privilege

Verify in this order

automation → IPAM API → data

Where it usually breaks

Client payload/auth → HTTP transport → endpoint validation/policy → request accepted → queued/job execution → target mutation → effective state → consumer workload.

IPAM Automation → API Integration · operational reference

LayerIPAM Automation → API Integration operational reference
Runtime/ownershipIPAM API integration / NetBox REST patterns · identify controller/parser, durable intent, identity and target ownership before mutation
Persistent intentVersioned definition/configuration with explicit dependencies, scope and credential boundary
VerificationGET the exact prefix/IP object by stable ID or scoped filters, perform a bounded create/update, then GET the returned object and validate uniqueness/status/tenant/VRF fields.
Expected interpretationThe integration uses the intended IPAM endpoint and scope, resolves one authoritative object, handles pagination/conflicts, and confirms the post-write allocation state from the API.
Recovery boundaryPreserve correlation IDs + pre-state, repair first failing boundary, then verify the target independently

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5869

Confirmation

Confirm action

Continue?