NetBox Labs vendor logo

Vendor

NetBox Labs

Product

NetBox

Category

Inventory

Project Type

Workflow Project


View Repository
Workflow

NetBox IP Address Management

Overview

Project with workflows for NetBox using REST protocol for managing IP Address and Prefix.

Workflows

NameOverview
Assign Next IP Address in Prefix - NetBox - RESTAssign next IP address in prefix in NetBox
Create Prefix - NetBox - RESTCreates prefix in NetBox
Delete IP Address - NetBox - RESTDelete IP address from NetBox
Delete Prefix - NetBox - RESTDeletes prefix from NetBox
Reserve IP Address - NetBox - RESTReserve IP address in NetBox

For further technical details on how to install and use this Workflow Project, please click the Technical Documentation tab.

Table of Contents

Getting Started

This section is helpful for deployments as it provides you with pertinent information on prerequisites and properties.

Helpful Background Information

Workflows often include logic that varies from business to business. As a result, we often find that our Workflow Projects are more useful as modular components that can be incorporated into a larger process. In addition, they often can add value as a learning tool on how we integrate with other systems and how we do things within the Itential Automation Platform.

While these can be utilized, you may find more value in using them as a starting point to build around.

Prerequisites

Itential Workflow Projects are built and tested on particular versions of IAP. In addition, Workflow Projects are often dependent on external systems and as such, these Workflow Projects will have dependencies on these other systems. This version of NetBox - REST has been tested with:

  • IAP 2023.2

External Dependencies

NameOS VersionAPI Version
NetBox3.6.3

Adapters

NameVersionConfiguration Notes
adapter-netbox_v332.0.0

How to Install

To install the Workflow Project:

  • Verify you are running a supported version of the Itential Automation Platform (IAP) as listed above in the Supported IAP Versions section in order to install the Example Project.
  • Import the Example Project in Admin Essentials.

Testing

Cypress is generally used to test all Itential Example Projects. While Cypress is an opensource tool, at Itential we have internal libraries that have been built around Cypress to allow us to test with a deployed IAP.

When certifying our Example Projects for a release of IAP we run these tests against the particular version of IAP and create a release branch in GitLab. If you do not see the Example Project available in your version of IAP please contact Itential.

While Itential tests this Example Project and its capabilities, it is often the case the customer environments offer their own unique circumstances. Therefore, it is our recommendation that you deploy this Example Project into a development/testing environment in which you can test the Example Project.

Using this Workflow Project

Workflow Projects contain 1 or more workflows. Each of these workflows have different inputs and outputs.

Assign Next IP Address in Prefix - NetBox - REST

Assign next IP address in prefix in NetBox

Capabilities include:

  • The workflow is used to assign next IP address in prefix in NetBox

Entry Point IAP Component

The primary IAP component to run Assign Next IP Address in Prefix - NetBox - REST is listed below:

IAP Component NameIAP Component Type
Assign Next IP Address in Prefix - NetBoxWorkflow

Inputs

The following table lists the inputs for Assign Next IP Address in Prefix - NetBox - REST:

NameTypeRequiredDescriptionExample Value
ipStatusstringyesStatus of IP address. Possible values include 'active', 'reserved', 'deprecated', 'dhcp', and 'slaac'
active
dnsNamestringnoThe DNS name of the IP address
example.com
prefixIdnumberyesThe prefix to get IP address from using prefix Id
104
adapterIdstringyesNetBox adapter instance to use for the workflow
NetBox_v3

Outputs

The following table lists the outputs for Assign Next IP Address in Prefix - NetBox - REST:

NameTypeDescriptionExample Value
assignedIPAddressobjectThe assigned IP address information
{
  "icode": "AD.201",
  "response": {
    "lastUpdated": "2023-10-13T16:02:33.109111Z",
    "dnsName": "foo.bar",
    "id": 300,
    "url": "https://demo.netbox.dev/api/ipam/ip-addresses/300/",
    "display": "10.112.151.2/24",
    "family": {
      "value": 4,
      "label": "IPv4"
    },
    "address": "10.112.151.2/24",
    "vrf": null,
    "tenant": null,
    "status": {
      "value": "active",
      "label": "Active"
    },
    "role": null,
    "assigned_object_id": null,
    "assigned_object": null,
    "nat_inside": null,
    "nat_outside": [],
    "description": "",
    "comments": "",
    "tags": [],
    "custom_fields": {},
    "created": "2023-10-13T16:02:33.109085Z"
  }
}
netboxErrorobjectThe error response object
{
  "icode": "AD.500",
  "IAPerror": {
    "origin": "NetBox_v3-connectorRest-handleEndResponse",
    "displayString": "Error 404 received on request",
    "recommendation": "Verify the request is accurate via debug logs and postman",
    "code": 404,
    "raw_response": {
      "status": "success",
      "code": 404,
      "response": {
        "detail": "Not found."
      },
      "redirects": 0,
      "tripTime": "172ms",
      "reqHdr": {
        "Content-Type": "application/json",
        "Accept": "application/json",
        "Authorization": "****"
      }
    }
  },
  "response": {
    "detail": "Not found."
  }
}

Query Output

The following items show how to query successful results from the output of Assign Next IP Address in Prefix - NetBox - REST:

IP Address ID

assignedIPAddress.response.id

IP Address

assignedIPAddress.response.address

The following items show how to query failure results from the output of Assign Next IP Address in Prefix - NetBox - REST:

Error Response Message

netboxError.response.detail

Example Inputs and Outputs

Example 1

Input:

{
  "ipStatus": "active",
  "dnsName": "example.com",
  "prefixId": 30,
  "adapterId": "NetBox_v3"
} 

Output:

{
  "assignedIPAddress": {
    "icode": "AD.201",
    "response": {
      "lastUpdated": "2023-10-13T16:02:33.109111Z",
      "dnsName": "example.com",
      "id": 300,
      "url": "https://demo.netbox.dev/api/ipam/ip-addresses/300/",
      "display": "10.112.151.2/24",
      "family": {
        "value": 4,
        "label": "IPv4"
      },
      "address": "10.112.151.2/24",
      "vrf": null,
      "tenant": null,
      "status": {
        "value": "active",
        "label": "Active"
      },
      "role": null,
      "assigned_object_id": null,
      "assigned_object": null,
      "nat_inside": null,
      "nat_outside": [],
      "description": "",
      "comments": "",
      "tags": [],
      "custom_fields": {},
      "created": "2023-10-13T16:02:33.109085Z"
    }
  }
} 
Example 2

Input:

{
  "ipStatus": "active",
  "dnsName": "foo.bar",
  "prefixId": 103,
  "adapterId": "NetBox_v3",
} 

Output:

{
  "netboxError": {
    "icode": "AD.500",
    "IAPerror": {
      "origin": "NetBox_v3-connectorRest-handleEndResponse",
      "displayString": "Error 404 received on request",
      "recommendation": "Verify the request is accurate via debug logs and postman",
      "code": 404,
      "raw_response": {
        "status": "success",
        "code": 404,
        "response": {
          "detail": "Not found."
        },
        "redirects": 0,
        "tripTime": "172ms",
        "reqHdr": {
          "Content-Type": "application/json",
          "Accept": "application/json",
          "Authorization": "****"
        }
      }
    },
    "response": {
      "detail": "Not found."
    }
  }
} 

API Links

No API Links provided.


Create Prefix - NetBox - REST

Creates prefix in NetBox

Capabilities include:

  • The workflow is used to create prefix in NetBox

Entry Point IAP Component

The primary IAP component to run Create Prefix - NetBox - REST is listed below:

IAP Component NameIAP Component Type
Create Prefix - NetBoxWorkflow

Inputs

The following table lists the inputs for Create Prefix - NetBox - REST:

NameTypeRequiredDescriptionExample Value
prefixstringyesThe prefix to create
10.0.0.0/24
prefixStatusstringyesThe status to assign the prefix on creation. Example values include 'active', 'container', 'reserved', and 'deprecated'.
active
prefixDescriptionstringnoThe description to associate with prefix created
Example prefix
adapterIdstringyesThe NetBox adapter instance to use in workflow
NetBox_v3

Outputs

The following table lists the outputs for Create Prefix - NetBox - REST:

NameTypeDescriptionExample Value
createdPrefixobjectThe created prefix information
{
  "icode": "AD.201",
  "response": {
    "lastUpdated": "2023-10-13T16:12:11.267722Z",
    "isPool": false,
    "markUtilized": false,
    "id": 103,
    "url": "https://demo.netbox.dev/api/ipam/prefixes/103/",
    "display": "10.0.0.0/24",
    "family": {
      "value": 4,
      "label": "IPv4"
    },
    "prefix": "10.0.0.0/24",
    "site": null,
    "vrf": null,
    "tenant": null,
    "vlan": null,
    "status": {
      "value": "active",
      "label": "Active"
    },
    "role": null,
    "description": "test",
    "comments": "",
    "tags": [],
    "custom_fields": {},
    "created": "2023-10-13T16:12:11.267697Z",
    "children": 0,
    "_depth": 0
  }
}
netboxErrorobjectError response if creating prefix fails
{
  "icode": "AD.500",
  "IAPerror": {
    "origin": "NetBox_v3-connectorRest-handleEndResponse",
    "displayString": "Error 500 received on request",
    "recommendation": "Verify the request is accurate via debug logs and postman",
    "code": 500,
    "raw_response": {
      "status": "success",
      "code": 500,
      "headers": {
        "server": "nginx/1.18.0 (Ubuntu)",
        "date": "Fri, 13 Oct 2023 19:28:10 GMT",
        "content-type": "application/json",
        "content-length": 99,
        "connection": "close",
        "x-request-id": "32fb4421-4306-4038-8001-282f77c8c468",
        "vary": "HX-Request, Cookie, origin",
        "api-version": 3.6,
        "x-content-type-options": "nosniff",
        "referrer-policy": "same-origin",
        "cross-origin-opener-policy": "same-origin",
        "x-frame-options": "SAMEORIGIN"
      },
      "response": {
        "error": "'data'",
        "exception": "KeyError",
        "netbox_version": "3.6.3",
        "python_version": "3.8.10"
      },
      "redirects": 0,
      "tripTime": "176ms",
      "reqHdr": {
        "Content-Type": "application/json",
        "Accept": "application/json",
        "Content-length": 66,
        "Authorization": "****"
      }
    }
  },
  "response": {
    "error": "'data'",
    "exception": "KeyError",
    "netbox_version": "3.6.3",
    "python_version": "3.8.10"
  }
}

Query Output

The following items show how to query successful results from the output of Create Prefix - NetBox - REST:

Created Prefix ID

createdPrefix.response.id

The following items show how to query failure results from the output of Create Prefix - NetBox - REST:

Error Exception Type

netboxError.response.exception

Example Inputs and Outputs

Example 1

Input:

{
  "prefix": "10.0.0.0/24",
  "prefixStatus": "active",
  "prefixDescription": "test",
  "adapterId": "NetBox_v3"
} 

Output:

{
  "createdPrefix": {
    "icode": "AD.201",
    "response": {
      "lastUpdated": "2023-10-13T16:12:11.267722Z",
      "isPool": false,
      "markUtilized": false,
      "id": 103,
      "url": "https://demo.netbox.dev/api/ipam/prefixes/103/",
      "display": "10.0.0.0/24",
      "family": {
        "value": 4,
        "label": "IPv4"
      },
      "prefix": "10.0.0.0/24",
      "site": null,
      "vrf": null,
      "tenant": null,
      "vlan": null,
      "status": {
        "value": "active",
        "label": "Active"
      },
      "role": null,
      "description": "test",
      "comments": "",
      "tags": [],
      "custom_fields": {},
      "created": "2023-10-13T16:12:11.267697Z",
      "children": 0,
      "_depth": 0
    }
  }
} 
Example 2

Input:

{
  "prefix": "10.1234.0.0/24",
  "prefixStatus": "active",
  "prefixDescription": "test",
  "adapterId": "NetBox_v3",
} 

Output:

{
  "createdPrefix": null,
  "netboxError": {
    "icode": "AD.500",
    "IAPerror": {
      "origin": "NetBox_v3-connectorRest-handleEndResponse",
      "displayString": "Error 500 received on request",
      "recommendation": "Verify the request is accurate via debug logs and postman",
      "code": 500,
      "raw_response": {
        "status": "success",
        "code": 500,
        "headers": {
          "server": "nginx/1.18.0 (Ubuntu)",
          "date": "Fri, 13 Oct 2023 19:28:10 GMT",
          "content-type": "application/json",
          "content-length": 99,
          "connection": "close",
          "x-request-id": "32fb4421-4306-4038-8001-282f77c8c468",
          "vary": "HX-Request, Cookie, origin",
          "api-version": 3.6,
          "x-content-type-options": "nosniff",
          "referrer-policy": "same-origin",
          "cross-origin-opener-policy": "same-origin",
          "x-frame-options": "SAMEORIGIN"
        },
        "response": {
          "error": "'data'",
          "exception": "KeyError",
          "netbox_version": "3.6.3",
          "python_version": "3.8.10"
        },
        "redirects": 0,
        "tripTime": "176ms",
        "reqHdr": {
          "Content-Type": "application/json",
          "Accept": "application/json",
          "Content-length": 66,
          "Authorization": "****"
        }
      }
    },
    "response": {
      "error": "'data'",
      "exception": "KeyError",
      "netbox_version": "3.6.3",
      "python_version": "3.8.10"
    }
  }
} 

API Links

No API Links provided.


Delete IP Address - NetBox - REST

Delete IP address from NetBox

Capabilities include:

  • The workflow is used to delete IP address from NetBox

Entry Point IAP Component

The primary IAP component to run Delete IP Address - NetBox - REST is listed below:

IAP Component NameIAP Component Type
Delete IP Address - NetBoxWorkflow

Inputs

The following table lists the inputs for Delete IP Address - NetBox - REST:

NameTypeRequiredDescriptionExample Value
ipAddressstringyesThe IP address to delete
10.112.151.2/24
adapterIdstringyesThe name of the NetBox adapter instance to use for this workflow
NetBox_v3

Outputs

The following table lists the outputs for Delete IP Address - NetBox - REST:

NameTypeDescriptionExample Value
ipAddressSearchResultobjectResult of searching for IP address to delete
{
  "icode": "AD.200",
  "response": {
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
      {
        "id": 302,
        "url": "https://demo.netbox.dev/api/ipam/ip-addresses/302/",
        "display": "10.112.151.2/24",
        "family": {
          "value": 4,
          "label": "IPv4"
        },
        "address": "10.112.151.2/24",
        "vrf": null,
        "tenant": null,
        "status": {
          "value": "active",
          "label": "Active"
        },
        "role": null,
        "assigned_object_type": null,
        "assigned_object_id": null,
        "assigned_object": null,
        "nat_inside": null,
        "nat_outside": [],
        "dns_name": "foo.bar",
        "description": "",
        "comments": "",
        "tags": [],
        "custom_fields": {},
        "created": "2023-10-13T16:56:46.527518Z",
        "last_updated": "2023-10-13T16:56:46.527555Z"
      }
    ]
  }
}
deleteIPAddressResultobjectResult of deleting the IP address
{
  "icode": "AD.204",
  "response": "success"
}

Query Output

The following items show how to query successful results from the output of Delete IP Address - NetBox - REST:

Number of Found IP Addresses

ipAddressSearchResult.response.count

IP Address Deletion Result

deleteIPAddressResult.response

Example Inputs and Outputs

Example 1

Input:

{
  "ipAddress": "10.112.151.2/24",
  "adapterId": "NetBox_v3"
} 

Output:

{
  "ipAddressSearchResult": {
    "icode": "AD.200",
    "response": {
      "count": 1,
      "next": null,
      "previous": null,
      "results": [
        {
          "id": 302,
          "url": "https://demo.netbox.dev/api/ipam/ip-addresses/302/",
          "display": "10.112.151.2/24",
          "family": {
            "value": 4,
            "label": "IPv4"
          },
          "address": "10.112.151.2/24",
          "vrf": null,
          "tenant": null,
          "status": {
            "value": "active",
            "label": "Active"
          },
          "role": null,
          "assigned_object_type": null,
          "assigned_object_id": null,
          "assigned_object": null,
          "nat_inside": null,
          "nat_outside": [],
          "dns_name": "foo.bar",
          "description": "",
          "comments": "",
          "tags": [],
          "custom_fields": {},
          "created": "2023-10-13T16:56:46.527518Z",
          "last_updated": "2023-10-13T16:56:46.527555Z"
        }
      ]
    }
  },
  "deleteIPAddressResult": {
    "icode": "AD.204",
    "response": "success"
  }
} 
Example 2

Input:

{
  "ipAddress": "10.111.121.0/24",
  "adapterId": "NetBox_v3"
} 

Output:

{
  "ipAddressSearchResult": {
    "icode": "AD.200",
    "response": {
      "count": 0,
      "next": null,
      "previous": null,
      "results": []
    }
  }
} 

API Links

No API Links provided.


Delete Prefix - NetBox - REST

Deletes prefix from NetBox

Capabilities include:

  • The workflow is used delete prefix from NetBox
  • Provides option to delete or keep IP addresses associated with prefix to delete

Entry Point IAP Component

The primary IAP component to run Delete Prefix - NetBox - REST is listed below:

IAP Component NameIAP Component Type
Delete Prefix - NetBoxWorkflow

Inputs

The following table lists the inputs for Delete Prefix - NetBox - REST:

NameTypeRequiredDescriptionExample Value
prefixIdnumberyesThe prefix ID to use to delete prefix
108
adapterIdstringyesThe name of the NetBox adapter instance to use for this workflow
NetBox_v3

Outputs

The following table lists the outputs for Delete Prefix - NetBox - REST:

NameTypeDescriptionExample Value
prefixSearchResultobjectResult of searching for the prefix using its ID
{
  "icode": "AD.200",
  "response": {
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
      {
        "id": 108,
        "url": "https://demo.netbox.dev/api/ipam/prefixes/108/",
        "display": "10.0.0.0/24",
        "family": {
          "value": 4,
          "label": "IPv4"
        },
        "prefix": "10.0.0.0/24",
        "site": null,
        "vrf": null,
        "tenant": null,
        "vlan": null,
        "status": {
          "value": "active",
          "label": "Active"
        },
        "role": null,
        "is_pool": false,
        "mark_utilized": false,
        "description": "",
        "comments": "",
        "tags": [],
        "custom_fields": {},
        "created": "2023-10-13T18:35:29.241712Z",
        "last_updated": "2023-10-13T18:35:29.241741Z",
        "children": 0,
        "_depth": 0
      }
    ]
  }
}
prefixIPAddressesobjectThe IP addresses found associated with the prefix
{
  "icode": "AD.200",
  "response": {
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
      {
        "id": 307,
        "url": "https://demo.netbox.dev/api/ipam/ip-addresses/307/",
        "display": "10.0.0.1/24",
        "family": {
          "value": 4,
          "label": "IPv4"
        },
        "address": "10.0.0.1/24",
        "vrf": null,
        "tenant": null,
        "status": {
          "value": "active",
          "label": "Active"
        },
        "role": null,
        "assigned_object_type": null,
        "assigned_object_id": null,
        "assigned_object": null,
        "nat_inside": null,
        "nat_outside": [],
        "dns_name": "",
        "description": "",
        "comments": "",
        "tags": [],
        "custom_fields": {},
        "created": "2023-10-13T18:35:36.024002Z",
        "last_updated": "2023-10-13T18:35:36.024029Z"
      },
      {
        "id": 308,
        "url": "https://demo.netbox.dev/api/ipam/ip-addresses/308/",
        "display": "10.0.0.2/24",
        "family": {
          "value": 4,
          "label": "IPv4"
        },
        "address": "10.0.0.2/24",
        "vrf": null,
        "tenant": null,
        "status": {
          "value": "active",
          "label": "Active"
        },
        "role": null,
        "assigned_object_type": null,
        "assigned_object_id": null,
        "assigned_object": null,
        "nat_inside": null,
        "nat_outside": [],
        "dns_name": "",
        "description": "",
        "comments": "",
        "tags": [],
        "custom_fields": {},
        "created": "2023-10-13T18:35:48.247864Z",
        "last_updated": "2023-10-13T18:35:48.247905Z"
      }
    ]
  }
}
deleteIPAddressResultobjectThe result of deleting the IP addresses associated with the prefix
[
  {
    "status": "complete",
    "ipAddress": "10.0.0.1/24",
    "adapterId": "NetBox_v3",
    "childJobLoopIndex": 0,
    "_id": "fb1bd4f8e49a48e18494ae1b",
    "initiator": "admin@pronghorn",
    "ipAddressSearchResult": {
      "icode": "AD.200",
      "response": {
        "count": 1,
        "next": null,
        "previous": null,
        "results": [
          {
            "id": 307,
            "url": "https://demo.netbox.dev/api/ipam/ip-addresses/307/",
            "display": "10.0.0.1/24",
            "family": {
              "value": 4,
              "label": "IPv4"
            },
            "address": "10.0.0.1/24",
            "vrf": null,
            "tenant": null,
            "status": {
              "value": "active",
              "label": "Active"
            },
            "role": null,
            "assigned_object_type": null,
            "assigned_object_id": null,
            "assigned_object": null,
            "nat_inside": null,
            "nat_outside": [],
            "dns_name": "",
            "description": "",
            "comments": "",
            "tags": [],
            "custom_fields": {},
            "created": "2023-10-13T18:35:36.024002Z",
            "last_updated": "2023-10-13T18:35:36.024029Z"
          }
        ]
      }
    },
    "deleteIPAddressResult": {
      "icode": "AD.204",
      "response": "success"
    }
  },
  {
    "status": "complete",
    "ipAddress": "10.0.0.2/24",
    "adapterId": "NetBox_v3",
    "childJobLoopIndex": 1,
    "_id": "866154625a06451dba45cae0",
    "initiator": "admin@pronghorn",
    "ipAddressSearchResult": {
      "icode": "AD.200",
      "response": {
        "count": 1,
        "next": null,
        "previous": null,
        "results": [
          {
            "id": 308,
            "url": "https://demo.netbox.dev/api/ipam/ip-addresses/308/",
            "display": "10.0.0.2/24",
            "family": {
              "value": 4,
              "label": "IPv4"
            },
            "address": "10.0.0.2/24",
            "vrf": null,
            "tenant": null,
            "status": {
              "value": "active",
              "label": "Active"
            },
            "role": null,
            "assigned_object_type": null,
            "assigned_object_id": null,
            "assigned_object": null,
            "nat_inside": null,
            "nat_outside": [],
            "dns_name": "",
            "description": "",
            "comments": "",
            "tags": [],
            "custom_fields": {},
            "created": "2023-10-13T18:35:48.247864Z",
            "last_updated": "2023-10-13T18:35:48.247905Z"
          }
        ]
      }
    },
    "deleteIPAddressResult": {
      "icode": "AD.204",
      "response": "success"
    }
  }
]
deletePrefixResultobjectThe result of deleting the prefix
{
  "icode": "AD.204",
  "response": "success"
}

Query Output

The following items show how to query successful results from the output of Delete Prefix - NetBox - REST:

Prefix Deletion Result

deletePrefixResult.response

Number of Prefix Found

prefixSearchResult.response.count

Example Inputs and Outputs

Example 1

Input:

{
  "prefixId": 108,
  "adapterId": "NetBox_v3"
} 

Output:

{
  "prefixSearchResult": {
    "icode": "AD.200",
    "response": {
      "count": 1,
      "next": null,
      "previous": null,
      "results": [
        {
          "id": 108,
          "url": "https://demo.netbox.dev/api/ipam/prefixes/108/",
          "display": "10.0.0.0/24",
          "family": {
            "value": 4,
            "label": "IPv4"
          },
          "prefix": "10.0.0.0/24",
          "site": null,
          "vrf": null,
          "tenant": null,
          "vlan": null,
          "status": {
            "value": "active",
            "label": "Active"
          },
          "role": null,
          "is_pool": false,
          "mark_utilized": false,
          "description": "",
          "comments": "",
          "tags": [],
          "custom_fields": {},
          "created": "2023-10-13T18:35:29.241712Z",
          "last_updated": "2023-10-13T18:35:29.241741Z",
          "children": 0,
          "_depth": 0
        }
      ]
    }
  },
  "prefixIPAddresses": {
    "icode": "AD.200",
    "response": {
      "count": 2,
      "next": null,
      "previous": null,
      "results": [
        {
          "id": 307,
          "url": "https://demo.netbox.dev/api/ipam/ip-addresses/307/",
          "display": "10.0.0.1/24",
          "family": {
            "value": 4,
            "label": "IPv4"
          },
          "address": "10.0.0.1/24",
          "vrf": null,
          "tenant": null,
          "status": {
            "value": "active",
            "label": "Active"
          },
          "role": null,
          "assigned_object_type": null,
          "assigned_object_id": null,
          "assigned_object": null,
          "nat_inside": null,
          "nat_outside": [],
          "dns_name": "",
          "description": "",
          "comments": "",
          "tags": [],
          "custom_fields": {},
          "created": "2023-10-13T18:35:36.024002Z",
          "last_updated": "2023-10-13T18:35:36.024029Z"
        },
        {
          "id": 308,
          "url": "https://demo.netbox.dev/api/ipam/ip-addresses/308/",
          "display": "10.0.0.2/24",
          "family": {
            "value": 4,
            "label": "IPv4"
          },
          "address": "10.0.0.2/24",
          "vrf": null,
          "tenant": null,
          "status": {
            "value": "active",
            "label": "Active"
          },
          "role": null,
          "assigned_object_type": null,
          "assigned_object_id": null,
          "assigned_object": null,
          "nat_inside": null,
          "nat_outside": [],
          "dns_name": "",
          "description": "",
          "comments": "",
          "tags": [],
          "custom_fields": {},
          "created": "2023-10-13T18:35:48.247864Z",
          "last_updated": "2023-10-13T18:35:48.247905Z"
        }
      ]
    }
  },
  "deleteIPAddressResult": [
    {
      "status": "complete",
      "ipAddress": "10.0.0.1/24",
      "adapterId": "NetBox_v3",
      "childJobLoopIndex": 0,
      "_id": "fb1bd4f8e49a48e18494ae1b",
      "initiator": "admin@pronghorn",
      "ipAddressSearchResult": {
        "icode": "AD.200",
        "response": {
          "count": 1,
          "next": null,
          "previous": null,
          "results": [
            {
              "id": 307,
              "url": "https://demo.netbox.dev/api/ipam/ip-addresses/307/",
              "display": "10.0.0.1/24",
              "family": {
                "value": 4,
                "label": "IPv4"
              },
              "address": "10.0.0.1/24",
              "vrf": null,
              "tenant": null,
              "status": {
                "value": "active",
                "label": "Active"
              },
              "role": null,
              "assigned_object_type": null,
              "assigned_object_id": null,
              "assigned_object": null,
              "nat_inside": null,
              "nat_outside": [],
              "dns_name": "",
              "description": "",
              "comments": "",
              "tags": [],
              "custom_fields": {},
              "created": "2023-10-13T18:35:36.024002Z",
              "last_updated": "2023-10-13T18:35:36.024029Z"
            }
          ]
        }
      },
      "deleteIPAddressResult": {
        "icode": "AD.204",
        "response": "success"
      }
    },
    {
      "status": "complete",
      "ipAddress": "10.0.0.2/24",
      "adapterId": "NetBox_v3",
      "childJobLoopIndex": 1,
      "_id": "866154625a06451dba45cae0",
      "initiator": "admin@pronghorn",
      "ipAddressSearchResult": {
        "icode": "AD.200",
        "response": {
          "count": 1,
          "next": null,
          "previous": null,
          "results": [
            {
              "id": 308,
              "url": "https://demo.netbox.dev/api/ipam/ip-addresses/308/",
              "display": "10.0.0.2/24",
              "family": {
                "value": 4,
                "label": "IPv4"
              },
              "address": "10.0.0.2/24",
              "vrf": null,
              "tenant": null,
              "status": {
                "value": "active",
                "label": "Active"
              },
              "role": null,
              "assigned_object_type": null,
              "assigned_object_id": null,
              "assigned_object": null,
              "nat_inside": null,
              "nat_outside": [],
              "dns_name": "",
              "description": "",
              "comments": "",
              "tags": [],
              "custom_fields": {},
              "created": "2023-10-13T18:35:48.247864Z",
              "last_updated": "2023-10-13T18:35:48.247905Z"
            }
          ]
        }
      },
      "deleteIPAddressResult": {
        "icode": "AD.204",
        "response": "success"
      }
    }
  ],
  "deletePrefixResult": {
    "icode": "AD.204",
    "response": "success"
  }
} 
Example 2

Input:

{
  "prefixId": 109,
  "adapterId": "NetBox_v3"
} 

Output:

{
  "prefixSearchResult": {
    "icode": "AD.200",
    "response": {
      "count": 1,
      "next": null,
      "previous": null,
      "results": [
        {
          "id": 109,
          "url": "https://demo.netbox.dev/api/ipam/prefixes/109/",
          "display": "10.0.0.0/24",
          "family": {
            "value": 4,
            "label": "IPv4"
          },
          "prefix": "10.0.0.0/24",
          "site": null,
          "vrf": null,
          "tenant": null,
          "vlan": null,
          "status": {
            "value": "active",
            "label": "Active"
          },
          "role": null,
          "is_pool": false,
          "mark_utilized": false,
          "description": "",
          "comments": "",
          "tags": [],
          "custom_fields": {},
          "created": "2023-10-13T18:40:27.715812Z",
          "last_updated": "2023-10-13T18:40:27.715839Z",
          "children": 0,
          "_depth": 0
        }
      ]
    }
  },
  "prefixIPAddresses": {
    "icode": "AD.200",
    "response": {
      "count": 1,
      "next": null,
      "previous": null,
      "results": [
        {
          "id": 309,
          "url": "https://demo.netbox.dev/api/ipam/ip-addresses/309/",
          "display": "10.0.0.1/24",
          "family": {
            "value": 4,
            "label": "IPv4"
          },
          "address": "10.0.0.1/24",
          "vrf": null,
          "tenant": null,
          "status": {
            "value": "active",
            "label": "Active"
          },
          "role": null,
          "assigned_object_type": null,
          "assigned_object_id": null,
          "assigned_object": null,
          "nat_inside": null,
          "nat_outside": [],
          "dns_name": "",
          "description": "",
          "comments": "",
          "tags": [],
          "custom_fields": {},
          "created": "2023-10-13T18:40:37.383859Z",
          "last_updated": "2023-10-13T18:40:37.383901Z"
        }
      ]
    }
  },
  "deletePrefixResult": {
    "icode": "AD.204",
    "response": "success"
  }
} 
Example 3

Input:

{
  "prefixId": 109,
  "adapterId": "NetBox_v3"
} 

Output:

{
  "prefixSearchResult": {
    "icode": "AD.200",
    "response": {
      "count": 0,
      "next": null,
      "previous": null,
      "results": []
    }
  }
} 

API Links

No API Links provided.


Reserve IP Address - NetBox - REST

Reserve IP address in NetBox

Capabilities include:

  • The workflow is used to reserve IP address in NetBox

Entry Point IAP Component

The primary IAP component to run Reserve IP Address - NetBox - REST is listed below:

IAP Component NameIAP Component Type
Reserve IP Address - NetBoxWorkflow

Inputs

The following table lists the inputs for Reserve IP Address - NetBox - REST:

NameTypeRequiredDescriptionExample Value
ipAddressstringyesThe IP address to reserve
192.168.1.0/24
descriptionstringyesDescription of the IP address
IP address description
adapterIdstringyesThe NetBox adapter instance to use in workflow
NetBox_v3

Outputs

The following table lists the outputs for Reserve IP Address - NetBox - REST:

NameTypeDescriptionExample Value
reserveIPAddressResultobjectInformation related to the IP address reserved
{
  "icode": "AD.201",
  "response": {
    "lastUpdated": "2023-10-13T18:51:35.813505Z",
    "id": 310,
    "url": "https://demo.netbox.dev/api/ipam/ip-addresses/310/",
    "display": "192.168.1.0/24",
    "family": {
      "value": 4,
      "label": "IPv4"
    },
    "address": "192.168.1.0/24",
    "vrf": null,
    "tenant": null,
    "status": {
      "value": "active",
      "label": "Active"
    },
    "role": null,
    "assigned_object_id": null,
    "assigned_object": null,
    "nat_inside": null,
    "nat_outside": [],
    "description": "test",
    "comments": "",
    "tags": [],
    "custom_fields": {},
    "created": "2023-10-13T18:51:35.813477Z"
  }
}

Query Output

The following items show how to query successful results from the output of Reserve IP Address - NetBox - REST:

IP Address ID

reserveIPAddressResult.response.id

Example Inputs and Outputs

Example 1

Input:

{
  "ipAddress": "192.168.1.0/24",
  "description": "IP address description",
  "adapterId": "NetBox_v3"
} 

Output:

{
  "reserveIPAddressResult": {
    "icode": "AD.201",
    "response": {
      "lastUpdated": "2023-10-13T18:51:35.813505Z",
      "id": 310,
      "url": "https://demo.netbox.dev/api/ipam/ip-addresses/310/",
      "display": "192.168.1.0/24",
      "family": {
        "value": 4,
        "label": "IPv4"
      },
      "address": "192.168.1.0/24",
      "vrf": null,
      "tenant": null,
      "status": {
        "value": "active",
        "label": "Active"
      },
      "role": null,
      "assigned_object_id": null,
      "assigned_object": null,
      "nat_inside": null,
      "nat_outside": [],
      "description": "IP address description",
      "comments": "",
      "tags": [],
      "custom_fields": {},
      "created": "2023-10-13T18:51:35.813477Z"
    }
  }
} 

API Links

No API Links provided.


Additional Information

Support

Please use your Itential Customer Success account if you need support when using this Workflow Project.