Welcome to NetCloudAPI’s documentation!

NetCloudAPI usage and methods

NetCloudAPI provides an interface to the Cradlepoint ECM API.

NetCloudAPI provides a pythonic way to create and execute requests to the Cradlepoint ECM API v2. Each of the available endpoints is represented in classes of the NetCloudAPI.endpoints subpackage.

NetCloudAPI imports the following functions:
  • req() for building requests from Endpoints
  • call() for sending requests to the API, and handling the responses

Example:

# Import Pandas for data analysis
# Not required for NetCloudAPI Use - but recommended
import pandas as pd
import NetCloudAPI
from NetCloudAPI.endpoints import Routers, RouterStateSamples

RESOURCE_LIMIT = 100
REPORT_FROM = datetime(someyear, somemonth, someday)

# NetCloud ECM Groups for subset of Routers
ecm_groups = [12345,
              67891,
              34567]

# Request Headers with NetCloud ECM API IDs/Keys
headers = {'X-CP-API-ID': 'your_cp_api_id',
           'X-CP-API-KEY': 'your_cp_api_key',
           'X-ECM-API-ID': 'your_ecm_api_id',
           'X-ECM-API-KEY': 'your_ecm_api_key',
           'Content-Type': 'application/json'}

router_ep = Routers(filters={"group__in": ecm_groups},
                    paging={"limit": 500},
                    fields=["id", "asset_id", "mac", "state"],
                    method="GET")

router_req = NetCloudAPI.req(endpoint=router_ep,
                             headers=headers)

router_data = NetCloudAPI.call(router_req)
routers = pd.DataFrame(router_data["data"])
routers.to_excel("/some/arbitrary/path.xlsx", index=False)

# Some endpoints (RouterStateSamples for example) only support calls for
# data on a maximum of 100 devices - in these cases you must use a loop
# such as the following:

router_ids = routers.id.astype('int')
routerstatesamples = pd.DataFrame()

while len(router_ids) > 0:
    router_list = list(router_ids[:RESOURCE_LIMIT])

    routerstatesamples_ep = RouterStateSamples(filters={"router__in" : router_list,
                                                        "created_at__gt": REPORT_FROM},
                                               fields=["created_at", "period",
                                                       "state", "router"],
                                               paging={"limit": 500},
                                               method="GET")

    routerstatesamples_req = req(routerstatesamples_ep, headers)
    rss_data = call(routerstatesamples_req)
    routerstatesamples = routerstatesamples.append(pd.DataFrame(rss_data["data"]))
    router_ids = router_ids.iloc[RESOURCE_LIMIT:]

routerstatesamples.to_excel("/some/arbitrary/path/routerstatesamples.xlsx", index=False)

Warning

The Cradlepoint ECM API requires authentication. It is necessary for users to have the appropriate Cradlepoint ECM API credentials for their account. Use of this package is not possible without the appropriate headers:

headers = {'X-CP-API-ID': 'your_cp_api_id',
           'X-CP-API-KEY': 'your_cp_api_key',
           'X-ECM-API-ID': 'your_ecm_api_id',
           'X-ECM-API-KEY': 'your_ecm_api_key',
           'Content-Type': 'application/json'}

If you do not have the credentials above contact your Cradlepoint ECM administrator and request them.

NetCloudAPI.req is the module that provides the NetCloudAPI.req() function.

NetCloudAPI.req.req() is imported by the NetCloudAPI package.

NetCloudAPI.req.BASE_URL = 'https://www.cradlepointecm.com'

Defines the root of the URL for requests.PreparedRequest generation

NetCloudAPI.req.REQUIRED_HEADERS = {'Content-Type': <class 'str'>, 'X-CP-API-ID': <class 'str'>, 'X-CP-API-KEY': <class 'str'>, 'X-ECM-API-ID': <class 'str'>, 'X-ECM-API-KEY': <class 'str'>}

Defines the header dictionary keys and value types used for header validation

NetCloudAPI.req.req(endpoint=None, headers=None)

Prepares requests.PreparedRequest objects from passed args.

Argument validation is featured in order to minimize the risk of invalid API calls. While both arguments default to None calling NetCloudAPI.req with empty arguments will raise an error.

Parameters:
  • endpoint (Endpoint) – Any one of the NetCloudAPI.endpoints subclasses
  • headers (dict) – The headers dictionary provided by Cradlepoint ECM.
Returns:

A requests.PreparedRequest object if both arguments contain the required elements

Raises:
  • ValueError – If attributes are None
  • ValueError – If header ‘Content-Type’ is not ‘application/json’
  • TypeError – If other invalid input is detected.

NetCloudAPI.call is the module that provides the NetCloudAPI.call() function.

NetCloudAPI.call.call() is imported by the NetCloudAPI package.

NetCloudAPI.call.call(request, session=None)

Executes remote API calls and returns JSON response data.

Cradlepoint ECM API calls are made based on the passed requests.PreparedRequest object created by NetCloudAPI.req. The API response is analyzed for content signaling the success or failure of the request, as well as the need to make subsequent requests in order to retrieve all necessary data. This function will continue making requests and building the full JSON data object until all requested data has been retrieved.

Parameters:
  • request (requests.PreparedRequest) – The successful results from NetCloudAPI.req().
  • session (requests.Session, optional) – An optional requests.Session object
Returns:

JSON object with the appropriate status code and data payload(s).

NetCloudAPI.endpoints Documentation

NetCloudAPI.endpoints is a subpackage providing classes for Cradlepoint ECM API endpoints.

Each class features attribute validation on assignment to public attributes.

NetCloudAPI.endpoints imports the following classes:
  • Endpoint (superclass)
  • Accounts (subclass)
  • ConfigurationManagers (subclass)
  • Firmwares (subclass)
  • Groups (subclass)
  • NetDeviceSignalSamples (subclass)
  • NetDeviceUsageSamples (subclass)
  • NetDeviceMetrics (subclass)
  • NetDevices (subclass)
  • Products (subclass)
  • RebootActivity (subclass)
  • RouterAlerts (subclass)
  • RouterLogs (subclass)
  • RouterStateSamples (subclass)
  • RouterStreamUsageSamples (subclass)
  • Routers (subclass)

NetCloudAPI.endpoints.endpoint provides the Endpoint superclass.

class NetCloudAPI.endpoints.endpoint.Endpoint(base_uri=None, allowed_meths=None, allowed_params=None, required_params=None, allowed_filters=None, allowed_expands=None, method=None, params=None, filters=None, expands=None, fields=None, paging=None, body=None)

Superclass for all Cradlepoint ECM API endpoint subclasses.

Setter methods validate structure and type, where applicable, based on Cradlepoint ECM API reference documentation. Subclasses override the init method to define subclass specific allowable fields and data types.

uri

Class uri property getter/setter

Returns:The configured base URI (str).
Raises:ValueError – If the setter attempts to change the uri.
method

Class method property getter/setter

Returns:

The configured HTTP request method (str)

Raises:
  • ValueError – If an invalid or unsupported method is passed to the setter.
  • ValueError – If the setter is passed a non-str object.
params

Class params property getter/setter

Returns:

The configured request parameters (dict)

Raises:
  • ValueError – If invalid parameter keys are passed to setter.
  • ValueError – If invalid parameter values are passed to setter.
  • ValueError – If method = ‘POST’ and required parameters are missing.
  • ValueError – If the setter is passed a non-dict object.
filters

Class filters property getter/setter

Returns:

The configured filter parameters (dict)

Raises:
  • ValueError – If invalid filter keys are passed to setter.
  • ValueError – If invalid filter values are passed to setter.
  • ValueError – If the setter is passed a non-dict object.
expands

Class expands property getter/setter.

Returns:

The configured expands parameters (list)

Raises:
  • ValueError – If invalid expands values are passed to setter.
  • ValueError – If the setter is passed a non-list object.
fields

Class fields property getter/setter

Returns:

The configured fields to fetch from the API (list)

Raises:
  • ValueError – If invalid fields are passed to the setter.
  • ValueError – If the setter is passed a non-list object.
paging

Class paging property getter/setter

paging accepts a dict with two keys:
  • limit (int) - if omitted the API assumes ‘25’
  • offset (int)

Use this to limit the number of calls made to the API for a given operation.

Returns:

The configured paging settings (dict)

Raises:
  • ValueError – If invalid paging options are passed to the setter.
  • ValueError – If the setter is passed a non-dict object.
body

Class body property getter/setter

Returns:The configured body object (dict)
Raises:TypeError – If the the setter is passed a dict that causes an error from json.dumps()
class NetCloudAPI.endpoints.endpoint.Unsupported

Placeholder for currently unsupported data types

Currently used as the data type for all timeuuid fields.

NetCloudAPI.endpoints.accounts provides the Accounts subclass.

NetCloudAPI.endpoints.accounts.URI = '/api/v2/accounts/'

Defines the uri to append to BASE_URL from NetCloudAPI.req

NetCloudAPI.endpoints.accounts.ALLOWED_METHS = ['GET', 'POST', 'PUT', 'DELETE']

Defines the allowed methods for the endpoint.

Only one method from this list may be set at a time. The method setter function validates based on this list.

NetCloudAPI.endpoints.accounts.ALLOWED_PARAMS = {'account': <class 'int'>, 'id': <class 'int'>, 'is_disabled': <class 'bool'>, 'name': <class 'str'>, 'resource_url': <class 'str'>}

Defines the allowed params for the endpoint.

The params setter function validates based on this dictionary. Keys passed to the setter must belong to the set of keys allowed, and the corresponding value types must match.

NetCloudAPI.endpoints.accounts.REQUIRED_PARAMS = {'account': <class 'int'>, 'name': <class 'str'>}

Defines the required params for the endpoint when method = “POST”.

The params setter function validates based on this dictionary when method = “POST”. Keys passed to the setter must belong to the set of keys allowed in ALLOWED_PARAMS and include all REQUIRED_PARAMS. The corresponding value types must match.

NetCloudAPI.endpoints.accounts.ALLOWED_FILTERS = {'account__in': <class 'list'>, 'id__in': <class 'list'>, 'name__in': <class 'list'>}

Defines the allowed filters for the endpoint.

The filters setter function validates based on this dictionary, and the related ALLOWED_PARAMS dictionary. All list elements must match the corresponding ALLOWED_PARAMS type for the key preceding the ‘__’ within the ALLOWED_FILTERS dictionary key. A subset of the allowed keys may be passed.

NetCloudAPI.endpoints.accounts.ALLOWED_EXPANDS = ['account']

Defines the allowed expands for the endpoint

The expands setter function validates based on this list, and the passed object must also be a list that is a set of the ALLOWED_EXPANDS values.

class NetCloudAPI.endpoints.accounts.Accounts(method=None, params=None, filters=None, expands=None, fields=None, paging=None, body=None)

NetCloudAPI.endpoints.configuration_managers provides the ConfigurationManagers subclass.

NetCloudAPI.endpoints.configuration_managers.URI = '/api/v2/configuration_managers/'

Defines the uri to append to BASE_URL from NetCloudAPI.req

NetCloudAPI.endpoints.configuration_managers.ALLOWED_METHS = ['GET', 'PUT']

Defines the allowed methods for the endpoint.

Only one method from this list may be set at a time. The method setter function validates based on this list.

NetCloudAPI.endpoints.configuration_managers.ALLOWED_PARAMS = {'account': <class 'int'>, 'actual': <class 'str'>, 'configuration': <class 'str'>, 'id': <class 'int'>, 'pending': <class 'str'>, 'resource_url': <class 'str'>, 'router': <class 'int'>, 'suspended': <class 'bool'>, 'synched': <class 'bool'>, 'target': <class 'str'>, 'version_number': <class 'int'>}

Defines the allowed params for the endpoint.

The params setter function validates based on this dictionary. Keys passed to the setter must belong to the set of keys allowed, and the corresponding value types must match.

NetCloudAPI.endpoints.configuration_managers.ALLOWED_FILTERS = {'account__in': <class 'list'>, 'id__in': <class 'list'>, 'router__in': <class 'list'>}

Defines the allowed filters for the endpoint.

The filters setter function validates based on this dictionary, and the related ALLOWED_PARAMS dictionary. All list elements must match the corresponding ALLOWED_PARAMS type for the key preceding the ‘__’ within the ALLOWED_FILTERS dictionary key. A subset of the allowed keys may be passed.

NetCloudAPI.endpoints.configuration_managers.ALLOWED_EXPANDS = ['account', 'router']

Defines the allowed expands for the endpoint

The expands setter function validates based on this list, and the passed object must also be a list that is a set of the ALLOWED_EXPANDS values.

class NetCloudAPI.endpoints.configuration_managers.ConfigurationManagers(method=None, params=None, filters=None, expands=None, fields=None, paging=None, body=None)

NetCloudAPI.endpoints.firmwares provides the Firmwares subclass.

NetCloudAPI.endpoints.firmwares.URI = '/api/v2/firmwares/'

Defines the uri to append to BASE_URL from NetCloudAPI.req

NetCloudAPI.endpoints.firmwares.ALLOWED_METHS = ['GET']

Defines the allowed methods for the endpoint.

Only one method from this list may be set at a time. The method setter function validates based on this list.

NetCloudAPI.endpoints.firmwares.ALLOWED_PARAMS = {'built_at': <class 'datetime.datetime'>, 'hash': <class 'str'>, 'id': <class 'int'>, 'is_deprecated': <class 'bool'>, 'product': <class 'str'>, 'released_at': <class 'datetime.datetime'>, 'resource_url': <class 'str'>, 'uploaded_at': <class 'datetime.datetime'>, 'url': <class 'str'>, 'version': <class 'str'>}

Defines the allowed params for the endpoint.

The params setter function validates based on this dictionary. Keys passed to the setter must belong to the set of keys allowed, and the corresponding value types must match.

NetCloudAPI.endpoints.firmwares.ALLOWED_FILTERS = {'id__in': <class 'list'>, 'version__in': <class 'list'>}

Defines the allowed filters for the endpoint.

The filters setter function validates based on this dictionary, and the related ALLOWED_PARAMS dictionary. All list elements must match the corresponding ALLOWED_PARAMS type for the key preceding the ‘__’ within the ALLOWED_FILTERS dictionary key. A subset of the allowed keys may be passed.

class NetCloudAPI.endpoints.firmwares.Firmwares(method=None, params=None, filters=None, expands=None, fields=None, paging=None, body=None)

NetCloudAPI.endpoints.groups provides the Groups subclass.

NetCloudAPI.endpoints.groups.URI = '/api/v2/groups/'

Defines the uri to append to BASE_URL from NetCloudAPI.req

NetCloudAPI.endpoints.groups.ALLOWED_METHS = ['GET', 'POST', 'PUT', 'DELETE']

Defines the allowed methods for the endpoint.

Only one method from this list may be set at a time. The method setter function validates based on this list.

NetCloudAPI.endpoints.groups.ALLOWED_PARAMS = {'account': <class 'int'>, 'configuration': <class 'str'>, 'device_type': <class 'str'>, 'id': <class 'int'>, 'name': <class 'str'>, 'product': <class 'str'>, 'resource_url': <class 'str'>, 'target_configuration': <class 'str'>}

Defines the allowed params for the endpoint.

The params setter function validates based on this dictionary. Keys passed to the setter must belong to the set of keys allowed, and the corresponding value types must match.

NetCloudAPI.endpoints.groups.REQUIRED_PARAMS = {'account': <class 'int'>, 'name': <class 'str'>, 'product': <class 'str'>, 'target_firmware': <class 'str'>}

Defines the required params for the endpoint when method = “POST”.

The params setter function validates based on this dictionary when method = “POST”. Keys passed to the setter must belong to the set of keys allowed in ALLOWED_PARAMS and include all REQUIRED_PARAMS. The corresponding value types must match.

NetCloudAPI.endpoints.groups.ALLOWED_FILTERS = {'account__in': <class 'list'>, 'device_type__in': <class 'list'>, 'id__in': <class 'list'>, 'name__in': <class 'list'>}

Defines the allowed filters for the endpoint.

The filters setter function validates based on this dictionary, and the related ALLOWED_PARAMS dictionary. All list elements must match the corresponding ALLOWED_PARAMS type for the key preceding the ‘__’ within the ALLOWED_FILTERS dictionary key. A subset of the allowed keys may be passed.

NetCloudAPI.endpoints.groups.ALLOWED_EXPANDS = ['account']

Defines the allowed expands for the endpoint

The expands setter function validates based on this list, and the passed object must also be a list that is a set of the ALLOWED_EXPANDS values.

class NetCloudAPI.endpoints.groups.Groups(method=None, params=None, filters=None, expands=None, fields=None, paging=None, body=None)

NetCloudAPI.endpoints.net_device_metrics provides the NetDeviceMetrics subclass.

NetCloudAPI.endpoints.net_device_metrics.URI = '/api/v2/net_device_metrics/'

Defines the uri to append to BASE_URL from NetCloudAPI.req

NetCloudAPI.endpoints.net_device_metrics.ALLOWED_METHS = ['GET']

Defines the allowed methods for the endpoint.

Only one method from this list may be set at a time. The method setter function validates based on this list.

NetCloudAPI.endpoints.net_device_metrics.ALLOWED_PARAMS = {'bytes_in': <class 'int'>, 'bytes_out': <class 'int'>, 'cinr': <class 'float'>, 'dbm': <class 'int'>, 'ecio': <class 'int'>, 'id': <class 'int'>, 'net_device': <class 'int'>, 'resource_url': <class 'str'>, 'rsrp': <class 'float'>, 'rsrq': <class 'float'>, 'rssi': <class 'int'>, 'service_type': <class 'str'>, 'signal_strength': <class 'int'>, 'sinr': <class 'float'>, 'update_ts': <class 'datetime.datetime'>}

Defines the allowed params for the endpoint.

The params setter function validates based on this dictionary. Keys passed to the setter must belong to the set of keys allowed, and the corresponding value types must match.

NetCloudAPI.endpoints.net_device_metrics.ALLOWED_FILTERS = {'net_device__in': <class 'list'>, 'update_ts__gt': <class 'datetime.datetime'>, 'update_ts__lt': <class 'datetime.datetime'>}

Defines the allowed filters for the endpoint.

The filters setter function validates based on this dictionary, and the related ALLOWED_PARAMS dictionary. All list elements must match the corresponding ALLOWED_PARAMS type for the key preceding the ‘__’ within the ALLOWED_FILTERS dictionary key. A subset of the allowed keys may be passed.

class NetCloudAPI.endpoints.net_device_metrics.NetDeviceMetrics(method=None, params=None, filters=None, expands=None, fields=None, paging=None, body=None)

NetCloudAPI.endpoints.net_device_signal_samples provides the NetDeviceSignalSamples subclass.

NetCloudAPI.endpoints.net_device_signal_samples.URI = '/api/v2/net_device_signal_samples/'

Defines the uri to append to BASE_URL from NetCloudAPI.req

NetCloudAPI.endpoints.net_device_signal_samples.ALLOWED_METHS = ['GET']

Defines the allowed methods for the endpoint.

Only one method from this list may be set at a time. The method setter function validates based on this list.

NetCloudAPI.endpoints.net_device_signal_samples.ALLOWED_PARAMS = {'cinr': <class 'float'>, 'created_at': <class 'datetime.datetime'>, 'created_at_timeuuid': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'dbm': <class 'int'>, 'ecio': <class 'int'>, 'net_device': <class 'int'>, 'rsrp': <class 'float'>, 'rsrq': <class 'float'>, 'rssi': <class 'int'>, 'signal_percent': <class 'int'>, 'sinr': <class 'float'>, 'uptime': <class 'float'>}

Defines the allowed params for the endpoint.

The params setter function validates based on this dictionary. Keys passed to the setter must belong to the set of keys allowed, and the corresponding value types must match.

NetCloudAPI.endpoints.net_device_signal_samples.ALLOWED_FILTERS = {'created_at__gt': <class 'datetime.datetime'>, 'created_at__lt': <class 'datetime.datetime'>, 'created_at_timeuuid__gt': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__gte': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__in': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__lt': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__lte': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'net_device__in': <class 'list'>}

Defines the allowed filters for the endpoint.

The filters setter function validates based on this dictionary, and the related ALLOWED_PARAMS dictionary. All list elements must match the corresponding ALLOWED_PARAMS type for the key preceding the ‘__’ within the ALLOWED_FILTERS dictionary key. A subset of the allowed keys may be passed.

class NetCloudAPI.endpoints.net_device_signal_samples.NetDeviceSignalSamples(method=None, params=None, filters=None, expands=None, fields=None, paging=None, body=None)

NetCloudAPI.endpoints.net_device_usage_samples provides the NetDeviceUsageSamples subclass.

NetCloudAPI.endpoints.net_device_usage_samples.URI = '/api/v2/net_device_usage_samples/'

Defines the uri to append to BASE_URL from NetCloudAPI.req

NetCloudAPI.endpoints.net_device_usage_samples.ALLOWED_METHS = ['GET']

Defines the allowed methods for the endpoint.

Only one method from this list may be set at a time. The method setter function validates based on this list.

NetCloudAPI.endpoints.net_device_usage_samples.ALLOWED_PARAMS = {'bytes_in': <class 'int'>, 'bytes_out': <class 'int'>, 'created_at': <class 'datetime.datetime'>, 'created_at_timeuuid': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'net_device': <class 'int'>, 'period': <class 'float'>, 'uptime': <class 'float'>}

Defines the allowed params for the endpoint.

The params setter function validates based on this dictionary. Keys passed to the setter must belong to the set of keys allowed, and the corresponding value types must match.

NetCloudAPI.endpoints.net_device_usage_samples.ALLOWED_FILTERS = {'created_at__gt': <class 'datetime.datetime'>, 'created_at__lt': <class 'datetime.datetime'>, 'created_at_timeuuid__gt': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__gte': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__in': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__lt': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__lte': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'net_device__in': <class 'list'>}

Defines the allowed filters for the endpoint.

The filters setter function validates based on this dictionary, and the related ALLOWED_PARAMS dictionary. All list elements must match the corresponding ALLOWED_PARAMS type for the key preceding the ‘__’ within the ALLOWED_FILTERS dictionary key. A subset of the allowed keys may be passed.

class NetCloudAPI.endpoints.net_device_usage_samples.NetDeviceUsageSamples(method=None, params=None, filters=None, expands=None, fields=None, paging=None, body=None)

NetCloudAPI.endpoints.net_devices provides the NetDevices subclass.

NetCloudAPI.endpoints.net_devices.URI = '/api/v2/net_devices/'

Defines the uri to append to BASE_URL from NetCloudAPI.req

NetCloudAPI.endpoints.net_devices.ALLOWED_METHS = ['GET']

Defines the allowed methods for the endpoint.

Only one method from this list may be set at a time. The method setter function validates based on this list.

NetCloudAPI.endpoints.net_devices.ALLOWED_PARAMS = {'account': <class 'int'>, 'bsid': <class 'str'>, 'carrier': <class 'str'>, 'carrier_id': <class 'str'>, 'channel': <class 'int'>, 'connection_state': <class 'str'>, 'dns0': <class 'str'>, 'dns1': <class 'str'>, 'esn': <class 'str'>, 'gateway': <class 'str'>, 'gsn': <class 'str'>, 'homecarrid': <class 'str'>, 'hostname': <class 'str'>, 'iccid': <class 'str'>, 'id': <class 'int'>, 'imei': <class 'str'>, 'imsi': <class 'str'>, 'ipv4_address': <class 'str'>, 'is_asset': <class 'bool'>, 'is_gps_supported': <class 'bool'>, 'is_upgrade_available': <class 'bool'>, 'ltebandwidth': <class 'str'>, 'mac': <class 'str'>, 'manufacturer': <class 'str'>, 'mdn': <class 'str'>, 'meid': <class 'str'>, 'mfg_model': <class 'str'>, 'mfg_product': <class 'str'>, 'mn_ha_spi': <class 'str'>, 'mn_ha_ss': <class 'str'>, 'mode': <class 'str'>, 'model': <class 'str'>, 'model_fw': <class 'str'>, 'mtu': <class 'int'>, 'nai': <class 'str'>, 'name': <class 'str'>, 'netmask': <class 'str'>, 'pin_status': <class 'str'>, 'port': <class 'str'>, 'prlv': <class 'str'>, 'profile': <class 'str'>, 'resource_url': <class 'str'>, 'rfband': <class 'str'>, 'rfchannel': <class 'str'>, 'roam': <class 'str'>, 'router': <class 'int'>, 'rxchannel': <class 'str'>, 'serial': <class 'str'>, 'service_type': <class 'str'>, 'ssid': <class 'str'>, 'summary': <class 'str'>, 'txchannel': <class 'str'>, 'type': <class 'str'>, 'uid': <class 'str'>, 'updated_at': <class 'datetime.datetime'>, 'uptime': <class 'float'>, 'ver_pkg': <class 'str'>, 'version': <class 'str'>, 'wimax_realm': <class 'str'>}

Defines the allowed params for the endpoint.

The params setter function validates based on this dictionary. Keys passed to the setter must belong to the set of keys allowed, and the corresponding value types must match.

NetCloudAPI.endpoints.net_devices.ALLOWED_FILTERS = {'account__in': <class 'list'>, 'connection_state__in': <class 'list'>, 'id__in': <class 'list'>, 'ipv4_address__in': <class 'list'>, 'mode__in': <class 'list'>, 'net_device__in': <class 'list'>, 'router__in': <class 'list'>}

Defines the allowed filters for the endpoint.

The filters setter function validates based on this dictionary, and the related ALLOWED_PARAMS dictionary. All list elements must match the corresponding ALLOWED_PARAMS type for the key preceding the ‘__’ within the ALLOWED_FILTERS dictionary key. A subset of the allowed keys may be passed.

NetCloudAPI.endpoints.net_devices.ALLOWED_EXPANDS = ['account', 'router']

Defines the allowed expands for the endpoint

The expands setter function validates based on this list, and the passed object must also be a list that is a set of the ALLOWED_EXPANDS values.

class NetCloudAPI.endpoints.net_devices.NetDevices(method=None, params=None, filters=None, expands=None, fields=None, paging=None, body=None)

NetCloudAPI.endpoints.products provides the Products subclass.

NetCloudAPI.endpoints.products.URI = '/api/v2/products/'

Defines the uri to append to BASE_URL from NetCloudAPI.req

NetCloudAPI.endpoints.products.ALLOWED_METHS = ['GET']

Defines the allowed methods for the endpoint.

Only one method from this list may be set at a time. The method setter function validates based on this list.

NetCloudAPI.endpoints.products.ALLOWED_FILTERS = {'device_type__in': <class 'list'>, 'id__in': <class 'list'>}

Defines the allowed params for the endpoint.

The params setter function validates based on this dictionary. Keys passed to the setter must belong to the set of keys allowed, and the corresponding value types must match.

class NetCloudAPI.endpoints.products.Products(method=None, params=None, filters=None, expands=None, fields=None, paging=None, body=None)

NetCloudAPI.endpoints.reboot_activity provides the RebootActivity subclass

NetCloudAPI.endpoints.reboot_activity.URI = '/api/v2/reboot_activity/'

Defines the uri to append to BASE_URL from NetCloudAPI.req

NetCloudAPI.endpoints.reboot_activity.ALLOWED_METHS = ['POST']

Defines the allowed methods for the endpoint.

Only one method from this list may be set at a time. The method setter function validates based on this list.

class NetCloudAPI.endpoints.reboot_activity.RebootActivity(method=None, params=None, filters=None, expands=None, fields=None, paging=None, body=None)

This Endpoint supports only the “POST” method for specific JSON bodies.

From the API Documentation:

To reboot the router with id=42, post the payload: {"router":"/api/v2/routers/42/"}

or using a full resource url (e.g., one obtained from the /api/v2/routers endpoint): {"router":"http://www.cradlepointecm.com/api/v2/routers/42/"}

To reboot the group with id=24, post the payload: {"group":"/api/v2/groups/24/"}

or using a full resource url (e.g., one obtained from the /api/v2/groups endpoint): {"group":"http://www.cradlepointecm.com/api/v2/groups/24/"}

NetCloudAPI.endpoints.router_alerts provides the RouterAlerts subclass.

NetCloudAPI.endpoints.router_alerts.URI = '/api/v2/router_alerts/'

Defines the uri to append to BASE_URL from NetCloudAPI.req

NetCloudAPI.endpoints.router_alerts.ALLOWED_METHS = ['GET']

Defines the allowed methods for the endpoint.

Only one method from this list may be set at a time. The method setter function validates based on this list.

NetCloudAPI.endpoints.router_alerts.ALLOWED_PARAMS = {'created_at': <class 'datetime.datetime'>, 'created_at_timeuuid': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'detected_at': <class 'datetime.datetime'>, 'friendly_info': <class 'str'>, 'info': <class 'str'>, 'router': <class 'int'>, 'type': <class 'str'>}

Defines the allowed params for the endpoint.

The params setter function validates based on this dictionary. Keys passed to the setter must belong to the set of keys allowed, and the corresponding value types must match.

NetCloudAPI.endpoints.router_alerts.ALLOWED_FILTERS = {'created_at__gt': <class 'datetime.datetime'>, 'created_at__lt': <class 'datetime.datetime'>, 'created_at_timeuuid__gt': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__gte': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__in': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__lt': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__lte': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'router__in': <class 'list'>}

Defines the allowed filters for the endpoint.

The filters setter function validates based on this dictionary, and the related ALLOWED_PARAMS dictionary. All list elements must match the corresponding ALLOWED_PARAMS type for the key preceding the ‘__’ within the ALLOWED_FILTERS dictionary key. A subset of the allowed keys may be passed.

class NetCloudAPI.endpoints.router_alerts.RouterAlerts(method=None, params=None, filters=None, expands=None, fields=None, paging=None, body=None)

NetCloudAPI.endpoints.router_logs provides the RouterLogs subclass.

NetCloudAPI.endpoints.router_logs.URI = '/api/v2/router_logs/'

Defines the uri to append to BASE_URL from NetCloudAPI.req

NetCloudAPI.endpoints.router_logs.ALLOWED_METHS = ['GET']

Defines the allowed methods for the endpoint.

Only one method from this list may be set at a time. The method setter function validates based on this list.

NetCloudAPI.endpoints.router_logs.ALLOWED_PARAMS = {'created_at': <class 'datetime.datetime'>, 'created_at_timeuuid': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'exception': <class 'str'>, 'level': <class 'str'>, 'message': <class 'str'>, 'reported_at': <class 'datetime.datetime'>, 'router': <class 'int'>, 'sequence': <class 'int'>, 'source': <class 'str'>}

Defines the allowed params for the endpoint.

The params setter function validates based on this dictionary. Keys passed to the setter must belong to the set of keys allowed, and the corresponding value types must match.

NetCloudAPI.endpoints.router_logs.ALLOWED_FILTERS = {'created_at__gt': <class 'datetime.datetime'>, 'created_at__lt': <class 'datetime.datetime'>, 'created_at_timeuuid__gt': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__gte': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__in': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__lt': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__lte': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'router__in': <class 'list'>}

Defines the allowed filters for the endpoint.

The filters setter function validates based on this dictionary, and the related ALLOWED_PARAMS dictionary. All list elements must match the corresponding ALLOWED_PARAMS type for the key preceding the ‘__’ within the ALLOWED_FILTERS dictionary key. A subset of the allowed keys may be passed.

class NetCloudAPI.endpoints.router_logs.RouterLogs(method=None, params=None, filters=None, expands=None, fields=None, paging=None, body=None)

NetCloudAPI.endpoints.router_state_samples provides the RouterStateSamples subclass.

NetCloudAPI.endpoints.router_state_samples.URI = '/api/v2/router_state_samples/'

Defines the uri to append to BASE_URL from NetCloudAPI.req

NetCloudAPI.endpoints.router_state_samples.ALLOWED_METHS = ['GET']

Defines the allowed methods for the endpoint.

Only one method from this list may be set at a time. The method setter function validates based on this list.

NetCloudAPI.endpoints.router_state_samples.ALLOWED_PARAMS = {'created_at': <class 'datetime.datetime'>, 'created_at_timeuuid': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'period': <class 'float'>, 'router': <class 'int'>, 'state': <class 'str'>}

Defines the allowed params for the endpoint.

The params setter function validates based on this dictionary. Keys passed to the setter must belong to the set of keys allowed, and the corresponding value types must match.

NetCloudAPI.endpoints.router_state_samples.ALLOWED_FILTERS = {'created_at__gt': <class 'datetime.datetime'>, 'created_at__lt': <class 'datetime.datetime'>, 'created_at_timeuuid__gt': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__gte': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__in': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__lt': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__lte': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'router__in': <class 'list'>}

Defines the allowed filters for the endpoint.

The filters setter function validates based on this dictionary, and the related ALLOWED_PARAMS dictionary. All list elements must match the corresponding ALLOWED_PARAMS type for the key preceding the ‘__’ within the ALLOWED_FILTERS dictionary key. A subset of the allowed keys may be passed.

class NetCloudAPI.endpoints.router_state_samples.RouterStateSamples(method=None, params=None, filters=None, expands=None, fields=None, paging=None, body=None)

NetCloudAPI.endpoints.router_stream_usage_samples provides the RouterStreamUsageSamples subclass.

NetCloudAPI.endpoints.router_stream_usage_samples.URI = '/api/v2/router_stream_usage_samples/'

Defines the uri to append to BASE_URL from NetCloudAPI.req

NetCloudAPI.endpoints.router_stream_usage_samples.ALLOWED_METHS = ['GET']

Defines the allowed methods for the endpoint.

Only one method from this list may be set at a time. The method setter function validates based on this list.

NetCloudAPI.endpoints.router_stream_usage_samples.ALLOWED_PARAMS = {'bytes_in': <class 'int'>, 'bytes_out': <class 'int'>, 'created_at': <class 'datetime.datetime'>, 'created_at_timeuuid': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'period': <class 'float'>, 'router': <class 'int'>, 'uptime': <class 'float'>}

Defines the allowed params for the endpoint.

The params setter function validates based on this dictionary. Keys passed to the setter must belong to the set of keys allowed, and the corresponding value types must match.

NetCloudAPI.endpoints.router_stream_usage_samples.ALLOWED_FILTERS = {'created_at__gt': <class 'datetime.datetime'>, 'created_at__lt': <class 'datetime.datetime'>, 'created_at_timeuuid__gt': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__gte': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__in': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__lt': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'created_at_timeuuid__lte': <class 'NetCloudAPI.endpoints.endpoint.Unsupported'>, 'router__in': <class 'list'>}

Defines the allowed filters for the endpoint.

The filters setter function validates based on this dictionary, and the related ALLOWED_PARAMS dictionary. All list elements must match the corresponding ALLOWED_PARAMS type for the key preceding the ‘__’ within the ALLOWED_FILTERS dictionary key. A subset of the allowed keys may be passed.

class NetCloudAPI.endpoints.router_stream_usage_samples.RouterStreamUsageSamples(method=None, params=None, filters=None, expands=None, fields=None, paging=None, body=None)

NetCloudAPI.endpoints.routers provides the Routers subclass.

NetCloudAPI.endpoints.routers.URI = '/api/v2/routers/'

Defines the uri to append to BASE_URL from NetCloudAPI.req

NetCloudAPI.endpoints.routers.ALLOWED_METHS = ['GET', 'PUT', 'DELETE']

Defines the allowed methods for the endpoint.

Only one method from this list may be set at a time. The method setter function validates based on this list.

NetCloudAPI.endpoints.routers.ALLOWED_PARAMS = {'account': <class 'int'>, 'actual_firmware': <class 'str'>, 'asset_id': <class 'str'>, 'config_status': <class 'str'>, 'created_at': <class 'datetime.datetime'>, 'custom1': <class 'str'>, 'custom2': <class 'str'>, 'description': <class 'str'>, 'device_type': <class 'str'>, 'full_product_name': <class 'str'>, 'group': <class 'int'>, 'id': <class 'int'>, 'ipv4_address': <class 'str'>, 'locality': <class 'str'>, 'mac': <class 'str'>, 'name': <class 'str'>, 'product': <class 'str'>, 'reboot_required': <class 'bool'>, 'resource_url': <class 'str'>, 'serial_number': <class 'str'>, 'state': <class 'str'>, 'state_updated_at': <class 'datetime.datetime'>, 'target_firmware': <class 'str'>, 'updated_at': <class 'datetime.datetime'>}

Defines the allowed params for the endpoint.

The params setter function validates based on this dictionary. Keys passed to the setter must belong to the set of keys allowed, and the corresponding value types must match.

NetCloudAPI.endpoints.routers.ALLOWED_FILTERS = {'account__in': <class 'list'>, 'device_type__in': <class 'list'>, 'group__in': <class 'list'>, 'id__in': <class 'list'>, 'ipv4_address__in': <class 'list'>, 'mac__in': <class 'list'>, 'name__in': <class 'list'>, 'reboot_required__in': <class 'list'>, 'state__in': <class 'list'>, 'state_updated_at__gt': <class 'datetime.datetime'>, 'state_updated_at__lt': <class 'datetime.datetime'>, 'updated_at__gt': <class 'datetime.datetime'>, 'updated_at__lt': <class 'datetime.datetime'>}

Defines the allowed filters for the endpoint.

The filters setter function validates based on this dictionary, and the related ALLOWED_PARAMS dictionary. All list elements must match the corresponding ALLOWED_PARAMS type for the key preceding the ‘__’ within the ALLOWED_FILTERS dictionary key. A subset of the allowed keys may be passed.

NetCloudAPI.endpoints.routers.ALLOWED_EXPANDS = ['account', 'group']

Defines the allowed expands for the endpoint

The expands setter function validates based on this list, and the passed object must also be a list that is a set of the ALLOWED_EXPANDS values.

class NetCloudAPI.endpoints.routers.Routers(method=None, params=None, filters=None, expands=None, fields=None, paging=None, body=None)

Indices and tables