Hello Brad,

When you complete the reassignment, you’ll get a net payload back with the net 
handle associated with the newly created reassignment.  I would think the most 
logical way to approach deleting would be to store that payload (or whatever 
elements of it are relevant to what you’re going to want to do) at the time 
it's returned so that you know its details when you want to act on it.  As an 
example, suppose the net payload below (the first payload - the one using your 
API key) was the payload returned from a successful net reassign.  You know the 
net handle associated with that reassignment is NET-54-239-0-10-1.  That’s all 
you need to delete the reassignment.  You’d use the delete net method:

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

That would be done via a DELETE command with the following URL:

/rest/net/NET-54-239-0-10-1?apikey=APIKEY

That presumes you’re storing all of the returned payloads from the get-go.  If 
we’re talking about starting from a state where you don’t store the returned 
payloads, or don’t have them (for example, if you want to delete a reassignment 
created before you implemented this code), it becomes a little more tricky.  
The strategy that might be the easiest would be to use our new user 
reassignment report.  It’s accessible by logging in to ARIN Online, clicking on 
IP Addresses in the left nav bar, then clicking on the “User Reassignment 
Report” option.  This will generate a TSV file with every reassignment you’re 
authorized to remove across all of your direct allocations and reallocations.  
You could use this to essentially “prime the pump” and establish a starting 
state where you have the net handle of each block that’s possible to delete 
along with ancillary information that might be of use (org/customer handle, 
parent net handle, etc).  The caveat there is that the user reassignment report 
isn’t currently available via the Reg-RWS API; you have to manually generate 
it.  If accessing the User Reassignment Report via the API is of interest, 
that’s something you’d want to make known to us, since development priorities 
incorporate what we’re hearing from the community in terms of where they’d like 
us to focus our efforts.

Those are the two approaches I would advocate, and in fact you could really 
combine them.  You could use the User Reassignment Report to initially populate 
your own set of reassignment data when your code starts up, then update it as 
it’s running based on the transactions you perform.  For example, when you 
delete a reassignment, you delete it from your internal set of data, or when 
you create a new reassignment, you get the return payload and use that to add a 
new entry to your own tracking system (that was initially populated via the 
User Reassignment Report).    I think that’s the approach I would use (initial 
population with User Reassignment Report, subsequent updating based on returned 
payloads) since we know you’re always going to be starting from a point where 
you’re going to have a lot of reassignments that were created outside of your 
code.

If you have any further questions, comments, or concerns please respond to this 
message or contact me directly.

Regards,

Jon Worley
Technical Services Manager
ARIN Registration Services
https://www.arin.net/
hostmas...@arin.net
703.227.0660

From: 
<arin-tech-discuss-boun...@arin.net<mailto:arin-tech-discuss-boun...@arin.net>> 
on behalf of "Busching, Brad" <busch...@amazon.com<mailto:busch...@amazon.com>>
Date: Tuesday, August 23, 2016 at 5:37 PM
To: "arin-tech-discuss@arin.net<mailto:arin-tech-discuss@arin.net>" 
<arin-tech-discuss@arin.net<mailto:arin-tech-discuss@arin.net>>
Subject: [arin-tech-discuss] Getting the Net Handle of a Subnet with REST API

I have a workflow that reassigns IP blocks of one of our blocks to a customer. 
I do so by using the REST  API to create a recipient 
customer<https://www.arin.net/resources/restfulmethods.html#netcreaterecipientcustomer>
 and then 
reassign<https://www.arin.net/resources/restfulmethods.html#netreassign> it to 
that customer.

I can get the correct information by passing in the handle as such: 
"https://www.ote.arin.net/rest/net/NET-54-239-0-10-1?apikey=...” returns
[cid:image003.png@01D1FD48.73256C00]
I would like to have an equivalent workflow that deallocates it from that 
customer. I tried using Whois to get the net in several ways:


1.       http://whois.ote.arin.net/rest/cidr/54.239.0.10/31/more returns
[cid:image005.png@01D1FD48.73256C00]

2.       http://whois.ote.arin.net/rest/cidr/54.239.0.10/31/less returns
[cid:image007.png@01D1FD48.73256C00]

3.       http://whois.ote.arin.net/rest/ip/54.239.0.10/pft returns a more 
verbose version of the response above with all of the details about the parent 
handle NET-54-224-0-0-1

All of this is on the testing environments. Any help is appreciated.

Thanks
Brad
_______________________________________________
arin-tech-discuss mailing list
arin-tech-discuss@arin.net
http://lists.arin.net/mailman/listinfo/arin-tech-discuss

Reply via email to