nsone.NSONE

This top level object is used to initialize and coordinate access to the NSONE platform. With it, you create objects for accessing either the basic REST interface, or the high level objects such as Zone and Record.

class nsone.NSONE(apiKey=None, config=None, configFile=None, keyID=None)

Create a new top level NSONE API object

Parameters:
  • apiKey (str) – if given, initialize config with this API key (obtainable via creation in NSONE portal)
  • config (nsone.config.Config) – if given, uses a separately constructed and configured Config object
  • configFile (str) – if given, load configuration from the given json configuration file
  • keyID (str) – if given, use the specified key config in the multi-key configuration file
createZone(zone, zoneFile=None, callback=None, errback=None, **kwargs)

Create a new zone, and return an associated high level Zone object. Several optional keyword arguments are available to configure the SOA record.

If zoneFile is specified, upload the specific zone definition file to populate the zone with.

Parameters:
  • zone (str) – zone name, like ‘example.com’
  • zoneFile (str) – absolute path of a zone file
  • retry (int) – retry time
  • refresh (int) – refresh ttl
  • expiry (int) – expiry ttl
  • nx_ttl (int) – nxdomain TTL
Return type:

nsone.zones.Zone

datafeed()

Return a new raw REST interface to feed resources

Return type:nsone.rest.data.Feed
datasource()

Return a new raw REST interface to datasource resources

Return type:nsone.rest.data.Source
loadRecord(domain, type, zone=None, callback=None, errback=None, **kwargs)

Load an existing record into a high level Record object.

Parameters:
  • domain (str) – domain name of the record in the zone, for example ‘myrecord’. You may leave off the zone, since it must be specified in the zone parameter
  • type (str) – record type, such as ‘A’, ‘MX’, ‘AAAA’, etc.
  • zone (str) – zone name, like ‘example.com’
Return type:

nsone.records

loadZone(zone, callback=None, errback=None)

Load an existing zone into a high level Zone object.

Parameters:zone (str) – zone name, like ‘example.com’
Return type:nsone.zones.Zone
monitors()

Return a new raw REST interface to monitors resources

Return type:nsone.rest.monitoring.Monitors
plan()

Return a new raw REST interface to account plan

Return type:nsone.rest.account.Plan
records()

Return a new raw REST interface to record resources

Return type:nsone.rest.records.Records
stats()

Return a new raw REST interface to stats resources

Return type:nsone.rest.stats.Stats
zones()

Return a new raw REST interface to zone resources

Return type:nsone.rest.zones.Zones