Class: DataSource

NS1.DataSource

Class representing data sources in NS1.

Constructor

new DataSource()

Source:

Extends

Methods

create_resource_path() → {String}

Overrideable method to provide non-standard "PUT" behavior on creating new records. E.g. Zones require info in the URI where Data Sources don't.
Overrides:
Source:
Returns:
Type
String

destroy() → {Promise}

Destroys an object on the server w/ the delete HTTP verb.
Inherited From:
Source:
Returns:
Type
Promise

feed(contents, method) → {Promise}

Manually send data to your data source with this method.
Parameters:
Name Type Description
contents Object
method String (defaults to post)
Source:
Returns:
Type
Promise

get_resource_path() → {String}

Defines the path to posting changes & getting details on a single resource. Method is required to be overriden within child classes as most paths will require info pertaining to the individual resource's attributes.
Overrides:
Source:
Returns:
Type
String

save() → {Promise}

Saves an object on the server.
Inherited From:
Source:
Returns:
Type
Promise

update(attributes) → {Promise}

Updates an object w/ the provided attributes.
Parameters:
Name Type Description
attributes Object
Inherited From:
Source:
Returns:
Type
Promise