mbed_cloud.core module

Core functionality for the SDK

class mbed_cloud.core.ApiMetadata(url, method, response=None, response_data=None, exception=None)

Bases: object

Api meta data.

date

Date of the API response.

Return type:datetime
error_message

Error message.

Return type:str
etag

Etag of the returned data.

Return type:str
headers

Headers in the API response.

Return type:list
method

Method of the API request.

Return type:str
object

Object type of the returned data.

Return type:str
request_id

Request ID of the transaction.

Return type:str
status_code

HTTP Status code of the API response.

Return type:int
to_dict()

Return dictionary of object.

url

URL of the API request.

Return type:str
class mbed_cloud.core.BaseAPI(params=None)

Bases: object

BaseAPI is parent class for all APIs. Ensuring config is valid and available.

api_structure = {}
get_last_api_metadata()

Get meta data for the last Pelion Device Management API call.

Returns:meta data of the last Pelion Device Management API call
Return type:ApiMetadata
class mbed_cloud.core.BaseObject(dictionary)

Bases: object

Base class for APIs classes.

to_dict()

Return dictionary of object.

update_attributes(updates)

Update attributes.

class mbed_cloud.core.StubAPI(params)

Bases: mbed_cloud.core.BaseAPI

Used in test framework

exception()

Raises an exception

success(**kwargs)

Returns all arguments received in init and this method call