<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>Hello Brad,</div>
<div><br>
</div>
<div>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:</div>
<div><br>
</div>
<div><a href="https://www.arin.net/resources/restfulmethods.html#netdelete">https://www.arin.net/resources/restfulmethods.html#netdelete</a></div>
<div><br>
</div>
<div>That would be done via a DELETE command with the following URL:</div>
<div><br>
</div>
<div>
<div>/rest/net/NET-54-239-0-10-1?apikey=APIKEY</div>
</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>
<div>
<div>
<div>If you have any further questions, comments, or concerns please respond to this message or contact me directly.   </div>
<div><br>
</div>
<div>Regards,</div>
<div><br>
</div>
<div>Jon Worley</div>
<div>Technical Services Manager</div>
<div>ARIN Registration Services</div>
<div>https://www.arin.net/</div>
<div>hostmaster@arin.net</div>
<div>703.227.0660</div>
</div>
</div>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span><<a href="mailto:arin-tech-discuss-bounces@arin.net">arin-tech-discuss-bounces@arin.net</a>> on behalf of "Busching, Brad" <<a href="mailto:busching@amazon.com">busching@amazon.com</a>><br>
<span style="font-weight:bold">Date: </span>Tuesday, August 23, 2016 at 5:37 PM<br>
<span style="font-weight:bold">To: </span>"<a href="mailto:arin-tech-discuss@arin.net">arin-tech-discuss@arin.net</a>" <<a href="mailto:arin-tech-discuss@arin.net">arin-tech-discuss@arin.net</a>><br>
<span style="font-weight:bold">Subject: </span>[arin-tech-discuss] Getting the Net Handle of a Subnet with REST API<br>
</div>
<div><br>
</div>
<div xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:627662246;
        mso-list-type:hybrid;
        mso-list-template-ids:-1959626576 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1029" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">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
<a href="https://www.arin.net/resources/restfulmethods.html#netcreaterecipientcustomer">
create a recipient customer</a> and then <a href="https://www.arin.net/resources/restfulmethods.html#netreassign">
reassign</a> it to that customer.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I can get the correct information by passing in the handle as such: "<a href="https://www.ote.arin.net/rest/net/NET-54-239-0-10-1?apikey=...">https://www.ote.arin.net/rest/net/NET-54-239-0-10-1?apikey=...</a>” returns<o:p></o:p></p>
<p class="MsoNormal"><!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">
<v:stroke joinstyle="miter" />
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0" />
<v:f eqn="sum @0 1 0" />
<v:f eqn="sum 0 0 @1" />
<v:f eqn="prod @2 1 2" />
<v:f eqn="prod @3 21600 pixelWidth" />
<v:f eqn="prod @3 21600 pixelHeight" />
<v:f eqn="sum @0 0 1" />
<v:f eqn="prod @6 1 2" />
<v:f eqn="prod @7 21600 pixelWidth" />
<v:f eqn="sum @8 21600 0" />
<v:f eqn="prod @7 21600 pixelHeight" />
<v:f eqn="sum @10 21600 0" />
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect" />
<o:lock v:ext="edit" aspectratio="t" />
</v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" style='width:736.5pt;height:303.75pt' o:ole="">
<v:imagedata src="cid:image004.wmz@01D1FD4B.F18477A0" o:title="" />
</v:shape><![endif]--><!--[if !vml]--><img border="0" width="982" height="405" style="width:10.2291in;height:4.2187in" src="cid:image003.png@01D1FD48.73256C00" v:shapes="_x0000_i1025"><!--[endif]--><!--[if gte mso 9]><xml>
<o:OLEObject Type="Embed" ProgID="Word.OpenDocumentText.12" ShapeID="_x0000_i1025" DrawAspect="Content" ObjectID="_1533468236">
</o:OLEObject>
</xml><![endif]--><o:p></o:p></p>
<p class="MsoNormal">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:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo2"><!--[if !supportLists]--><span style="mso-list:Ignore">1.<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman';">      
</span></span><!--[endif]--><a href="http://whois.ote.arin.net/rest/cidr/54.239.0.10/31/more">http://whois.ote.arin.net/rest/cidr/54.239.0.10/31/more</a> returns<br>
<!--[if gte vml 1]><v:shape id="_x0000_i1026" type="#_x0000_t75" style='width:862.5pt;height:135.75pt' o:ole="">
<v:imagedata src="cid:image006.wmz@01D1FD4B.F18477A0" o:title="" />
</v:shape><![endif]--><!--[if !vml]--><img border="0" width="1150" height="181" style="width:11.9791in;height:1.8854in" src="cid:image005.png@01D1FD48.73256C00" v:shapes="_x0000_i1026"><!--[endif]--><!--[if gte mso 9]><xml>
<o:OLEObject Type="Embed" ProgID="Word.OpenDocumentText.12" ShapeID="_x0000_i1026" DrawAspect="Content" ObjectID="_1533468237">
</o:OLEObject>
</xml><![endif]--><o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo2"><!--[if !supportLists]--><span style="mso-list:Ignore">2.<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman';">      
</span></span><!--[endif]--><a href="http://whois.ote.arin.net/rest/cidr/54.239.0.10/31/less">http://whois.ote.arin.net/rest/cidr/54.239.0.10/31/less</a> returns<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><!--[if gte vml 1]><v:shape id="_x0000_i1027" type="#_x0000_t75" style='width:859.5pt;height:203.25pt' o:ole="">
<v:imagedata src="cid:image008.wmz@01D1FD4B.F18477A0" o:title="" />
</v:shape><![endif]--><!--[if !vml]--><img border="0" width="1146" height="271" style="width:11.9375in;height:2.8229in" src="cid:image007.png@01D1FD48.73256C00" v:shapes="_x0000_i1027"><!--[endif]--><!--[if gte mso 9]><xml>
<o:OLEObject Type="Embed" ProgID="Word.OpenDocumentText.12" ShapeID="_x0000_i1027" DrawAspect="Content" ObjectID="_1533468238">
</o:OLEObject>
</xml><![endif]--><o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo2"><!--[if !supportLists]--><span style="mso-list:Ignore">3.<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman';">      
</span></span><!--[endif]--><a href="http://whois.ote.arin.net/rest/ip/54.239.0.10/pft">http://whois.ote.arin.net/rest/ip/54.239.0.10/pft</a> returns a more verbose version of the response above with all of the details about the parent handle NET-54-224-0-0-1<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">All of this is on the testing environments. Any help is appreciated.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks<o:p></o:p></p>
<p class="MsoNormal">Brad<o:p></o:p></p>
</div>
</div>
</div>
</span>
</body>
</html>