mbed_cloud.sdk.sdk module¶
SDK Interface¶
This provides a single point of entry to use the Primary, Foundation and Client interfaces. It allows the configuration and other context information to be shared between instances.
This is the preferred method of creating Foundation Entity instances and using the Client Interface:
-
class
mbed_cloud.sdk.sdk.
SDK
(config=None, api_key=None, host=None)¶ Bases:
object
Create a new SDK instance
If configuration is not supplied then the default configuration from a .env file or environment variables will be used. For more information please see
mbed_cloud.sdk.config
.Parameters: - config (mbed_cloud.sdk.config.Config) – (optional) An SDK configuration object, this will override settings in environment variables or .env files.
- api_key (str) – (optional) API Key to use for Authentication, if provided this will override all other configuration
- host (str) – (optional) Host of the Pelion Device Management API, if provided this will override all other configuration
-
client
¶ Client Interface, which can be use for direct communication with the Pelion Device Management API
Returns: Client Interface. Return type: mbed_cloud.client.client.Client
-
config
¶ Configuration in use by SDK instance.
Returns: Configuration object. Return type: mbed_cloud.sdk.config.Config
-
foundation
¶ Foundation Interface Entities
This provides access to all Entities in the Foundation Interface via the returned factory class.
Returns: Foundation Interface entity factory. Return type: mbed_cloud.foundation.entities.entity_factory.EntityFactory
-
mbed_cloud.sdk.sdk.
check_openssl_version
()¶ Utility function to check that the OpenSSL version is recent enough
-
mbed_cloud.sdk.sdk.
get_or_create_global_sdk_instance
()¶ For simple use cases, a single global SDK is sufficient