import sys from StringIO import StringIO import requests from apikey import APIKEY from regrws import CustomerPayload, ErrorPayload NAMESPACEDEF = 'xmlns="http://www.arin.net/regrws/core/v1"' iso3166_1 = CustomerPayload.iso3166_1(code2=['US'], code3=['USA'], name=['UNITED STATES'], e164=['1']) streetAddress = CustomerPayload.streetAddress([CustomerPayload.line(1, '742 Evergreen Terrace')]) cust = CustomerPayload.customer(city=['Springfield'], iso3166_1=[iso3166_1], customerName=['Simpson Family'], parentOrgHandle=['BARDL'], postalCode=['90210'], privateCustomer=['false'], streetAddress=[streetAddress], iso3166_2=['OR']) stringio = StringIO() cust.export(stringio, 0, pretty_print=False, namespace_='', namespacedef_=NAMESPACEDEF) xml = stringio.getvalue() stringio.close()
#!/usr/bin/env python import sys from StringIO import StringIO import requests from apikey import APIKEY from regrws import CustomerPayload, ErrorPayload NAMESPACEDEF = 'xmlns="http://www.arin.net/regrws/core/v1"' iso3166_1 = CustomerPayload.iso3166_1( code2=['US'], code3=['USA'], name=['UNITED STATES'], e164=['1']) streetAddress = CustomerPayload.streetAddress( [CustomerPayload.line(1, '742 Evergreen Terrace')]) cust = CustomerPayload.customer( city=['Springfield'], iso3166_1=[iso3166_1], customerName=['Simpson Family'], parentOrgHandle=['BARDL'], postalCode=['90210'], privateCustomer=['false'], streetAddress=[streetAddress], iso3166_2=['OR']) stringio = StringIO() cust.export( stringio, 0, pretty_print=False, namespace_='', namespacedef_=NAMESPACEDEF) xml = stringio.getvalue() stringio.close()