netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
15.93k stars 2.56k forks source link

ARIN REST API SWIP Support #1044

Closed bellwood closed 4 years ago

bellwood commented 7 years ago

Pursuant to @jeremystretch's closing comment on #126 I'd like to request REST API interaction with ARIN to make SWIP changes to addresses/subnets/aggregates.

This would allow A LOT of 6connect/provision folks to come on board who are sticking around purely for that functionality (I know we are)

Doing this could lay the base framework for other potential interactions with the API (delegating networks, etc) however SWIP alone would be a fantastic feature.

Thanks =)

jeremystretch commented 7 years ago

@bellwood Could you please describe the proposed data model, views, and/or API endpoints?

bellwood commented 7 years ago

Sure thing!

Summary:

Reg-RWS: Registration RESTful Web Service (Reg-RWS) provides a secure and efficient method for interacting with ARIN's database. Reg-RWS is most handy for repetitive, mundane tasks done in high volume with no needed human communication, such as SWIP. In addition to being more secure than email templates, Reg-RWS allows for the retrieval of information about a record immediately before submitting changes to it. Reg-RWS also returns a predictable response that can be interpreted and reacted to by automation software. Organizations and people who spend a great deal of time sending new customer reallocation/reassignment data to ARIN's database will find significant value in a system built to help automate these transactions.

Details: https://www.arin.net/resources/restful-interfaces.html#using

...the "Methods and Payloads" sections outlines how it all works.

bellwood commented 7 years ago

To model it it out, I'd want some input. What would work for an org with a couple normalized swips (pre-defined) wouldn't work for an org with potentially hundreds or thousands (web hosting company)

It might be better to offer both - have the ability to predefine a few pre-set swips but also allow open input if you needed something beyond pre-defined - with the option to save it as a predefined at the time of input.

bellwood commented 7 years ago

One additional feature for this that may be nice as well is request a Reg-RWS report:

https://www.arin.net/resources/restful-interfaces.html#reports

Reg-RWS can also be used to request a number of reports available through ARIN Online. Reassignments and Associations reports are available to all registered ARIN Online users.

https://www.arin.net/resources/restfulmethods.html#requestreassignmentreport

Request Reassignment Report A Reassignment Report lists all sub-delegations for the requested NETHANDLE, as registered in ARIN's Whois directory service via SWIP. ARIN provides Reassignment Reports for IPv4 networks that are a Direct Allocations or Reallocations. This call will allow you to request a Reassignments Report for the specified NETHANDLE.If successful, a TicketPayload will be returned. You can then use calls specified within the Ticket Service above to check the status of the ticket and get the attached report. Depending on system usage, the time needed to produce the report may vary.ARIN provides Reassignment Reports for IPv4 networks that are a Direct Allocations or Reallocations. An attempt to request a report for any other type of network will result in an HTTP 400 (bad request) response.

THAT being said, making SWIP insertions would be more advantageous as requesting reports is pretty trivial but I figure it's worth mentioning as it may broaden the concept/work flow for interaction

bellwood commented 7 years ago

@jeremystretch here is some details on 6connects integration including some interface screenshots:

http://docs.6connect.com/display/DOC/ARIN+LIR+Setup+and+Use

candlerb commented 5 years ago

Now that webhooks have been added, couldn't this functionality be implemented externally to Netbox?

For example: when a Prefix changes, the external program calls back into the API to fetch Tenant information to submit to SWIP. Similarly, if Tenant details change, the external program does a search for all Prefixes linked to that Tenant.