mbed_cloud.foundation package

Foundation Interface

The Foundation Interface consists of a number of Entities which are a representation of resources in the API. Entities are grouped into categories to aid discovery and indicate associated functionality.

Note

Entities should be imported via this module as the organisation of the categories may change in the future.

Enums

Some Foundation Interface Entities have attributes which use enumerations, please see the mbed_cloud.foundation.enums for more information.

Entity Usage and Importing

The recommended way of working with Entities is via the SDK Interface which will return an instance of an Entity which will share the same context as other Entities. There is more information in the mbed_cloud.sdk.sdk module.

from mbed_cloud import SDK

pelion_dm_sdk = SDK()

accounts = pelion_dm_sdk.foundation.account()
active_sessions = pelion_dm_sdk.foundation.active_session()
api_keys = pelion_dm_sdk.foundation.api_key()
login_historys = pelion_dm_sdk.foundation.login_history()
login_profiles = pelion_dm_sdk.foundation.login_profile()
parent_accounts = pelion_dm_sdk.foundation.parent_account()
password_policys = pelion_dm_sdk.foundation.password_policy()
policys = pelion_dm_sdk.foundation.policy()
subtenant_api_keys = pelion_dm_sdk.foundation.subtenant_api_key()
subtenant_users = pelion_dm_sdk.foundation.subtenant_user()
subtenant_user_invitations = pelion_dm_sdk.foundation.subtenant_user_invitation()
users = pelion_dm_sdk.foundation.user()
user_invitations = pelion_dm_sdk.foundation.user_invitation()
dark_theme_colors = pelion_dm_sdk.foundation.dark_theme_color()
dark_theme_images = pelion_dm_sdk.foundation.dark_theme_image()
light_theme_colors = pelion_dm_sdk.foundation.light_theme_color()
light_theme_images = pelion_dm_sdk.foundation.light_theme_image()
subtenant_dark_theme_colors = pelion_dm_sdk.foundation.subtenant_dark_theme_color()
subtenant_dark_theme_images = pelion_dm_sdk.foundation.subtenant_dark_theme_image()
subtenant_light_theme_colors = pelion_dm_sdk.foundation.subtenant_light_theme_color()
subtenant_light_theme_images = pelion_dm_sdk.foundation.subtenant_light_theme_image()
campaign_device_metadatas = pelion_dm_sdk.foundation.campaign_device_metadata()
campaign_statisticss = pelion_dm_sdk.foundation.campaign_statistics()
campaign_statistics_eventss = pelion_dm_sdk.foundation.campaign_statistics_events()
firmware_images = pelion_dm_sdk.foundation.firmware_image()
firmware_manifests = pelion_dm_sdk.foundation.firmware_manifest()
update_campaigns = pelion_dm_sdk.foundation.update_campaign()
devices = pelion_dm_sdk.foundation.device()
device_enrollments = pelion_dm_sdk.foundation.device_enrollment()
device_enrollment_bulk_creates = pelion_dm_sdk.foundation.device_enrollment_bulk_create()
device_enrollment_bulk_deletes = pelion_dm_sdk.foundation.device_enrollment_bulk_delete()
device_enrollment_denials = pelion_dm_sdk.foundation.device_enrollment_denial()
device_eventss = pelion_dm_sdk.foundation.device_events()
device_groups = pelion_dm_sdk.foundation.device_group()
certificate_enrollments = pelion_dm_sdk.foundation.certificate_enrollment()
certificate_issuers = pelion_dm_sdk.foundation.certificate_issuer()
certificate_issuer_configs = pelion_dm_sdk.foundation.certificate_issuer_config()
developer_certificates = pelion_dm_sdk.foundation.developer_certificate()
pre_shared_keys = pelion_dm_sdk.foundation.pre_shared_key()
server_credentialss = pelion_dm_sdk.foundation.server_credentials()
subtenant_trusted_certificates = pelion_dm_sdk.foundation.subtenant_trusted_certificate()
trusted_certificates = pelion_dm_sdk.foundation.trusted_certificate()
verification_responses = pelion_dm_sdk.foundation.verification_response()

How to import Entities directly:

from mbed_cloud.foundation import Account
from mbed_cloud.foundation import ActiveSession
from mbed_cloud.foundation import ApiKey
from mbed_cloud.foundation import LoginHistory
from mbed_cloud.foundation import LoginProfile
from mbed_cloud.foundation import ParentAccount
from mbed_cloud.foundation import PasswordPolicy
from mbed_cloud.foundation import Policy
from mbed_cloud.foundation import SubtenantApiKey
from mbed_cloud.foundation import SubtenantUser
from mbed_cloud.foundation import SubtenantUserInvitation
from mbed_cloud.foundation import User
from mbed_cloud.foundation import UserInvitation
from mbed_cloud.foundation import DarkThemeColor
from mbed_cloud.foundation import DarkThemeImage
from mbed_cloud.foundation import LightThemeColor
from mbed_cloud.foundation import LightThemeImage
from mbed_cloud.foundation import SubtenantDarkThemeColor
from mbed_cloud.foundation import SubtenantDarkThemeImage
from mbed_cloud.foundation import SubtenantLightThemeColor
from mbed_cloud.foundation import SubtenantLightThemeImage
from mbed_cloud.foundation import CampaignDeviceMetadata
from mbed_cloud.foundation import CampaignStatistics
from mbed_cloud.foundation import CampaignStatisticsEvents
from mbed_cloud.foundation import FirmwareImage
from mbed_cloud.foundation import FirmwareManifest
from mbed_cloud.foundation import UpdateCampaign
from mbed_cloud.foundation import Device
from mbed_cloud.foundation import DeviceEnrollment
from mbed_cloud.foundation import DeviceEnrollmentBulkCreate
from mbed_cloud.foundation import DeviceEnrollmentBulkDelete
from mbed_cloud.foundation import DeviceEnrollmentDenial
from mbed_cloud.foundation import DeviceEvents
from mbed_cloud.foundation import DeviceGroup
from mbed_cloud.foundation import CertificateEnrollment
from mbed_cloud.foundation import CertificateIssuer
from mbed_cloud.foundation import CertificateIssuerConfig
from mbed_cloud.foundation import DeveloperCertificate
from mbed_cloud.foundation import PreSharedKey
from mbed_cloud.foundation import ServerCredentials
from mbed_cloud.foundation import SubtenantTrustedCertificate
from mbed_cloud.foundation import TrustedCertificate
from mbed_cloud.foundation import VerificationResponse

class mbed_cloud.foundation.Account(_client=None, address_line1=None, address_line2=None, admin_email=None, admin_full_name=None, admin_id=None, admin_key=None, admin_name=None, admin_password=None, aliases=None, city=None, company=None, contact=None, contract_number=None, country=None, created_at=None, custom_fields=None, customer_number=None, display_name=None, email=None, end_market=None, expiration=None, expiration_warning_threshold=None, id=None, idle_timeout=None, limits=None, mfa_status=None, notification_emails=None, parent_account=None, parent_id=None, password_policy=None, password_recovery_expiration=None, phone_number=None, policies=None, postal_code=None, reason=None, reference_note=None, sales_contact=None, state=None, status=None, template_id=None, tier=None, updated_at=None, upgraded_at=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local Account instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • address_line1 (str) – Postal address line 1.
  • address_line2 (str) – Postal address line 2.
  • admin_email (str) – The email address of the admin user created for this account. Present only in the response for account creation.
  • admin_full_name (str) – The full name of the admin user created for this account. Present only in the response for account creation.
  • admin_id (str) – The ID of the admin user created for this account.
  • admin_key (str) – The admin API key created for this account. Present only in the response for account creation.
  • admin_name (str) – The username of the admin user created for this account. Present only in the response for account creation.
  • admin_password (str) – The password of the admin user created for this account. Present only in the response for account creation.
  • aliases (list) – An array of aliases.
  • city (str) – The city part of the postal address.
  • company (str) – The name of the company.
  • contact (str) – The name of the contact person for this account.
  • contract_number (str) – Contract number of the customer.
  • country (str) – The country part of the postal address.
  • created_at (datetime) – Creation UTC time RFC3339.
  • custom_fields (dict) – Account’s custom properties as key-value pairs.
  • customer_number (str) – Customer number of the customer.
  • display_name (str) – The display name for the account.
  • email (str) – The company email address for this account.
  • end_market (str) – (Required) Account end market.
  • expiration (datetime) – Expiration time of the account, as UTC time RFC3339.
  • expiration_warning_threshold (int) – Indicates how many days (1-180) before account expiration a notification email is sent.
  • id (str) – (Required) Account ID.
  • idle_timeout (int) – The reference token expiration time, in minutes, for this account.
  • limits (dict) – List of limits as key-value pairs if requested.
  • mfa_status (str) – The enforcement status of multi-factor authentication, either enforced or optional.
  • notification_emails (list) – A list of notification email addresses.
  • parent_account (dict) – Represents parent account contact details in responses.
  • parent_id (str) – The ID of the parent account, if any.
  • password_policy (dict) – The password policy for this account.
  • password_recovery_expiration (int) – Indicates for how many minutes a password recovery email is valid.
  • phone_number (str) – The phone number of a company representative.
  • policies (list) – List of policies if requested.
  • postal_code (str) – The postal code part of the postal address.
  • reason (str) – A note with the reason for account status update.
  • reference_note (str) – A reference note for updating the status of the account.
  • sales_contact (str) – Email address of the sales contact.
  • state (str) – The state part of the postal address.
  • status (str) – The status of the account.
  • template_id (str) – Account template ID.
  • tier (str) – The tier level of the account; 0: free tier, 1: commercial account, 2: partner tier. Other values are reserved for the future.
  • updated_at (datetime) – Last update UTC time RFC3339.
  • upgraded_at (datetime) – Time when upgraded to commercial account in UTC format RFC3339.
address_line1

Postal address line 1.

api example: ‘110 Fulbourn Rd’

Return type:str
address_line2

Postal address line 2.

api example: ‘ ‘

Return type:str
admin_email

The email address of the admin user created for this account. Present only in the response for account creation.

api example: ‘admin@arm.com

Return type:str
admin_full_name

The full name of the admin user created for this account. Present only in the response for account creation.

api example: ‘Admin Doe’

Return type:str
admin_id

The ID of the admin user created for this account.

api example: ‘01619571e2e89242ac12000600000000’

Return type:str
admin_key

The admin API key created for this account. Present only in the response for account creation.

api example: ‘ak_1MDE2MTk1NzFmNmU4MDI0MmFjMTIwMDA2MDAwMDAwMDA01619571f7020242ac120006000000
00B40IkJADMANmAscAj0Ot0n2yeQnyt9tT’
Return type:str
admin_name

The username of the admin user created for this account. Present only in the response for account creation.

api example: ‘admin’

Return type:str
admin_password

The password of the admin user created for this account. Present only in the response for account creation.

api example: ‘PZf9eEUH43DAPE9ULINFeuj’

Return type:str
aliases

An array of aliases.

Return type:list
api_keys(filter=None, order=’ASC’, max_results=None, page_size=50, include=None)

Get all API keys.

REST API Documentation.

API Filters

The following filters are supported by the API when listing Account entities:

Field eq neq gte lte in nin like
key Y            
owner Y            

Example Usage

from mbed_cloud.foundation import Account
from mbed_cloud import ApiFilter

api_filter = ApiFilter()
api_filter.add_filter("key", "eq", <filter value>)
for api_key in Account().api_keys(filter=api_filter):
    print(api_key.key)
Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – An optional filter to apply when listing entities, please see the above API Filters table for supported filters.
  • order (str) – Record order based on creation time. Acceptable values: ASC, DESC. Default: ASC.
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return (2-1000). Default 50.
  • include (str) – Comma-separated additional data to return. Currently supported: total_count.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(SubtenantApiKey)

city

The city part of the postal address.

api example: ‘Cambridge’

Return type:str
company

The name of the company.

api example: ‘ARM Holdings Plc’

Return type:str
contact

The name of the contact person for this account.

api example: ‘J. Doe’

Return type:str
contract_number

Contract number of the customer.

api example: ‘1NX25_0001’

Return type:str
country

The country part of the postal address.

api example: ‘United Kingdom’

Return type:str
create(action=’create’)

Create a new account.

REST API Documentation.

Parameters:action (str) – Action, either create or enroll. <ul> <li>`create` creates the account where its admin user has ACTIVE status if admin_password was defined in the request, or RESET status if no admin_password was defined. If the user already exists, its status is not modified. </li> <li>`enroll` creates the account where its admin user has ENROLLING status. If the user already exists, its status is not modified. Email to finish enrollment or notify the existing user about the new account is sent to the admin_email defined in the request. </li></ul>
Return type:Account
created_at

Creation UTC time RFC3339.

api example: ‘2018-02-13T09:35:20Z’

Return type:datetime
custom_fields

Account’s custom properties as key-value pairs.

Return type:dict
customer_number

Customer number of the customer.

api example: ‘1NC25_0001’

Return type:str
dark_theme_branding_colors(filter=None, order=None, max_results=None, page_size=None, include=None)

Get dark theme branding colors.

REST API Documentation.

Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – Filtering when listing entities is not supported by the API for this entity.
  • order (str) – The order of the records based on creation time, ASC or DESC. Default value is ASC
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return for each page.
  • include (str) – Comma separated additional data to return.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(SubtenantDarkThemeColor)

dark_theme_branding_images(filter=None, order=None, max_results=None, page_size=None, include=None)

Get metadata of all dark theme images.

REST API Documentation.

Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – Filtering when listing entities is not supported by the API for this entity.
  • order (str) – The order of the records based on creation time, ASC or DESC. Default value is ASC
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return for each page.
  • include (str) – Comma separated additional data to return.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(SubtenantDarkThemeImage)

display_name

The display name for the account.

api example: ‘ARM’

Return type:str
email

The company email address for this account.

api example: ‘info@arm.com

Return type:str
end_market

Account end market.

This field must be set when creating a new Account Entity.

api example: ‘IT’

Return type:str
expiration

Expiration time of the account, as UTC time RFC3339.

Return type:datetime
expiration_warning_threshold

Indicates how many days (1-180) before account expiration a notification email is sent.

api example: ‘180’

Return type:int
id

Account ID.

This field must be set when updating or deleting an existing Account Entity.

api example: ‘01619571e2e90242ac12000600000000’

Return type:str
idle_timeout

The reference token expiration time, in minutes, for this account.

api example: ‘30’

Return type:int
light_theme_branding_colors(filter=None, order=None, max_results=None, page_size=None, include=None)

Get light theme branding colors.

REST API Documentation.

Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – Filtering when listing entities is not supported by the API for this entity.
  • order (str) – The order of the records based on creation time, ASC or DESC. Default value is ASC
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return for each page.
  • include (str) – Comma separated additional data to return.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(SubtenantLightThemeColor)

light_theme_branding_images(filter=None, order=None, max_results=None, page_size=None, include=None)

Get metadata of all light theme images.

REST API Documentation.

Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – Filtering when listing entities is not supported by the API for this entity.
  • order (str) – The order of the records based on creation time, ASC or DESC. Default value is ASC
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return for each page.
  • include (str) – Comma separated additional data to return.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(SubtenantLightThemeImage)

limits

List of limits as key-value pairs if requested.

Return type:dict
list(filter=None, order=’ASC’, max_results=None, page_size=1000, include=None, format=None, properties=None)

Get all accounts.

REST API Documentation.

API Filters

The following filters are supported by the API when listing Account entities:

Field eq neq gte lte in nin like
country             Y
end_market Y            
parent Y            
status Y       Y Y  
tier Y            

Example Usage

from mbed_cloud.foundation import Account
from mbed_cloud import ApiFilter

api_filter = ApiFilter()
api_filter.add_filter("country", "like", <filter value>)
for account in Account().list(filter=api_filter):
    print(account.country)
Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – An optional filter to apply when listing entities, please see the above API Filters table for supported filters.
  • order (str) – Record order. Acceptable values: ASC, DESC. Default: ASC.
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return (2-1000). Default 1000.
  • include (str) – Comma-separated additional data to return. Currently supported: limits, policies, sub_accounts.
  • format (str) – Format information for the query response. Supported: format=breakdown.
  • properties (str) – Property name returned from account-specific properties.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(Account)

me(include=None, properties=None)

Get account info.

REST API Documentation.

Parameters:
  • include (str) – Comma-separated additional data to return. Currently supported: limits, policies, sub_accounts.
  • properties (str) – Property name to return from account-specific properties.
Return type:

Account

mfa_status

The enforcement status of multi-factor authentication, either enforced or optional.

Return type:str
notification_emails

A list of notification email addresses.

Return type:list
parent_account

Represents parent account contact details in responses.

Return type:dict[ParentAccount]
parent_id

The ID of the parent account, if any.

api example: ‘01619571dad80242ac12000600000000’

Return type:str
password_policy

The password policy for this account.

Return type:dict[PasswordPolicy]
password_recovery_expiration

Indicates for how many minutes a password recovery email is valid.

Return type:int
phone_number

The phone number of a company representative.

api example: ‘+44 (1223) 400 400’

Return type:str
policies

List of policies if requested.

Return type:list[Policy]
postal_code

The postal code part of the postal address.

api example: ‘CB1 9NJ’

Return type:str
read(include=None, properties=None)

Get account info.

REST API Documentation.

Parameters:
  • include (str) – Comma-separated additional data to return. Currently supported: limits, policies, sub_accounts.
  • properties (str) – Property name to return from account-specific properties.
Return type:

Account

reason

A note with the reason for account status update.

api example: ‘Subscription paid.’

Return type:str
reference_note

A reference note for updating the status of the account.

api example: ‘ARM-INT-0001’

Return type:str
sales_contact

Email address of the sales contact.

api example: ‘sales@arm.com

Return type:str
state

The state part of the postal address.

api example: ‘ ‘

Return type:str
status

The status of the account.

api example: ‘ACTIVE’

Return type:str
template_id

Account template ID.

api example: ‘01619571e7160242ac12000600000000’

Return type:str
tier

The tier level of the account; 0: free tier, 1: commercial account, 2: partner tier. Other values are reserved for the future.

api example: ‘1’

Return type:str
trusted_certificates(filter=None, order=’ASC’, max_results=None, page_size=50, include=None)

Get all trusted certificates.

REST API Documentation.

API Filters

The following filters are supported by the API when listing Account entities:

Field eq neq gte lte in nin like
device_execution_mode Y Y          
enrollment_mode Y            
expire Y            
issuer             Y
name Y            
owner Y            
service Y            
status Y            
subject             Y
valid Y            

Example Usage

from mbed_cloud.foundation import Account
from mbed_cloud import ApiFilter

api_filter = ApiFilter()
api_filter.add_filter("device_execution_mode", "eq", <filter value>)
for trusted_certificate in Account().trusted_certificates(filter=api_filter):
    print(trusted_certificate.device_execution_mode)
Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – An optional filter to apply when listing entities, please see the above API Filters table for supported filters.
  • order (str) – Record order based on creation time. Acceptable values: ASC, DESC. Default: ASC.
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return (2-1000). Default 50.
  • include (str) – Comma-separated additional data to return. Currently supported: total_count.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(SubtenantTrustedCertificate)

update()

Update attributes of an existing account.

REST API Documentation.

Return type:Account
updated_at

Last update UTC time RFC3339.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
upgraded_at

Time when upgraded to commercial account in UTC format RFC3339.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
user_invitations(filter=None, order=’ASC’, max_results=None, page_size=50, include=None)

Get the details of all user invitations.

REST API Documentation.

API Filters

The following filters are supported by the API when listing Account entities:

Field eq neq gte lte in nin like
login_profiles Y            

Example Usage

from mbed_cloud.foundation import Account
from mbed_cloud import ApiFilter

api_filter = ApiFilter()
api_filter.add_filter("login_profiles", "eq", <filter value>)
for user_invitation in Account().user_invitations(filter=api_filter):
    print(user_invitation.login_profiles)
Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – An optional filter to apply when listing entities, please see the above API Filters table for supported filters.
  • order (str) – Record order based on creation time. Acceptable values: ASC, DESC. Default: ASC.
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return (2-1000). Default 50.
  • include (str) – Comma separated additional data to return.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(SubtenantUserInvitation)

users(filter=None, order=’ASC’, max_results=None, page_size=50, include=None)

Get the details of all users.

REST API Documentation.

API Filters

The following filters are supported by the API when listing Account entities:

Field eq neq gte lte in nin like
email Y            
login_profiles Y            
status Y       Y Y  

Example Usage

from mbed_cloud.foundation import Account
from mbed_cloud import ApiFilter

api_filter = ApiFilter()
api_filter.add_filter("email", "eq", <filter value>)
for user in Account().users(filter=api_filter):
    print(user.email)
Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – An optional filter to apply when listing entities, please see the above API Filters table for supported filters.
  • order (str) – Record order based on creation time. Acceptable values: ASC, DESC. Default: ASC.
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return (2-1000). Default 50.
  • include (str) – Comma-separated additional data to return. Currently supported: total_count.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(SubtenantUser)

class mbed_cloud.foundation.ActiveSession(_client=None, account_id=None, ip_address=None, login_time=None, reference_token=None, user_agent=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local ActiveSession instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • account_id (str) – The UUID of the account.
  • ip_address (str) – IP address of the client.
  • login_time (datetime) – The login time of the user.
  • reference_token (str) – The reference token.
  • user_agent (str) – User Agent header from the login request.
account_id

The UUID of the account.

api example: ‘01619571e2e90242ac12000600000000’

Return type:str
ip_address

IP address of the client.

api example: ‘127.0.0.1’

Return type:str
login_time

The login time of the user.

api example: ‘2018-02-14T17:52:07Z’

Return type:datetime
reference_token

The reference token.

api example: ‘rt_CI6+5hS8p9DrCmkRyS6u4doUdiXr71dX7MqD+g0327hYQthEkYTxMMnCwHyf1rDdk’

Return type:str
user_agent

User Agent header from the login request.

api example: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/41.0.2227.1 Safari/537.36’
Return type:str
class mbed_cloud.foundation.ApiKey(_client=None, account_id=None, created_at=None, creation_time=None, id=None, key=None, last_login_time=None, name=None, owner=None, status=None, updated_at=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local ApiKey instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • account_id (str) – The ID of the account.
  • created_at (datetime) – Creation UTC time RFC3339.
  • creation_time (int) – The timestamp of the API key creation in the storage, in milliseconds.
  • id (str) – (Required) The ID of the API key.
  • key (str) – The API key.
  • last_login_time (int) – The timestamp of the latest API key usage, in milliseconds.
  • name (str) – (Required) The display name for the API key.
  • owner (str) – The owner of this API key, who is the creator by default.
  • status (str) – The status of the API key.
  • updated_at (datetime) – Last update UTC time RFC3339.
account_id

The ID of the account.

api example: ‘01619571e2e90242ac12000600000000’

Return type:str
create()

Create a new API key.

REST API Documentation.

Return type:ApiKey
created_at

Creation UTC time RFC3339.

api example: ‘2018-02-13T09:35:20Z’

Return type:datetime
creation_time

The timestamp of the API key creation in the storage, in milliseconds.

api example: 1518630727683

Return type:int
delete()

Delete API key.

REST API Documentation.

Return type:ApiKey
id

The ID of the API key.

This field must be set when updating or deleting an existing ApiKey Entity.

api example: ‘01619571f7020242ac12000600000000’

Return type:str
key

The API key.

api example: ‘ak_1MDE2MTk1NzFmNmU4MDI0MmFjMTIwMDA2MDAwMDAwMDA01619571f7020242ac120006000000
00’
Return type:str
last_login_time

The timestamp of the latest API key usage, in milliseconds.

api example: 1518630727688

Return type:int
list(filter=None, order=’ASC’, max_results=None, page_size=50, include=None)

Get all API keys.

REST API Documentation.

API Filters

The following filters are supported by the API when listing ApiKey entities:

Field eq neq gte lte in nin like
key Y            
owner Y            

Example Usage

from mbed_cloud.foundation import ApiKey
from mbed_cloud import ApiFilter

api_filter = ApiFilter()
api_filter.add_filter("key", "eq", <filter value>)
for api_key in ApiKey().list(filter=api_filter):
    print(api_key.key)
Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – An optional filter to apply when listing entities, please see the above API Filters table for supported filters.
  • order (str) – Record order based on creation time. Acceptable values: ASC, DESC. Default: ASC.
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return (2-1000). Default 50.
  • include (str) – Comma-separated additional data to return. Currently supported: total_count.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(ApiKey)

me()

Get API key details.

REST API Documentation.

Return type:ApiKey
name

The display name for the API key.

This field must be set when creating a new ApiKey Entity.

api example: ‘API key gorgon’

Return type:str
owner

The owner of this API key, who is the creator by default.

api example: ‘01619571e2e89242ac12000600000000’

Return type:str
read()

Get API key details.

REST API Documentation.

Return type:ApiKey
status

The status of the API key.

api example: ‘ACTIVE’

Return type:str
update()

Update API key details.

REST API Documentation.

Return type:ApiKey
updated_at

Last update UTC time RFC3339.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
class mbed_cloud.foundation.CampaignDeviceMetadata(_client=None, campaign_id=None, created_at=None, deployment_state=None, description=None, device_id=None, id=None, mechanism=None, mechanism_url=None, name=None, updated_at=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local CampaignDeviceMetadata instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • campaign_id (str) – (Required) The device’s campaign ID
  • created_at (datetime) – The time the campaign was created
  • deployment_state (str) – The state of the update campaign on the device
  • description (str) – Description
  • device_id (str) – The device ID
  • id (str) – (Required) The metadata record ID
  • mechanism (str) – How the firmware is delivered (connector or direct)
  • mechanism_url (str) – The Device Management Connect URL
  • name (str) – The record name
  • updated_at (datetime) – The record was modified in the database format: date-time
campaign_id

The device’s campaign ID

This field must be set when creating a new CampaignDeviceMetadata Entity.

api example: ‘015bf72fccda00000000000100100280’

Return type:str
created_at

The time the campaign was created

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
deployment_state

The state of the update campaign on the device

Return type:str
description

Description

Return type:str
device_id

The device ID

api example: ‘015c2fec9bba0000000000010010036f’

Return type:str
id

The metadata record ID

This field must be set when updating or deleting an existing CampaignDeviceMetadata Entity.

api example: ‘015c3029f6f7000000000001001000c3’

Return type:str
mechanism

How the firmware is delivered (connector or direct)

api example: ‘connector’

Return type:str
mechanism_url

The Device Management Connect URL

Return type:str
name

The record name

api example: ‘default_object_name’

Return type:str
read()

Get a campaign device metadata

REST API Documentation.

Return type:CampaignDeviceMetadata
updated_at

The record was modified in the database format: date-time

api example: ‘2017-05-22T12:37:58.776736Z’

Return type:datetime
class mbed_cloud.foundation.CampaignStatistics(_client=None, campaign_id=None, count=None, created_at=None, id=None, summary_status=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local CampaignStatistics instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • campaign_id (str) – (Required) ID of the associated campaign.
  • count (int) –
  • created_at (datetime) –
  • id (str) – (Required) ID of the event type description
  • summary_status (str) – The event type description.
campaign_id

ID of the associated campaign.

This field must be set when creating a new CampaignStatistics Entity.

api example: ‘00000000000000000000000000000000’

Return type:str
count

api example: 10

Return type:int
created_at

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
events(filter=None, order=None, max_results=None, page_size=None, include=None)

Get a list of events grouped by summary

REST API Documentation.

Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – Filtering when listing entities is not supported by the API for this entity.
  • order (str) – The order of the records based on creation time, ASC or DESC. Default value is ASC
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return for each page.
  • include (str) – Comma separated additional data to return.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(CampaignStatisticsEvents)

id

ID of the event type description

This field must be set when updating or deleting an existing CampaignStatistics Entity.

api example: ‘fail’

Return type:str
list(filter=None, order=None, max_results=None, page_size=None, include=None)

Get a list of statistics for a campaign

REST API Documentation.

Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – Filtering when listing entities is not supported by the API for this entity.
  • order (str) – The order of the records based on creation time, ASC or DESC. Default value is ASC
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return for each page.
  • include (str) – Comma separated additional data to return.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(CampaignStatistics)

read()

Get a summary status

REST API Documentation.

Return type:CampaignStatistics
summary_status

The event type description.

api example: ‘FAIL’

Return type:str
class mbed_cloud.foundation.CampaignStatisticsEvents(_client=None, campaign_id=None, count=None, created_at=None, description=None, event_type=None, id=None, summary_status=None, summary_status_id=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local CampaignStatisticsEvents instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • campaign_id (str) – (Required) ID of the associated campaign.
  • count (int) –
  • created_at (datetime) –
  • description (str) –
  • event_type (str) –
  • id (str) – (Required)
  • summary_status (str) –
  • summary_status_id (str) – (Required)
campaign_id

ID of the associated campaign.

This field must be set when creating a new CampaignStatisticsEvents Entity.

api example: ‘00000000000000000000000000000000’

Return type:str
count

api example: 10

Return type:int
created_at

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
description

api example: ‘Update error, nonspecific network error’

Return type:str
event_type

api example: ‘UPD4_FAIL_101’

Return type:str
id

This field must be set when updating or deleting an existing CampaignStatisticsEvents Entity.

api example: ‘upd_fail_101’

Return type:str
read()

Get an event type for a campaign

REST API Documentation.

Return type:CampaignStatisticsEvents
summary_status

api example: ‘FAIL’

Return type:str
summary_status_id

This field must be set when creating a new CampaignStatisticsEvents Entity.

api example: ‘fail’

Return type:str
class mbed_cloud.foundation.CertificateEnrollment(_client=None, certificate_name=None, created_at=None, device_id=None, enroll_result=None, enroll_result_detail=None, enroll_status=None, id=None, updated_at=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local CertificateEnrollment instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • certificate_name (str) – The certificate name.
  • created_at (datetime) – Creation UTC time RFC3339.
  • device_id (str) – The device ID.
  • enroll_result (str) – The result of certificate enrollment request.
  • enroll_result_detail (str) – Additional information in case of failure.
  • enroll_status (str) – The status of certificate enrollment request.
  • id (str) – (Required) The certificate enrollment ID.
  • updated_at (datetime) – Update UTC time RFC3339.
certificate_name

The certificate name.

api example: ‘customer.dlms’

Return type:str
created_at

Creation UTC time RFC3339.

api example: ‘2017-01-01T00:00:00Z’

Return type:datetime
device_id

The device ID.

api example: ‘01625daa23230a580a0100bd00000000’

Return type:str
enroll_result

The result of certificate enrollment request.

api example: ‘success’

Return type:str
enroll_result_detail

Additional information in case of failure.

api example: ‘The device is currently processing too many certificate renewals.’

Return type:str
enroll_status

The status of certificate enrollment request.

Return type:str
id

The certificate enrollment ID.

This field must be set when updating or deleting an existing CertificateEnrollment Entity.

api example: ‘01612df56f3b0a580a010fc700000000’

Return type:str
list(filter=None, order=None, max_results=None, page_size=None, include=None)

Get certificate enrollments list.

REST API Documentation.

API Filters

The following filters are supported by the API when listing CertificateEnrollment entities:

Field eq neq gte lte in nin like
certificate_name Y            
created_at     Y Y      
device_id Y            
enroll_result Y Y          
enroll_status Y Y          
updated_at     Y Y      

Example Usage

from mbed_cloud.foundation import CertificateEnrollment
from mbed_cloud import ApiFilter

api_filter = ApiFilter()
api_filter.add_filter("certificate_name", "eq", <filter value>)
for certificate_enrollment in CertificateEnrollment().list(filter=api_filter):
    print(certificate_enrollment.certificate_name)
Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – An optional filter to apply when listing entities, please see the above API Filters table for supported filters.
  • order (str) – The order of results.
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return (2-1000).
  • include (str) – a comma-separated list of data fields to return.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(CertificateEnrollment)

read()

Get a certificate enrollment by ID.

REST API Documentation.

Return type:CertificateEnrollment
updated_at

Update UTC time RFC3339.

api example: ‘2017-01-01T00:00:00Z’

Return type:datetime
class mbed_cloud.foundation.CertificateIssuer(_client=None, created_at=None, description=None, id=None, issuer_attributes=None, issuer_type=None, name=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local CertificateIssuer instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • created_at (datetime) – Creation UTC time RFC3339.
  • description (str) – General description for the certificate issuer.
  • id (str) – (Required) The ID of the certificate issuer.
  • issuer_attributes (dict) – General attributes for connecting the certificate issuer. When the issuer_type is GLOBAL_SIGN, the value shall be empty. When the issuer_type is CFSSL_AUTH, see definition of CfsslAttributes.
  • issuer_type (str) –

    (Required) The type of the certificate issuer. - GLOBAL_SIGN:

    Certificates

    are issued by GlobalSign service. The users must provide their own GlobalSign account credentials. - CFSSL_AUTH:

    Certificates are
    issued by CFSSL authenticated signing service.
    The users must

    provide their own CFSSL host_url and credentials.

  • name (str) – (Required) Certificate issuer name, unique per account.
create(issuer_credentials)

Create certificate issuer.

REST API Documentation.

Parameters:issuer_credentials (dict) – The credentials required for connecting to the certificate issuer. When the issuer_type is GLOBAL_SIGN, see definition of GlobalSignCredentials. When the issuer_type is CFSSL_AUTH, see definition of CfsslAuthCredentials.
Return type:CertificateIssuer
created_at

Creation UTC time RFC3339.

api example: ‘2017-01-01T00:00:00Z’

Return type:datetime
delete()

Delete certificate issuer.

REST API Documentation.

Return type:CertificateIssuer
description

General description for the certificate issuer.

api example: ‘GlobalSign sample issuer’

Return type:str
id

The ID of the certificate issuer.

This field must be set when updating or deleting an existing CertificateIssuer Entity.

api example: ‘01234567890ABCDEF01234567890ABCDEF’

Return type:str
issuer_attributes

General attributes for connecting the certificate issuer. When the issuer_type is GLOBAL_SIGN, the value shall be empty. When the issuer_type is CFSSL_AUTH, see definition of CfsslAttributes.

Return type:dict
issuer_type

The type of the certificate issuer. - GLOBAL_SIGN:

Certificates are issued

by GlobalSign service. The users must provide their own GlobalSign account credentials. - CFSSL_AUTH:

Certificates are issued by CFSSL authenticated
signing service.
The users must provide their own CFSSL host_url and

credentials.

This field must be set when creating a new CertificateIssuer Entity.

api example: ‘GLOBAL_SIGN’

Return type:str
list(filter=None, order=None, max_results=None, page_size=None, include=None)

Get certificate issuers list.

REST API Documentation.

Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – Filtering when listing entities is not supported by the API for this entity.
  • order (str) – The order of the records based on creation time, ASC or DESC; by default ASC.
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – How many objects to retrieve in the page. The minimum limit is 2 and the maximum is 1000. Limit values outside of this range are set to the closest limit.
  • include (str) – Comma-separated list of data fields to return. Currently supported: total_count
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(CertificateIssuer)

name

Certificate issuer name, unique per account.

This field must be set when creating a new CertificateIssuer Entity.

api example: ‘GS Issuer’

Return type:str
read()

Get certificate issuer by ID.

REST API Documentation.

Return type:CertificateIssuer
update(issuer_credentials=None)

Update certificate issuer.

REST API Documentation.

Parameters:issuer_credentials (dict) – The credentials required for connecting to the certificate issuer. When the issuer_type is GLOBAL_SIGN, see definition of GlobalSignCredentials. When the issuer_type is CFSSL_AUTH, see definition of CfsslAuthCredentials.
Return type:CertificateIssuer
verify()

Verify certificate issuer.

REST API Documentation.

Return type:VerificationResponse
class mbed_cloud.foundation.CertificateIssuerConfig(_client=None, certificate_issuer_id=None, created_at=None, id=None, reference=None, updated_at=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local CertificateIssuerConfig instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • certificate_issuer_id (str) – (Required) The ID of the certificate issuer. Null if Device Management internal HSM is used.
  • created_at (datetime) – Created UTC time RFC3339.
  • id (str) – (Required) The ID of the certificate issuer configuration.
  • reference (str) – (Required) The certificate name to which the certificate issuer configuration applies.
  • updated_at (datetime) – Updated UTC time RFC3339.
certificate_issuer_id

The ID of the certificate issuer. Null if Device Management internal HSM is used.

This field must be set when creating a new CertificateIssuerConfig Entity.

api example: ‘01648415a2a30242ac18000500000000’

Return type:str
create()

Create certificate issuer configuration.

REST API Documentation.

Return type:CertificateIssuerConfig
created_at

Created UTC time RFC3339.

api example: ‘2017-01-01T00:00:00Z’

Return type:datetime
delete()

Delete certificate issuer configuration.

REST API Documentation.

Return type:CertificateIssuerConfig
get_default()

Get certificate issuer configuration.

REST API Documentation.

Return type:CertificateIssuerConfig
id

The ID of the certificate issuer configuration.

This field must be set when updating or deleting an existing CertificateIssuerConfig Entity.

api example: ‘01648415a2a30242ac18000500000000’

Return type:str
list(filter=None, order=None, max_results=None, page_size=None, include=None)

Get certificate issuer configurations.

REST API Documentation.

API Filters

The following filters are supported by the API when listing CertificateIssuerConfig entities:

Field eq neq gte lte in nin like
reference Y            

Example Usage

from mbed_cloud.foundation import CertificateIssuerConfig
from mbed_cloud import ApiFilter

api_filter = ApiFilter()
api_filter.add_filter("reference", "eq", <filter value>)
for certificate_issuer_config in CertificateIssuerConfig().list(filter=api_filter):
    print(certificate_issuer_config.reference)
Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – An optional filter to apply when listing entities, please see the above API Filters table for supported filters.
  • order (str) – The order of the records based on creation time, ASC or DESC; by default ASC.
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – How many objects to retrieve in the page. The minimum limit is 2 and the maximum is 1000. Limit values outside of this range are set to the closest limit.
  • include (str) – Comma-separated list of data fields to return. Currently supported: total_count
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(CertificateIssuerConfig)

read()

Get certificate issuer configuration.

REST API Documentation.

Return type:CertificateIssuerConfig
reference

The certificate name to which the certificate issuer configuration applies.

This field must be set when creating a new CertificateIssuerConfig Entity.

api example: ‘customer.dlms’

Return type:str
update()

Update certificate issuer configuration.

REST API Documentation.

Return type:CertificateIssuerConfig
updated_at

Updated UTC time RFC3339.

api example: ‘2017-02-01T00:00:00Z’

Return type:datetime
class mbed_cloud.foundation.DarkThemeColor(_client=None, color=None, reference=None, updated_at=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local DarkThemeColor instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • color (str) – The color given as name (purple) or as a hex code.
  • reference (str) – Color name.
  • updated_at (datetime) – Last update time in UTC.
color

The color given as name (purple) or as a hex code.

api example: ‘#f3f93e’

Return type:str
delete()

Reset branding color to default.

REST API Documentation.

Return type:
list(filter=None, order=None, max_results=None, page_size=None, include=None)

Get dark theme branding colors.

REST API Documentation.

Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – Filtering when listing entities is not supported by the API for this entity.
  • order (str) – The order of the records based on creation time, ASC or DESC. Default value is ASC
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return for each page.
  • include (str) – Comma separated additional data to return.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(DarkThemeColor)

read()

Get dark theme branding color.

REST API Documentation.

Return type:DarkThemeColor
reference

Color name.

Return type:str
update()

Updates a dark theme branding color.

REST API Documentation.

Return type:DarkThemeColor
updated_at

Last update time in UTC.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
class mbed_cloud.foundation.DarkThemeImage(_client=None, reference=None, static_uri=None, updated_at=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local DarkThemeImage instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • reference (str) – Name of the image.
  • static_uri (str) – The static link to the image.
  • updated_at (datetime) – Last update time in UTC.
delete()

Revert an image to dark theme default.

REST API Documentation.

Return type:DarkThemeImage
list(filter=None, order=None, max_results=None, page_size=None, include=None)

Get metadata of all dark theme images.

REST API Documentation.

Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – Filtering when listing entities is not supported by the API for this entity.
  • order (str) – The order of the records based on creation time, ASC or DESC. Default value is ASC
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return for each page.
  • include (str) – Comma separated additional data to return.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(DarkThemeImage)

read()

Get metadata of a dark theme image.

REST API Documentation.

Return type:DarkThemeImage
reference

Name of the image.

Return type:str
static_uri

The static link to the image.

api example: ‘https://static.mbed.com/123456789.jpg

Return type:str
update(image)

Upload a dark theme image.

REST API Documentation.

Parameters:image (file) – The image in PNG or JPEG format as multipart form data. Files can be provided as a file object or a path to an existing file on disk.
Return type:DarkThemeImage
updated_at

Last update time in UTC.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
class mbed_cloud.foundation.DeveloperCertificate(_client=None, account_id=None, certificate=None, created_at=None, description=None, developer_private_key=None, id=None, name=None, security_file_content=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local DeveloperCertificate instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • account_id (str) – Account to which the developer certificate belongs.
  • certificate (str) – PEM-format X.509 developer certificate.
  • created_at (datetime) – Creation UTC time RFC3339.
  • description (str) – Description for the developer certificate.
  • developer_private_key (str) – PEM-format developer private key associated with the certificate.
  • id (str) – (Required) ID that uniquely identifies the developer certificate.
  • name (str) – (Required) Name of the developer certificate.
  • security_file_content (str) – Content of the security.c file flashed to the device to provide security credentials.
account_id

Account to which the developer certificate belongs.

Return type:str
certificate

PEM-format X.509 developer certificate.

Return type:str
create()

Create a new developer certificate to connect to the bootstrap server.

REST API Documentation.

Return type:DeveloperCertificate
created_at

Creation UTC time RFC3339.

Return type:datetime
delete()

Delete a trusted certificate by ID.

REST API Documentation.

Return type:DeveloperCertificate
description

Description for the developer certificate.

Return type:str
developer_private_key

PEM-format developer private key associated with the certificate.

Return type:str
get_trusted_certificate_info()

Get trusted certificate by ID.

REST API Documentation.

Return type:TrustedCertificate
id

ID that uniquely identifies the developer certificate.

This field must be set when updating or deleting an existing DeveloperCertificate Entity.

Return type:str
name

Name of the developer certificate.

This field must be set when creating a new DeveloperCertificate Entity.

Return type:str
read()

Fetch an existing developer certificate to connect to the bootstrap server.

REST API Documentation.

Return type:DeveloperCertificate
security_file_content

Content of the security.c file flashed to the device to provide security credentials.

Return type:str
class mbed_cloud.foundation.Device(_client=None, account_id=None, auto_update=None, bootstrap_expiration_date=None, bootstrapped_timestamp=None, ca_id=None, connector_expiration_date=None, created_at=None, custom_attributes=None, deployed_state=None, deployment=None, description=None, device_class=None, device_execution_mode=None, device_key=None, endpoint_name=None, endpoint_type=None, enrolment_list_timestamp=None, firmware_checksum=None, host_gateway=None, id=None, issuer_fingerprint=None, manifest=None, manifest_timestamp=None, mechanism=None, mechanism_url=None, name=None, serial_number=None, state=None, updated_at=None, vendor_id=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local Device instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • account_id (str) – The ID of the associated account.
  • auto_update (bool) – DEPRECATED: Mark this device for automatic firmware update.
  • bootstrap_expiration_date (date) – The expiration date of the certificate used to connect to bootstrap server.
  • bootstrapped_timestamp (datetime) – The timestamp of the device’s most recent bootstrap process.
  • ca_id (str) – The certificate issuer’s ID.
  • connector_expiration_date (date) – The expiration date of the certificate used to connect to LwM2M server.
  • created_at (datetime) – The timestamp of when the device was created in the device directory.
  • custom_attributes (dict) – Up to five custom key-value attributes. Note that keys cannot begin with a number. Both keys and values are limited to 128 characters. Updating this field replaces existing contents.
  • deployed_state (str) – DEPRECATED: The state of the device’s deployment.
  • deployment (str) – DEPRECATED: The last deployment used on the device.
  • description (str) – The description of the device.
  • device_class (str) – An ID representing the model and hardware revision of the device.
  • device_execution_mode (int) –

    The execution mode from the certificate of the device. Defaults to inheriting from host_gateway device. Permitted values:

    • 0 -

    unspecified execution mode (default if host_gateway invalid or not set)

    • 1 - development devices
    • 5 - production devices
  • device_key (str) – The fingerprint of the device certificate.
  • endpoint_name (str) – The endpoint name given to the device.
  • endpoint_type (str) – The endpoint type of the device. For example, the device is a gateway.
  • enrolment_list_timestamp (datetime) – The claim date/time.
  • firmware_checksum (str) – The SHA256 checksum of the current firmware image.
  • host_gateway (str) – The ID of the host gateway, if appropriate.
  • id (str) – (Required) The ID of the device. The device ID is used across all Device Management APIs.
  • issuer_fingerprint (str) – SHA256 fingerprint of the certificate used to validate the signature of the device certificate.
  • manifest (str) – DEPRECATED: The URL for the current device manifest.
  • manifest_timestamp (datetime) – The timestamp of the current manifest version.
  • mechanism (str) – The ID of the channel used to communicate with the device.
  • mechanism_url (str) – The address of the connector to use.
  • name (str) – The name of the device.
  • serial_number (str) – The serial number of the device.
  • state (str) – The current state of the device.
  • updated_at (datetime) – The time the object was updated.
  • vendor_id (str) – The device vendor ID.
account_id

The ID of the associated account.

api example: ‘00000000000000000000000000000000’

Return type:str
add_to_group(device_group_id)

Add a device to a group

REST API Documentation.

Parameters:device_group_id (str) – The ID of the group.
Return type:
auto_update

DEPRECATED: Mark this device for automatic firmware update.

Return type:bool
bootstrap_expiration_date

The expiration date of the certificate used to connect to bootstrap server.

Return type:date
bootstrapped_timestamp

The timestamp of the device’s most recent bootstrap process.

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
ca_id

The certificate issuer’s ID.

api example: ‘00000000000000000000000000000000’

Return type:str
connector_expiration_date

The expiration date of the certificate used to connect to LwM2M server.

Return type:date
create()

Create a device

REST API Documentation.

Return type:Device
created_at

The timestamp of when the device was created in the device directory.

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
custom_attributes

Up to five custom key-value attributes. Note that keys cannot begin with a number. Both keys and values are limited to 128 characters. Updating this field replaces existing contents.

api example: {‘key’: ‘value’}

Return type:dict
delete()

Delete a device.

REST API Documentation.

Return type:Device
deployed_state

DEPRECATED: The state of the device’s deployment.

Return type:str
deployment

DEPRECATED: The last deployment used on the device.

Return type:str
description

The description of the device.

api example: ‘description’

Return type:str
device_class

An ID representing the model and hardware revision of the device.

Return type:str
device_execution_mode

The execution mode from the certificate of the device. Defaults to inheriting from host_gateway device. Permitted values:

  • 0 - unspecified execution mode
(default if host_gateway invalid or not set)
  • 1 - development devices
  • 5
  • production devices
Return type:int
device_key

The fingerprint of the device certificate.

api example: ‘00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
:00:00:00:00:00:00’
Return type:str
endpoint_name

The endpoint name given to the device.

api example: ‘00000000-0000-0000-0000-000000000000’

Return type:str
endpoint_type

The endpoint type of the device. For example, the device is a gateway.

Return type:str
enrolment_list_timestamp

The claim date/time.

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
firmware_checksum

The SHA256 checksum of the current firmware image.

api example: ‘0000000000000000000000000000000000000000000000000000000000000000’

Return type:str
host_gateway

The ID of the host gateway, if appropriate.

Return type:str
id

The ID of the device. The device ID is used across all Device Management APIs.

This field must be set when updating or deleting an existing Device Entity.

api example: ‘00000000000000000000000000000000’

Return type:str
issuer_fingerprint

SHA256 fingerprint of the certificate used to validate the signature of the device certificate.

api example: ‘C42EDEFC75871E4CE2146FCDA67D03DDA05CC26FDF93B17B55F42C1EADFDC322’

Return type:str
list(filter=None, order=None, max_results=None, page_size=None, include=None)

List all devices.

REST API Documentation.

API Filters

The following filters are supported by the API when listing Device entities:

Field eq neq gte lte in nin like
account_id Y Y     Y Y  
auto_update Y Y          
bootstrap_expiration_date     Y Y Y Y  
bootstrapped_timestamp     Y Y Y Y  
ca_id Y Y     Y Y  
connector_expiration_date     Y Y Y Y  
created_at     Y Y Y Y  
deployed_state Y Y     Y Y  
deployment Y Y     Y Y  
description Y Y     Y Y  
device_class Y Y     Y Y  
device_execution_mode Y Y     Y Y  
device_key Y Y     Y Y  
endpoint_name Y Y     Y Y  
endpoint_type Y Y     Y Y  
enrolment_list_timestamp     Y Y Y Y  
firmware_checksum Y Y     Y Y  
host_gateway Y Y     Y Y  
id Y Y     Y Y  
manifest Y Y     Y Y  
manifest_timestamp     Y Y Y Y  
mechanism Y Y     Y Y  
mechanism_url Y Y     Y Y  
name Y Y     Y Y  
serial_number Y Y     Y Y  
state Y Y     Y Y  
updated_at     Y Y Y Y  
vendor_id Y Y     Y Y  

Example Usage

from mbed_cloud.foundation import Device
from mbed_cloud import ApiFilter

api_filter = ApiFilter()
api_filter.add_filter("account_id", "eq", <filter value>)
for device in Device().list(filter=api_filter):
    print(device.account_id)
Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – An optional filter to apply when listing entities, please see the above API Filters table for supported filters.
  • order (str) – The order of the records based on creation time, ASC or DESC; by default ASC.
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – How many objects to retrieve in the page. The minimum limit is 2 and the maximum is 1000. Limit values outside of this range are set to the closest limit.
  • include (str) – Comma-separated list of data fields to return. Currently supported: total_count.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(Device)

manifest

DEPRECATED: The URL for the current device manifest.

Return type:str
manifest_timestamp

The timestamp of the current manifest version.

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
mechanism

The ID of the channel used to communicate with the device.

Return type:str
mechanism_url

The address of the connector to use.

Return type:str
name

The name of the device.

api example: ‘00000000-0000-0000-0000-000000000000’

Return type:str
read()

Get a device

REST API Documentation.

Return type:Device
remove_from_group(device_group_id)

Remove a device from a group

REST API Documentation.

Parameters:device_group_id (str) – The ID of the group.
Return type:
renew_certificate(certificate_name)

Request certificate renewal.

REST API Documentation.

Parameters:certificate_name (str) – The certificate name.
Return type:CertificateEnrollment
serial_number

The serial number of the device.

api example: ‘00000000-0000-0000-0000-000000000000’

Return type:str
state

The current state of the device.

Return type:str
update()

Update a device

REST API Documentation.

Return type:Device
updated_at

The time the object was updated.

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
vendor_id

The device vendor ID.

api example: ‘00000000-0000-0000-0000-000000000000’

Return type:str
class mbed_cloud.foundation.DeviceEnrollment(_client=None, account_id=None, claimed_at=None, created_at=None, enrolled_device_id=None, enrollment_identity=None, expires_at=None, id=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local DeviceEnrollment instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • account_id (str) – ID
  • claimed_at (datetime) – The time the device was claimed.
  • created_at (datetime) – The time of the enrollment identity creation.
  • enrolled_device_id (str) – The ID of the device in the Device Directory once it is registered.
  • enrollment_identity (str) – (Required) Enrollment identity.
  • expires_at (datetime) – The enrollment claim expiration time. If the device does not connect to Device Management before expiration, the claim is removed without separate notice.
  • id (str) – (Required) Enrollment identity.
account_id

ID

api example: ‘00005a4e027f0a580a01081c00000000’

Return type:str
claimed_at

The time the device was claimed.

Return type:datetime
create()

Create a single enrollment.

REST API Documentation.

Return type:DeviceEnrollment
created_at

The time of the enrollment identity creation.

Return type:datetime
delete()

Delete an enrollment by ID.

REST API Documentation.

Return type:DeviceEnrollment
enrolled_device_id

The ID of the device in the Device Directory once it is registered.

api example: ‘00005a4e027f0a580a01081c00000000’

Return type:str
enrollment_identity

Enrollment identity.

This field must be set when creating a new DeviceEnrollment Entity.

api example: ‘A-35:e7:72:8a:07:50:3b:3d:75:96:57:52:72:41:0d:78:cc:c6:e5:53:48:c6:65:58:5b:
fa:af:4d:2d:73:95:c5’
Return type:str
expires_at

The enrollment claim expiration time. If the device does not connect to Device Management before expiration, the claim is removed without separate notice.

Return type:datetime
id

Enrollment identity.

This field must be set when updating or deleting an existing DeviceEnrollment Entity.

api example: ‘00005a4e027f0a580a01081c00000000’

Return type:str
list(filter=None, order=’ASC’, max_results=None, page_size=None, include=None)

Get a list of enrollments per account.

REST API Documentation.

Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – Filtering when listing entities is not supported by the API for this entity.
  • order (str) – ASC or DESC
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – Number of results to return (2-1000).
  • include (str) – Comma-separated additional data to return. Currently supported: total_count.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(DeviceEnrollment)

read()

Get details of an single enrollment by ID.

REST API Documentation.

Return type:DeviceEnrollment
class mbed_cloud.foundation.DeviceEnrollmentBulkCreate(_client=None, account_id=None, completed_at=None, created_at=None, errors_count=None, errors_report_file=None, full_report_file=None, id=None, processed_count=None, status=None, total_count=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local DeviceEnrollmentBulkCreate instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • account_id (str) – ID
  • completed_at (datetime) – The time the bulk creation task was completed. Null when creating bulk upload or delete.
  • created_at (datetime) – The time of receiving the bulk creation task.
  • errors_count (int) – The number of enrollment identities with failed processing.
  • errors_report_file (str) – Link to error report file. Null when creating bulk upload or delete.
  • full_report_file (str) – Link to full report file. Null when creating bulk upload or delete.
  • id (str) – (Required) Bulk ID
  • processed_count (int) – The number of enrollment identities processed until now.
  • status (str) – The state of the process is ‘new’ at the time of creation. If creation is still in progress, the state shows as ‘processing’. When the request is fully processed, the state changes to ‘completed’.
  • total_count (int) – Total number of enrollment identities found in the input CSV.
account_id

ID

api example: ‘00005a4e027f0a580a01081c00000000’

Return type:str
completed_at

The time the bulk creation task was completed. Null when creating bulk upload or delete.

Return type:datetime
create(enrollment_identities)

Bulk upload.

REST API Documentation.

Parameters:enrollment_identities (file) – The CSV file containing the enrollment IDs. The maximum file size is 10 MB. Files can be provided as a file object or a path to an existing file on disk.
Return type:DeviceEnrollmentBulkCreate
created_at

The time of receiving the bulk creation task.

Return type:datetime
download_errors_report_file()

Download the error report file for the created the bulk enrollment.

Return type:file
download_full_report_file()

Download the full report file for the created of the bulk enrollment.

Return type:file
errors_count

The number of enrollment identities with failed processing.

Return type:int
errors_report_file

Link to error report file. Null when creating bulk upload or delete.

api example: ‘https://api.us-east-1.mbedcloud.com/v3/device-enrollments-bulk-
uploads/2d238a89038b4ddb84699dd36a901063/errors_report.csv’
Return type:str
full_report_file

Link to full report file. Null when creating bulk upload or delete.

api example: ‘https://api.us-east-1.mbedcloud.com/v3/device-enrollments-bulk-
uploads/2d238a89038b4ddb84699dd36a901063/full_report.csv’
Return type:str
id

Bulk ID

This field must be set when updating or deleting an existing DeviceEnrollmentBulkCreate Entity.

Return type:str
processed_count

The number of enrollment identities processed until now.

Return type:int
read()

Get bulk upload entity.

REST API Documentation.

Return type:DeviceEnrollmentBulkCreate
status

The state of the process is ‘new’ at the time of creation. If creation is still in progress, the state shows as ‘processing’. When the request is fully processed, the state changes to ‘completed’.

api example: ‘new’

Return type:str
total_count

Total number of enrollment identities found in the input CSV.

api example: 10

Return type:int
class mbed_cloud.foundation.DeviceEnrollmentBulkDelete(_client=None, account_id=None, completed_at=None, created_at=None, errors_count=None, errors_report_file=None, full_report_file=None, id=None, processed_count=None, status=None, total_count=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local DeviceEnrollmentBulkDelete instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • account_id (str) – ID
  • completed_at (datetime) – The time the bulk creation task was completed. Null when creating bulk upload or delete.
  • created_at (datetime) – The time of receiving the bulk creation task.
  • errors_count (int) – The number of enrollment identities with failed processing.
  • errors_report_file (str) – Link to error report file. Null when creating bulk upload or delete.
  • full_report_file (str) – Link to full report file. Null when creating bulk upload or delete.
  • id (str) – (Required) Bulk ID
  • processed_count (int) – The number of enrollment identities processed until now.
  • status (str) – The state of the process is ‘new’ at the time of creation. If creation is still in progress, the state shows as ‘processing’. When the request is fully processed, the state changes to ‘completed’.
  • total_count (int) – Total number of enrollment identities found in the input CSV.
account_id

ID

api example: ‘00005a4e027f0a580a01081c00000000’

Return type:str
completed_at

The time the bulk creation task was completed. Null when creating bulk upload or delete.

Return type:datetime
created_at

The time of receiving the bulk creation task.

Return type:datetime
delete(enrollment_identities)

Bulk delete.

REST API Documentation.

Parameters:enrollment_identities (file) – The CSV file containing the enrollment IDs. The maximum file size is 10MB. Files can be provided as a file object or a path to an existing file on disk.
Return type:DeviceEnrollmentBulkDelete
download_errors_report_file()

Download the error report file for the bulk enrollment deletion.

Return type:file
download_full_report_file()

Download the full report file for the bulk enrollment deletion.

Return type:file
errors_count

The number of enrollment identities with failed processing.

Return type:int
errors_report_file

Link to error report file. Null when creating bulk upload or delete.

api example: ‘https://api.us-east-1.mbedcloud.com/v3/device-enrollments-bulk-
uploads/2d238a89038b4ddb84699dd36a901063/errors_report.csv’
Return type:str
full_report_file

Link to full report file. Null when creating bulk upload or delete.

api example: ‘https://api.us-east-1.mbedcloud.com/v3/device-enrollments-bulk-
uploads/2d238a89038b4ddb84699dd36a901063/full_report.csv’
Return type:str
id

Bulk ID

This field must be set when updating or deleting an existing DeviceEnrollmentBulkDelete Entity.

Return type:str
processed_count

The number of enrollment identities processed until now.

Return type:int
read()

Get bulk delete entity.

REST API Documentation.

Return type:DeviceEnrollmentBulkDelete
status

The state of the process is ‘new’ at the time of creation. If creation is still in progress, the state shows as ‘processing’. When the request is fully processed, the state changes to ‘completed’.

api example: ‘new’

Return type:str
total_count

Total number of enrollment identities found in the input CSV.

api example: 10

Return type:int
class mbed_cloud.foundation.DeviceEnrollmentDenial(_client=None, account_id=None, created_at=None, endpoint_name=None, id=None, trusted_certificate_id=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local DeviceEnrollmentDenial instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • account_id (str) – account id
  • created_at (datetime) – date on which the failed bootstrap was attempted on
  • endpoint_name (str) – endpoint name
  • id (str) – id of the recorded failed bootstrap attempt
  • trusted_certificate_id (str) – Trusted certificate id
account_id

account id

api example: ‘00005a4e027f0a580a01081c00000000’

Return type:str
created_at

date on which the failed bootstrap was attempted on

api example: ‘2000-01-23T04:56:07.000+00:00’

Return type:datetime
endpoint_name

endpoint name

api example: ‘Endpoint_1234’

Return type:str
id

id of the recorded failed bootstrap attempt

api example: ‘00005a4e027f0a580a04567c00000000’

Return type:str
list(filter=None, order=None, max_results=None, page_size=None, include=None)

Return list of devices which were denied to bootstrap due to being subjected to blacklisting.

REST API Documentation.

API Filters

The following filters are supported by the API when listing DeviceEnrollmentDenial entities:

Field eq neq gte lte in nin like
endpoint_name Y            
trusted_certificate_id Y            

Example Usage

from mbed_cloud.foundation import DeviceEnrollmentDenial
from mbed_cloud import ApiFilter

api_filter = ApiFilter()
api_filter.add_filter("endpoint_name", "eq", <filter value>)
for device_enrollment_denial in DeviceEnrollmentDenial().list(filter=api_filter):
    print(device_enrollment_denial.endpoint_name)
Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – An optional filter to apply when listing entities, please see the above API Filters table for supported filters.
  • order (str) – Optional parameter for pagination.
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – Optional parameter for pagination.
  • include (str) – Comma separated additional data to return.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(DeviceEnrollmentDenial)

read(device_enrollment_denial_id)

Query for a single device by ID

REST API Documentation.

Parameters:device_enrollment_denial_id (str) – id of the recorded failed bootstrap attempt
Return type:DeviceEnrollmentDenial
trusted_certificate_id

Trusted certificate id

api example: ‘00005a4e027f0a580a01081c00000000’

Return type:str
class mbed_cloud.foundation.DeviceEvents(_client=None, changes=None, created_at=None, data=None, date_time=None, description=None, device_id=None, event_type=None, event_type_category=None, event_type_description=None, id=None, state_change=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local DeviceEvents instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • changes (dict) –
  • created_at (datetime) –
  • data (dict) – Additional data relevant to the event.
  • date_time (datetime) –
  • description (str) –
  • device_id (str) –
  • event_type (str) – Event code
  • event_type_category (str) – Category code which groups the event type by a summary category.
  • event_type_description (str) – Generic description of the event
  • id (str) – (Required)
  • state_change (bool) –
changes
Return type:dict
created_at

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
data

Additional data relevant to the event.

api example: {‘campaign_id’: ‘00000000000000000000000000000000’}

Return type:dict
date_time

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
description

api example: ‘Device record created’

Return type:str
device_id

api example: ‘00000000000000000000000000000000’

Return type:str
event_type

Event code

api example: ‘UPD2_100’

Return type:str
event_type_category

Category code which groups the event type by a summary category.

api example: ‘FAIL_MANIFEST_REJECTED’

Return type:str
event_type_description

Generic description of the event

api example: ‘FAIL’

Return type:str
id

This field must be set when updating or deleting an existing DeviceEvents Entity.

api example: ‘00000000000000000000000000000000’

Return type:str
list(filter=None, order=None, max_results=None, page_size=None, include=None)

List all device events.

REST API Documentation.

API Filters

The following filters are supported by the API when listing DeviceEvents entities:

Field eq neq gte lte in nin like
date_time     Y Y Y Y  
description Y Y     Y Y  
device_id Y Y     Y Y  
event_type Y Y     Y Y  
id Y Y     Y Y  
state_change Y Y          

Example Usage

from mbed_cloud.foundation import DeviceEvents
from mbed_cloud import ApiFilter

api_filter = ApiFilter()
api_filter.add_filter("date_time", "in", <filter value>)
for device_event in DeviceEvents().list(filter=api_filter):
    print(device_event.date_time)
Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – An optional filter to apply when listing entities, please see the above API Filters table for supported filters.
  • order (str) – The order of the records based on creation time, ASC or DESC; by default ASC.
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – How many objects to retrieve in the page. The minimum limit is 2 and the maximum is 1000. Limit values outside of this range are set to the closest limit.
  • include (str) – Comma-separated list of data fields to return. Currently supported: total_count
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(DeviceEvents)

read()

Retrieve a device event.

REST API Documentation.

Return type:DeviceEvents
state_change
Return type:bool
class mbed_cloud.foundation.DeviceGroup(_client=None, created_at=None, custom_attributes=None, description=None, devices_count=None, id=None, name=None, updated_at=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local DeviceGroup instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • created_at (datetime) – The time the campaign was created.
  • custom_attributes (dict) – Up to ten custom key-value attributes. Note that keys cannot begin with a number. Both keys and values are limited to 128 characters. Updating this field replaces existing contents.
  • description (str) – The description of the group.
  • devices_count (int) – The number of devices in this group.
  • id (str) – (Required) The group ID.
  • name (str) – Name of the group.
  • updated_at (datetime) – The time the object was updated.
add_device(device_id=None)

Add a device to a group

REST API Documentation.

Parameters:device_id (str) – No description available
Return type:
create()

Create a group

REST API Documentation.

Return type:DeviceGroup
created_at

The time the campaign was created.

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
custom_attributes

Up to ten custom key-value attributes. Note that keys cannot begin with a number. Both keys and values are limited to 128 characters. Updating this field replaces existing contents.

api example: {‘key’: ‘value’}

Return type:dict
delete()

Delete a group

REST API Documentation.

Return type:DeviceGroup
description

The description of the group.

api example: ‘Devices on the factory floor.’

Return type:str
devices(filter=None, order=None, max_results=None, page_size=None, include=None)

Get a page of devices

REST API Documentation.

API Filters

The following filters are supported by the API when listing DeviceGroup entities:

Field eq neq gte lte in nin like
account_id Y Y     Y Y  
auto_update Y Y          
bootstrap_expiration_date     Y Y Y Y  
bootstrapped_timestamp     Y Y Y Y  
ca_id Y Y     Y Y  
connector_expiration_date     Y Y Y Y  
created_at     Y Y Y Y  
deployed_state Y Y     Y Y  
deployment Y Y     Y Y  
description Y Y     Y Y  
device_class Y Y     Y Y  
device_execution_mode Y Y     Y Y  
device_key Y Y     Y Y  
endpoint_name Y Y     Y Y  
endpoint_type Y Y     Y Y  
enrolment_list_timestamp     Y Y Y Y  
firmware_checksum Y Y     Y Y  
host_gateway Y Y     Y Y  
id Y Y     Y Y  
manifest Y Y     Y Y  
manifest_timestamp     Y Y Y Y  
mechanism Y Y     Y Y  
mechanism_url Y Y     Y Y  
name Y Y     Y Y  
serial_number Y Y     Y Y  
state Y Y     Y Y  
updated_at     Y Y Y Y  
vendor_id Y Y     Y Y  

Example Usage

from mbed_cloud.foundation import DeviceGroup
from mbed_cloud import ApiFilter

api_filter = ApiFilter()
api_filter.add_filter("account_id", "eq", <filter value>)
for device in DeviceGroup().devices(filter=api_filter):
    print(device.account_id)
Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – An optional filter to apply when listing entities, please see the above API Filters table for supported filters.
  • order (str) – The order of the records based on creation time, ASC or DESC; by default ASC.
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – How many objects to retrieve in the page. The minimum limit is 2 and the maximum is 1000. Limit values outside of this range are set to the closest limit.
  • include (str) – Comma-separated list of data fields to return. Currently supported: total_count.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(Device)

devices_count

The number of devices in this group.

api example: 10

Return type:int
id

The group ID.

This field must be set when updating or deleting an existing DeviceGroup Entity.

api example: ‘015c3029f6f7000000000001001000c3’

Return type:str
list(filter=None, order=None, max_results=None, page_size=None, include=None)

List all groups.

REST API Documentation.

API Filters

The following filters are supported by the API when listing DeviceGroup entities:

Field eq neq gte lte in nin like
created_at     Y Y Y Y  
devices_count Y Y Y Y Y Y  
id Y Y     Y Y  
name Y Y     Y Y  
updated_at     Y Y Y Y  

Example Usage

from mbed_cloud.foundation import DeviceGroup
from mbed_cloud import ApiFilter

api_filter = ApiFilter()
api_filter.add_filter("created_at", "in", <filter value>)
for device_group in DeviceGroup().list(filter=api_filter):
    print(device_group.created_at)
Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – An optional filter to apply when listing entities, please see the above API Filters table for supported filters.
  • order (str) – The order of the records based on creation time, ASC or DESC; by default ASC.
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – How many objects to retrieve in the page. The minimum limit is 2 and the maximum is 1000. Limit values outside of this range are set to the closest limit.
  • include (str) – Comma-separated list of data fields to return. Currently supported: total_count.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(DeviceGroup)

name

Name of the group.

api example: ‘My devices’

Return type:str
read()

Get a group.

REST API Documentation.

Return type:DeviceGroup
remove_device(device_id=None)

Remove a device from a group

REST API Documentation.

Parameters:device_id (str) – No description available
Return type:
update()

Modify the attributes of a group.

REST API Documentation.

Return type:DeviceGroup
updated_at

The time the object was updated.

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
class mbed_cloud.foundation.FirmwareImage(_client=None, created_at=None, datafile_checksum=None, datafile_size=None, datafile_url=None, description=None, id=None, name=None, updated_at=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local FirmwareImage instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • created_at (datetime) – The time the object was created
  • datafile_checksum (str) – The checksum (sha256) generated for the datafile
  • datafile_size (int) – The size of the datafile in bytes
  • datafile_url (str) – The firmware image file URL
  • description (str) – The description of the object
  • id (str) – (Required) The firmware image ID
  • name (str) – The firmware image name
  • updated_at (datetime) – The time the object was updated
create(firmware_image_file)

Create an image

REST API Documentation.

Parameters:firmware_image_file (file) – The firmware image file to upload Files can be provided as a file object or a path to an existing file on disk.
Return type:FirmwareImage
created_at

The time the object was created

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
datafile_checksum

The checksum (sha256) generated for the datafile

api example: ‘0000000000000000000000000000000000000000000000000000000000000000’

Return type:str
datafile_size

The size of the datafile in bytes

Return type:int
datafile_url

The firmware image file URL

api example: ‘http://example.com/00000000000000000000000000000000

Return type:str
delete()

Delete an image

REST API Documentation.

Return type:FirmwareImage
description

The description of the object

Return type:str
id

The firmware image ID

This field must be set when updating or deleting an existing FirmwareImage Entity.

api example: ‘00000000000000000000000000000000’

Return type:str
list(filter=None, order=None, max_results=None, page_size=None, include=None)

List all images

REST API Documentation.

API Filters

The following filters are supported by the API when listing FirmwareImage entities:

Field eq neq gte lte in nin like
created_at     Y Y Y Y  
datafile_checksum Y Y     Y Y  
datafile_size Y Y     Y Y  
datafile_url Y Y     Y Y  
description Y Y     Y Y  
id Y Y     Y Y  
name Y Y     Y Y  
updated_at     Y Y Y Y  

Example Usage

from mbed_cloud.foundation import FirmwareImage
from mbed_cloud import ApiFilter

api_filter = ApiFilter()
api_filter.add_filter("created_at", "in", <filter value>)
for firmware_image in FirmwareImage().list(filter=api_filter):
    print(firmware_image.created_at)
Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – An optional filter to apply when listing entities, please see the above API Filters table for supported filters.
  • order (str) – ASC or DESC
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – How many objects to retrieve in the page. The minimum limit is 2 and the maximum is 1000. Limit values outside of this range are set to the closest limit.
  • include (str) – A comma-separated list of data fields to return. Currently supported: total_count
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(FirmwareImage)

name

The firmware image name

Return type:str
read()

Get an image

REST API Documentation.

Return type:FirmwareImage
updated_at

The time the object was updated

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
class mbed_cloud.foundation.FirmwareManifest(_client=None, created_at=None, datafile_size=None, datafile_url=None, description=None, device_class=None, id=None, key_table_url=None, name=None, timestamp=None, updated_at=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local FirmwareManifest instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • created_at (datetime) – The time the object was created
  • datafile_size (int) – The size of the datafile in bytes
  • datafile_url (str) – The URL of the firmware manifest binary
  • description (str) – The description of the firmware manifest
  • device_class (str) – The class of the device
  • id (str) – (Required) The firmware manifest ID
  • key_table_url (str) – The key table of pre-shared keys for devices
  • name (str) – The name of the object
  • timestamp (datetime) – The firmware manifest version as a timestamp
  • updated_at (datetime) – The time the object was updated
create(firmware_manifest_file, key_table_file=None)

Upload a manifest

REST API Documentation.

Parameters:
  • firmware_manifest_file (file) – The manifest file to create. The API gateway enforces the account- specific file size. Files can be provided as a file object or a path to an existing file on disk.
  • key_table_file (file) – The key table of pre-shared keys for devices Files can be provided as a file object or a path to an existing file on disk.
Return type:

FirmwareManifest

created_at

The time the object was created

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
datafile_size

The size of the datafile in bytes

Return type:int
datafile_url

The URL of the firmware manifest binary

api example: ‘http://example.com/00000000000000000000000000000000

Return type:str
delete()

Delete a manifest

REST API Documentation.

Return type:FirmwareManifest
description

The description of the firmware manifest

Return type:str
device_class

The class of the device

api example: ‘00000000-0000-0000-0000-000000000000’

Return type:str
id

The firmware manifest ID

This field must be set when updating or deleting an existing FirmwareManifest Entity.

api example: ‘00000000000000000000000000000000’

Return type:str
key_table_url

The key table of pre-shared keys for devices

api example: ‘http://example.com

Return type:str
list(filter=None, order=None, max_results=None, page_size=None, include=None)

List manifests

REST API Documentation.

API Filters

The following filters are supported by the API when listing FirmwareManifest entities:

Field eq neq gte lte in nin like
created_at     Y Y Y Y  
datafile_size Y Y     Y Y  
datafile_url Y Y     Y Y  
description Y Y     Y Y  
device_class Y Y     Y Y  
id Y Y     Y Y  
name Y Y     Y Y  
timestamp     Y Y Y Y  
updated_at     Y Y Y Y  

Example Usage

from mbed_cloud.foundation import FirmwareManifest
from mbed_cloud import ApiFilter

api_filter = ApiFilter()
api_filter.add_filter("created_at", "in", <filter value>)
for firmware_manifest in FirmwareManifest().list(filter=api_filter):
    print(firmware_manifest.created_at)
Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – An optional filter to apply when listing entities, please see the above API Filters table for supported filters.
  • order (str) – ASC or DESC
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – How many objects to retrieve in the page. The minimum limit is 2 and the maximum is 1000. Limit values outside of this range are set to the closest limit.
  • include (str) – A comma-separated list of data fields to return. Currently supported: total_count
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(FirmwareManifest)

name

The name of the object

Return type:str
read()

Get a manifest

REST API Documentation.

Return type:FirmwareManifest
timestamp

The firmware manifest version as a timestamp

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
updated_at

The time the object was updated

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
class mbed_cloud.foundation.LightThemeColor(_client=None, color=None, reference=None, updated_at=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local LightThemeColor instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • color (str) – The color given as name (purple) or as a hex code.
  • reference (str) – Color name.
  • updated_at (datetime) – Last update time in UTC.
color

The color given as name (purple) or as a hex code.

api example: ‘#f3f93e’

Return type:str
delete()

Reset branding color to default.

REST API Documentation.

Return type:
list(filter=None, order=None, max_results=None, page_size=None, include=None)

Get light theme branding colors.

REST API Documentation.

Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – Filtering when listing entities is not supported by the API for this entity.
  • order (str) – The order of the records based on creation time, ASC or DESC. Default value is ASC
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return for each page.
  • include (str) – Comma separated additional data to return.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(LightThemeColor)

read()

Get light theme branding color.

REST API Documentation.

Return type:LightThemeColor
reference

Color name.

Return type:str
update()

Updates light theme branding color.

REST API Documentation.

Return type:LightThemeColor
updated_at

Last update time in UTC.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
class mbed_cloud.foundation.LightThemeImage(_client=None, reference=None, static_uri=None, updated_at=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local LightThemeImage instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • reference (str) – Name of the image.
  • static_uri (str) – The static link to the image.
  • updated_at (datetime) – Last update time in UTC.
delete()

Revert an image to light theme default.

REST API Documentation.

Return type:LightThemeImage
list(filter=None, order=None, max_results=None, page_size=None, include=None)

Get metadata of all light theme images.

REST API Documentation.

Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – Filtering when listing entities is not supported by the API for this entity.
  • order (str) – The order of the records based on creation time, ASC or DESC. Default value is ASC
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return for each page.
  • include (str) – Comma separated additional data to return.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(LightThemeImage)

read()

Get metadata of a light theme image.

REST API Documentation.

Return type:LightThemeImage
reference

Name of the image.

Return type:str
static_uri

The static link to the image.

api example: ‘https://static.mbed.com/123456789.jpg

Return type:str
update(image)

Upload a light theme image.

REST API Documentation.

Parameters:image (file) – The image in PNG or JPEG format as multipart form data. Files can be provided as a file object or a path to an existing file on disk.
Return type:LightThemeImage
updated_at

Last update time in UTC.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
class mbed_cloud.foundation.LoginHistory(_client=None, date=None, ip_address=None, success=None, user_agent=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local LoginHistory instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • date (datetime) – UTC time RFC3339 for this login attempt.
  • ip_address (str) – IP address of the client.
  • success (bool) – Flag indicating whether login attempt was successful or not.
  • user_agent (str) – User Agent header from the login request.
date

UTC time RFC3339 for this login attempt.

api example: ‘2018-02-14T17:52:07Z’

Return type:datetime
ip_address

IP address of the client.

api example: ‘127.0.0.1’

Return type:str
success

Flag indicating whether login attempt was successful or not.

api example: True

Return type:bool
user_agent

User Agent header from the login request.

api example: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/41.0.2227.1 Safari/537.36’
Return type:str
class mbed_cloud.foundation.LoginProfile(_client=None, id=None, name=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local LoginProfile instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • id (str) – ID of the identity provider.
  • name (str) – Name of the identity provider.
id

ID of the identity provider.

Return type:str
name

Name of the identity provider.

Return type:str
class mbed_cloud.foundation.ParentAccount(_client=None, admin_email=None, admin_name=None, id=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local ParentAccount instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • admin_email (str) – The email address of the admin user who is the contact person of the parent account.
  • admin_name (str) – The name of the admin user who is the contact person of the parent account.
  • id (str) – The ID of the parent account.
admin_email

The email address of the admin user who is the contact person of the parent account.

api example: ‘info@arm.com

Return type:str
admin_name

The name of the admin user who is the contact person of the parent account.

api example: ‘J. Doe’

Return type:str
id

The ID of the parent account.

api example: ‘01619571dad80242ac12000600000000’

Return type:str
class mbed_cloud.foundation.PasswordPolicy(_client=None, minimum_length=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local PasswordPolicy instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:minimum_length (int) – Minimum length for the password.
minimum_length

Minimum length for the password.

api example: ‘8’

Return type:int
class mbed_cloud.foundation.Policy(_client=None, action=None, allow=None, feature=None, inherited=None, resource=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local Policy instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • action (str) – Comma-separated list of actions, empty string represents all actions.
  • allow (bool) – True or false controlling whether an action is allowed or not.
  • feature (str) – Feature name corresponding to this policy.
  • inherited (bool) – Flag indicating whether this feature is inherited or overwritten specifically.
  • resource (str) – Resource that is protected by this policy.
action

Comma-separated list of actions, empty string represents all actions.

api example: ‘GET’

Return type:str
allow

True or false controlling whether an action is allowed or not.

api example: True

Return type:bool
feature

Feature name corresponding to this policy.

api example: ‘update-campaigns’

Return type:str
inherited

Flag indicating whether this feature is inherited or overwritten specifically.

Return type:bool
resource

Resource that is protected by this policy.

api example: ‘/v3/update-campaign’

Return type:str
class mbed_cloud.foundation.PreSharedKey(_client=None, created_at=None, endpoint_name=None, id=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local PreSharedKey instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • created_at (datetime) – The date-time (RFC3339) when this PSK was uploaded to Device Management.
  • endpoint_name (str) – The unique endpoint identifier that this PSK applies to. 16-64 [pr intable](https://en.wikipedia.org/wiki/ASCII#Printable_characters) (non-control) ASCII characters.
  • id (str) – The Id of the pre_shared_key, shadows the endpoint_name
create(secret_hex)

Upload a PSK to Pelion Device Management.

REST API Documentation.

Parameters:secret_hex (str) – The secret of the PSK in hexadecimal. It is not case sensitive; 4a is same as 4A, and it is allowed with or without 0x in the beginning. The minimum length of the secret is 128 bits and maximum 256 bits.
Return type:PreSharedKey
created_at

The date-time (RFC3339) when this PSK was uploaded to Device Management.

api example: ‘2017-07-21T17:32:28.012Z’

Return type:datetime
delete()

Remove a PSK.

REST API Documentation.

Return type:PreSharedKey
endpoint_name

The unique endpoint identifier that this PSK applies to. 16-64 [printable](https://en.wikipedia.org/wiki/ASCII#Printable_characters) (non- control) ASCII characters.

api example: ‘my-endpoint-0001’

Return type:str
id

The Id of the pre_shared_key, shadows the endpoint_name

Return type:str
list(filter=None, order=None, max_results=None, page_size=None, include=None)

List PSKs.

REST API Documentation.

Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – Filtering when listing entities is not supported by the API for this entity.
  • order (str) – The order of the records based on creation time, ASC or DESC. Default value is ASC
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of entries per page.
  • include (str) – Comma separated additional data to return.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(PreSharedKey)

read()

Get a PSK.

REST API Documentation.

Return type:PreSharedKey
class mbed_cloud.foundation.ServerCredentials(_client=None, created_at=None, id=None, server_certificate=None, server_uri=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local ServerCredentials instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • created_at (datetime) – Creation UTC time RFC3339.
  • id (str) – Unique entity ID.
  • server_certificate (str) – PEM-format X.509 server certificate used to validate the server certificate received during the TLS/DTLS handshake.
  • server_uri (str) – Server URI that the client connects to.
created_at

Creation UTC time RFC3339.

Return type:datetime
get_bootstrap()

Fetch bootstrap server credentials.

REST API Documentation.

Return type:ServerCredentials
get_lwm2m()

Fetch LwM2M server credentials.

REST API Documentation.

Return type:ServerCredentials
id

Unique entity ID.

Return type:str
server_certificate

PEM-format X.509 server certificate used to validate the server certificate received during the TLS/DTLS handshake.

Return type:str
server_uri

Server URI that the client connects to.

Return type:str
class mbed_cloud.foundation.SubtenantApiKey(_client=None, account_id=None, created_at=None, creation_time=None, id=None, key=None, last_login_time=None, name=None, owner=None, status=None, updated_at=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local SubtenantApiKey instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • account_id (str) – (Required) The ID of the account.
  • created_at (datetime) – Creation UTC time RFC3339.
  • creation_time (int) – The timestamp of the API key creation in the storage, in milliseconds.
  • id (str) – (Required) The ID of the API key.
  • key (str) – The API key.
  • last_login_time (int) – The timestamp of the latest API key usage, in milliseconds.
  • name (str) – (Required) The display name for the API key.
  • owner (str) – The owner of this API key, who is the creator by default.
  • status (str) – The status of the API key.
  • updated_at (datetime) – Last update UTC time RFC3339.
account_id

The ID of the account.

This field must be set when creating a new SubtenantApiKey Entity.

api example: ‘01619571e2e90242ac12000600000000’

Return type:str
create()

Create a new API key.

REST API Documentation.

Return type:SubtenantApiKey
created_at

Creation UTC time RFC3339.

api example: ‘2018-02-13T09:35:20Z’

Return type:datetime
creation_time

The timestamp of the API key creation in the storage, in milliseconds.

api example: 1518630727683

Return type:int
delete()

Delete the API key.

REST API Documentation.

Return type:SubtenantApiKey
id

The ID of the API key.

This field must be set when updating or deleting an existing SubtenantApiKey Entity.

api example: ‘01619571f7020242ac12000600000000’

Return type:str
key

The API key.

api example: ‘ak_1MDE2MTk1NzFmNmU4MDI0MmFjMTIwMDA2MDAwMDAwMDA01619571f7020242ac120006000000
00’
Return type:str
last_login_time

The timestamp of the latest API key usage, in milliseconds.

api example: 1518630727688

Return type:int
name

The display name for the API key.

This field must be set when creating a new SubtenantApiKey Entity.

api example: ‘API key gorgon’

Return type:str
owner

The owner of this API key, who is the creator by default.

api example: ‘01619571e2e89242ac12000600000000’

Return type:str
read()

Get API key details.

REST API Documentation.

Return type:SubtenantApiKey
status

The status of the API key.

api example: ‘ACTIVE’

Return type:str
update()

Update API key details.

REST API Documentation.

Return type:SubtenantApiKey
updated_at

Last update UTC time RFC3339.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
class mbed_cloud.foundation.SubtenantDarkThemeColor(_client=None, color=None, reference=None, updated_at=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local SubtenantDarkThemeColor instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • color (str) – The color given as name (purple) or as a hex code.
  • reference (str) – Color name.
  • updated_at (datetime) – Last update time in UTC.
color

The color given as name (purple) or as a hex code.

api example: ‘#f3f93e’

Return type:str
delete(account_id)

Reset branding color to default.

REST API Documentation.

Parameters:account_id (str) – Account ID.
Return type:
read(account_id)

Get dark theme branding color.

REST API Documentation.

Parameters:account_id (str) – Account ID.
Return type:SubtenantDarkThemeColor
reference

Color name.

Return type:str
update(account_id)

Updates a dark theme branding color.

REST API Documentation.

Parameters:account_id (str) – Account ID.
Return type:SubtenantDarkThemeColor
updated_at

Last update time in UTC.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
class mbed_cloud.foundation.SubtenantDarkThemeImage(_client=None, reference=None, static_uri=None, updated_at=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local SubtenantDarkThemeImage instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • reference (str) – Name of the image.
  • static_uri (str) – The static link to the image.
  • updated_at (datetime) – Last update time in UTC.
delete(account_id)

Revert an image to dark theme default.

REST API Documentation.

Parameters:account_id (str) – Account ID.
Return type:SubtenantDarkThemeImage
read(account_id)

Get metadata of a dark theme image.

REST API Documentation.

Parameters:account_id (str) – Account ID.
Return type:SubtenantDarkThemeImage
reference

Name of the image.

Return type:str
static_uri

The static link to the image.

api example: ‘https://static.mbed.com/123456789.jpg

Return type:str
update(account_id, image)

Upload a dark theme image.

REST API Documentation.

Parameters:
  • account_id (str) – Account ID.
  • image (file) – The image in PNG or JPEG format as multipart form data. Files can be provided as a file object or a path to an existing file on disk.
Return type:

SubtenantDarkThemeImage

updated_at

Last update time in UTC.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
class mbed_cloud.foundation.SubtenantLightThemeColor(_client=None, color=None, reference=None, updated_at=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local SubtenantLightThemeColor instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • color (str) – The color given as name (purple) or as a hex code.
  • reference (str) – Color name.
  • updated_at (datetime) – Last update time in UTC.
color

The color given as name (purple) or as a hex code.

api example: ‘#f3f93e’

Return type:str
delete(account_id)

Reset branding color to default.

REST API Documentation.

Parameters:account_id (str) – Account ID.
Return type:
read(account_id)

Get light theme branding color.

REST API Documentation.

Parameters:account_id (str) – Account ID.
Return type:SubtenantLightThemeColor
reference

Color name.

Return type:str
update(account_id)

Updates light theme branding color.

REST API Documentation.

Parameters:account_id (str) – Account ID.
Return type:SubtenantLightThemeColor
updated_at

Last update time in UTC.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
class mbed_cloud.foundation.SubtenantLightThemeImage(_client=None, reference=None, static_uri=None, updated_at=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local SubtenantLightThemeImage instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • reference (str) – Name of the image.
  • static_uri (str) – The static link to the image.
  • updated_at (datetime) – Last update time in UTC.
delete(account_id)

Revert an image to light theme default.

REST API Documentation.

Parameters:account_id (str) – Account ID.
Return type:SubtenantLightThemeImage
read(account_id)

Get metadata of a light theme image.

REST API Documentation.

Parameters:account_id (str) – Account ID.
Return type:SubtenantLightThemeImage
reference

Name of the image.

Return type:str
static_uri

The static link to the image.

api example: ‘https://static.mbed.com/123456789.jpg

Return type:str
update(account_id, image)

Upload a light theme image.

REST API Documentation.

Parameters:
  • account_id (str) – Account ID.
  • image (file) – The image in PNG or JPEG format as multipart form data. Files can be provided as a file object or a path to an existing file on disk.
Return type:

SubtenantLightThemeImage

updated_at

Last update time in UTC.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
class mbed_cloud.foundation.SubtenantTrustedCertificate(_client=None, account_id=None, certificate=None, certificate_fingerprint=None, created_at=None, description=None, device_execution_mode=None, enrollment_mode=None, id=None, is_developer_certificate=None, issuer=None, name=None, owner_id=None, service=None, status=None, subject=None, updated_at=None, valid=None, validity=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local SubtenantTrustedCertificate instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • account_id (str) – (Required) The ID of the account.
  • certificate (str) – (Required) X509.v3 trusted certificate in PEM format.
  • certificate_fingerprint (str) – A SHA-256 fingerprint of the certificate.
  • created_at (datetime) – Creation UTC time RFC3339.
  • description (str) – Human readable description of this certificate.
  • device_execution_mode (int) – Device execution mode where 1 means a developer certificate.
  • enrollment_mode (bool) – If true, signature is not required. Default value false.
  • id (str) – (Required) Entity ID.
  • is_developer_certificate (bool) – Whether or not this certificate is a developer certificate.
  • issuer (str) – Issuer of the certificate.
  • name (str) – (Required) Certificate name.
  • owner_id (str) – The ID of the owner.
  • service (str) – (Required) Service name where the certificate is used.
  • status (str) – Status of the certificate.
  • subject (str) – Subject of the certificate.
  • updated_at (datetime) – Last update UTC time RFC3339.
  • valid (bool) – This read-only flag indicates whether the certificate is valid or not.
  • validity (datetime) – Expiration time in UTC formatted as RFC3339.
account_id

The ID of the account.

This field must be set when creating a new SubtenantTrustedCertificate Entity.

api example: ‘01619571e2e90242ac12000600000000’

Return type:str
certificate

X509.v3 trusted certificate in PEM format.

This field must be set when creating a new SubtenantTrustedCertificate Entity.

api example: ‘—–BEGIN CERTIFICATE—– … —–END CERTIFICATE—–’

Return type:str
certificate_fingerprint

A SHA-256 fingerprint of the certificate.

api example: ‘a10fb2c8ba90e6de927bd0ae391dcc38f6115685de2d7024712af37ead0608f1’

Return type:str
create()

Upload new trusted certificate.

REST API Documentation.

Return type:SubtenantTrustedCertificate
created_at

Creation UTC time RFC3339.

api example: ‘2018-02-13T09:35:20Z’

Return type:datetime
delete()

Delete trusted certificate by ID.

REST API Documentation.

Return type:SubtenantTrustedCertificate
description

Human readable description of this certificate.

api example: ‘Certificate created by me.’

Return type:str
device_execution_mode

Device execution mode where 1 means a developer certificate.

api example: 1

Return type:int
enrollment_mode

If true, signature is not required. Default value false.

Return type:bool
get_developer_certificate_info()

Fetch an existing developer certificate to connect to the bootstrap server.

REST API Documentation.

Return type:DeveloperCertificate
id

Entity ID.

This field must be set when updating or deleting an existing SubtenantTrustedCertificate Entity.

api example: ‘01619571d01d0242ac12000600000000’

Return type:str
is_developer_certificate

Whether or not this certificate is a developer certificate.

api example: True

Return type:bool
issuer

Issuer of the certificate.

api example: ‘CN=issuer’

Return type:str
name

Certificate name.

This field must be set when creating a new SubtenantTrustedCertificate Entity.

api example: ‘My certificate’

Return type:str
owner_id

The ID of the owner.

api example: ‘01619571dad80242ac12000600000000’

Return type:str
read()

Get trusted certificate by ID.

REST API Documentation.

Return type:SubtenantTrustedCertificate
service

Service name where the certificate is used.

This field must be set when creating a new SubtenantTrustedCertificate Entity.

Return type:str
status

Status of the certificate.

api example: ‘ACTIVE’

Return type:str
subject

Subject of the certificate.

api example: ‘CN=subject’

Return type:str
update()

Update trusted certificate.

REST API Documentation.

Return type:SubtenantTrustedCertificate
updated_at

Last update UTC time RFC3339.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
valid

This read-only flag indicates whether the certificate is valid or not.

api example: True

Return type:bool
validity

Expiration time in UTC formatted as RFC3339.

api example: ‘2038-02-14T15:24:14Z’

Return type:datetime
class mbed_cloud.foundation.SubtenantUser(_client=None, account_id=None, active_sessions=None, address=None, created_at=None, creation_time=None, custom_fields=None, email=None, email_verified=None, full_name=None, id=None, is_gtc_accepted=None, is_marketing_accepted=None, is_totp_enabled=None, last_login_time=None, login_history=None, login_profiles=None, password=None, password_changed_time=None, phone_number=None, status=None, totp_scratch_codes=None, updated_at=None, username=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local SubtenantUser instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • account_id (str) – (Required) The ID of the account.
  • active_sessions (list) – List of active user sessions.
  • address (str) – Address.
  • created_at (datetime) – Creation UTC time RFC3339.
  • creation_time (int) – A timestamp of the user creation in the storage, in milliseconds.
  • custom_fields (dict) – User’s account-specific custom properties. The value is a string.
  • email (str) – (Required) The email address.
  • email_verified (bool) – A flag indicating whether the user’s email address has been verified or not.
  • full_name (str) – The full name of the user.
  • id (str) – (Required) The ID of the user.
  • is_gtc_accepted (bool) – A flag indicating that the user has accepted General Terms and Conditions.
  • is_marketing_accepted (bool) – A flag indicating that the user has consented to receive marketing information.
  • is_totp_enabled (bool) – A flag indicating whether two-factor authentication (TOTP) has been enabled.
  • last_login_time (int) – A timestamp of the latest login of the user, in milliseconds.
  • login_history (list) – Timestamps, succeedings, IP addresses and user agent information of the last five logins of the user, with timestamps in RFC3339 format.
  • login_profiles (list) – A list of login profiles for the user. Specified as the identity providers the user is associated with.
  • password (str) – The password when creating a new user. It will be generated when not present in the request.
  • password_changed_time (int) – A timestamp of the latest change of the user password, in milliseconds.
  • phone_number (str) – Phone number.
  • status (str) – The status of the user. ENROLLING state indicates that the user is in the middle of the enrollment process. INVITED means that the user has not accepted the invitation request. RESET means that the password must be changed immediately. INACTIVE users are locked out and not permitted to use the system.
  • totp_scratch_codes (list) – A list of scratch codes for the two-factor authentication. Visible only when 2FA is requested to be enabled or the codes regenerated.
  • updated_at (datetime) – Last update UTC time RFC3339.
  • username (str) – A username.
account_id

The ID of the account.

This field must be set when creating a new SubtenantUser Entity.

api example: ‘01619571e2e90242ac12000600000000’

Return type:str
active_sessions

List of active user sessions.

Return type:list[ActiveSession]
address

Address.

api example: ‘110 Fulbourn Rd, Cambridge, United Kingdom’

Return type:str
create(action=’create’)

Create a new user.

REST API Documentation.

Parameters:action (str) – Create or invite user.
Return type:SubtenantUser
created_at

Creation UTC time RFC3339.

api example: ‘2018-02-13T09:35:20Z’

Return type:datetime
creation_time

A timestamp of the user creation in the storage, in milliseconds.

api example: 1518630727683

Return type:int
custom_fields

User’s account-specific custom properties. The value is a string.

Return type:dict
delete()

Delete a user.

REST API Documentation.

Return type:SubtenantUser
email

The email address.

This field must be set when creating a new SubtenantUser Entity.

api example: ‘user@arm.com

Return type:str
email_verified

A flag indicating whether the user’s email address has been verified or not.

api example: True

Return type:bool
full_name

The full name of the user.

api example: ‘User Doe’

Return type:str
id

The ID of the user.

This field must be set when updating or deleting an existing SubtenantUser Entity.

api example: ‘01619571e2e89242ac12000600000000’

Return type:str
is_gtc_accepted

A flag indicating that the user has accepted General Terms and Conditions.

api example: True

Return type:bool
is_marketing_accepted

A flag indicating that the user has consented to receive marketing information.

api example: True

Return type:bool
is_totp_enabled

A flag indicating whether two-factor authentication (TOTP) has been enabled.

api example: True

Return type:bool
last_login_time

A timestamp of the latest login of the user, in milliseconds.

api example: 1518630727688

Return type:int
login_history

Timestamps, succeedings, IP addresses and user agent information of the last five logins of the user, with timestamps in RFC3339 format.

Return type:list[LoginHistory]
login_profiles

A list of login profiles for the user. Specified as the identity providers the user is associated with.

Return type:list[LoginProfile]
password

The password when creating a new user. It will be generated when not present in the request.

api example: ‘PZf9eEUH43DAPE9ULINFeuj’

Return type:str
password_changed_time

A timestamp of the latest change of the user password, in milliseconds.

api example: 1518630727688

Return type:int
phone_number

Phone number.

api example: ‘+44 (1223) 400 400’

Return type:str
read()

Details of the user.

REST API Documentation.

Return type:SubtenantUser
status

The status of the user. ENROLLING state indicates that the user is in the middle of the enrollment process. INVITED means that the user has not accepted the invitation request. RESET means that the password must be changed immediately. INACTIVE users are locked out and not permitted to use the system.

api example: ‘ACTIVE’

Return type:str
totp_scratch_codes

A list of scratch codes for the two-factor authentication. Visible only when 2FA is requested to be enabled or the codes regenerated.

Return type:list
update()

Update user details.

REST API Documentation.

Return type:SubtenantUser
updated_at

Last update UTC time RFC3339.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
username

A username.

api example: ‘admin’

Return type:str
validate_email()

Validate the user email.

REST API Documentation.

Return type:SubtenantUser
class mbed_cloud.foundation.SubtenantUserInvitation(_client=None, account_id=None, created_at=None, email=None, expiration=None, id=None, login_profiles=None, updated_at=None, user_id=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local SubtenantUserInvitation instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • account_id (str) – (Required) The ID of the account the user is invited to.
  • created_at (datetime) – Creation UTC time RFC3339.
  • email (str) – (Required) Email address of the invited user.
  • expiration (datetime) – Invitation expiration as UTC time RFC3339.
  • id (str) – (Required) The ID of the invitation.
  • login_profiles (list) – A list of login profiles for the user. Specified as the identity providers the user is associated with.
  • updated_at (datetime) – Last update UTC time RFC3339.
  • user_id (str) – The ID of the invited user.
account_id

The ID of the account the user is invited to.

This field must be set when creating a new SubtenantUserInvitation Entity.

api example: ‘01619571e2e90242ac12000600000000’

Return type:str
create(valid_for_days=30)

Create a user invitation.

REST API Documentation.

Parameters:valid_for_days (int) – Specifies how many days the invitation will be valid for.
Return type:SubtenantUserInvitation
created_at

Creation UTC time RFC3339.

api example: ‘2018-02-13T09:35:20Z’

Return type:datetime
delete()

Delete a user invitation.

REST API Documentation.

Return type:SubtenantUserInvitation
email

Email address of the invited user.

This field must be set when creating a new SubtenantUserInvitation Entity.

api example: ‘friend@arm.com

Return type:str
expiration

Invitation expiration as UTC time RFC3339.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
id

The ID of the invitation.

This field must be set when updating or deleting an existing SubtenantUserInvitation Entity.

api example: ‘01619571e2e89242ac12000600000000’

Return type:str
login_profiles

A list of login profiles for the user. Specified as the identity providers the user is associated with.

Return type:list[LoginProfile]
read()

Details of a user invitation.

REST API Documentation.

Return type:SubtenantUserInvitation
updated_at

Last update UTC time RFC3339.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
user_id

The ID of the invited user.

api example: ‘01619571e2e90242ac12000600000000’

Return type:str
class mbed_cloud.foundation.TrustedCertificate(_client=None, account_id=None, certificate=None, certificate_fingerprint=None, created_at=None, description=None, device_execution_mode=None, enrollment_mode=None, id=None, is_developer_certificate=None, issuer=None, name=None, owner_id=None, service=None, status=None, subject=None, updated_at=None, valid=None, validity=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local TrustedCertificate instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • account_id (str) – The ID of the account.
  • certificate (str) – (Required) X509.v3 trusted certificate in PEM format.
  • certificate_fingerprint (str) – A SHA-256 fingerprint of the certificate.
  • created_at (datetime) – Creation UTC time RFC3339.
  • description (str) – Human readable description of this certificate.
  • device_execution_mode (int) – Device execution mode where 1 means a developer certificate.
  • enrollment_mode (bool) – If true, signature is not required. Default value false.
  • id (str) – (Required) Entity ID.
  • is_developer_certificate (bool) – Whether or not this certificate is a developer certificate.
  • issuer (str) – Issuer of the certificate.
  • name (str) – (Required) Certificate name.
  • owner_id (str) – The ID of the owner.
  • service (str) – (Required) Service name where the certificate is used.
  • status (str) – Status of the certificate.
  • subject (str) – Subject of the certificate.
  • updated_at (datetime) – Last update UTC time RFC3339.
  • valid (bool) – This read-only flag indicates whether the certificate is valid or not.
  • validity (datetime) – Expiration time in UTC formatted as RFC3339.
account_id

The ID of the account.

api example: ‘01619571e2e90242ac12000600000000’

Return type:str
certificate

X509.v3 trusted certificate in PEM format.

This field must be set when creating a new TrustedCertificate Entity.

api example: ‘—–BEGIN CERTIFICATE—– … —–END CERTIFICATE—–’

Return type:str
certificate_fingerprint

A SHA-256 fingerprint of the certificate.

api example: ‘a10fb2c8ba90e6de927bd0ae391dcc38f6115685de2d7024712af37ead0608f1’

Return type:str
create()

Upload a new trusted certificate.

REST API Documentation.

Return type:TrustedCertificate
created_at

Creation UTC time RFC3339.

api example: ‘2018-02-13T09:35:20Z’

Return type:datetime
delete()

Delete a trusted certificate by ID.

REST API Documentation.

Return type:TrustedCertificate
description

Human readable description of this certificate.

api example: ‘Certificate created by me.’

Return type:str
device_execution_mode

Device execution mode where 1 means a developer certificate.

api example: 1

Return type:int
enrollment_mode

If true, signature is not required. Default value false.

Return type:bool
get_developer_certificate_info()

Fetch an existing developer certificate to connect to the bootstrap server.

REST API Documentation.

Return type:DeveloperCertificate
id

Entity ID.

This field must be set when updating or deleting an existing TrustedCertificate Entity.

api example: ‘01619571d01d0242ac12000600000000’

Return type:str
is_developer_certificate

Whether or not this certificate is a developer certificate.

api example: True

Return type:bool
issuer

Issuer of the certificate.

api example: ‘CN=issuer’

Return type:str
list(filter=None, order=’ASC’, max_results=None, page_size=50, include=None)

Get all trusted certificates.

REST API Documentation.

API Filters

The following filters are supported by the API when listing TrustedCertificate entities:

Field eq neq gte lte in nin like
device_execution_mode Y Y          
enrollment_mode Y            
expire Y            
issuer             Y
name Y            
owner Y            
service Y            
status Y            
subject             Y
valid Y            

Example Usage

from mbed_cloud.foundation import TrustedCertificate
from mbed_cloud import ApiFilter

api_filter = ApiFilter()
api_filter.add_filter("device_execution_mode", "eq", <filter value>)
for trusted_certificate in TrustedCertificate().list(filter=api_filter):
    print(trusted_certificate.device_execution_mode)
Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – An optional filter to apply when listing entities, please see the above API Filters table for supported filters.
  • order (str) – Record order based on creation time. Acceptable values: ASC, DESC. Default: ASC.
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return (2-1000). Default 50.
  • include (str) – Comma-separated additional data to return. Currently supported: total_count.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(TrustedCertificate)

name

Certificate name.

This field must be set when creating a new TrustedCertificate Entity.

api example: ‘My certificate’

Return type:str
owner_id

The ID of the owner.

api example: ‘01619571dad80242ac12000600000000’

Return type:str
read()

Get trusted certificate by ID.

REST API Documentation.

Return type:TrustedCertificate
service

Service name where the certificate is used.

This field must be set when creating a new TrustedCertificate Entity.

Return type:str
status

Status of the certificate.

api example: ‘ACTIVE’

Return type:str
subject

Subject of the certificate.

api example: ‘CN=subject’

Return type:str
update()

Update trusted certificate.

REST API Documentation.

Return type:TrustedCertificate
updated_at

Last update UTC time RFC3339.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
valid

This read-only flag indicates whether the certificate is valid or not.

api example: True

Return type:bool
validity

Expiration time in UTC formatted as RFC3339.

api example: ‘2038-02-14T15:24:14Z’

Return type:datetime
class mbed_cloud.foundation.UpdateCampaign(_client=None, autostop_reason=None, created_at=None, description=None, device_filter=None, device_filter_helper=None, finished=None, id=None, name=None, phase=None, root_manifest_id=None, root_manifest_url=None, started_at=None, updated_at=None, when=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local UpdateCampaign instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • autostop_reason (str) – Text description of why a campaign failed to start or why a campaign stopped.
  • created_at (datetime) – The time the update campaign was created
  • description (str) – An optional description of the campaign
  • device_filter (str) – (Required) The filter for the devices the campaign is targeting at
  • device_filter_helper (mbed_cloud.client.api_filter.ApiFilter) – Helper for creating the device filter string.
  • finished (datetime) – The campaign finish timestamp
  • id (str) – (Required) The campaign ID
  • name (str) – The campaign name
  • phase (str) – The current phase of the campaign.
  • root_manifest_id (str) –
  • root_manifest_url (str) –
  • started_at (datetime) –
  • updated_at (datetime) – The time the object was updated
  • when (datetime) – The scheduled start time for the campaign. The campaign will start within 1 minute when then start time has elapsed.
archive()

Archive a campaign.

REST API Documentation.

Return type:UpdateCampaign
autostop_reason

Text description of why a campaign failed to start or why a campaign stopped.

api example: ‘Insufficient billing credit.’

Return type:str
create()

Create a campaign

REST API Documentation.

Return type:UpdateCampaign
created_at

The time the update campaign was created

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
delete()

Delete a campaign

REST API Documentation.

Return type:UpdateCampaign
description

An optional description of the campaign

Return type:str
device_filter

The filter for the devices the campaign is targeting at

This field must be set when creating a new UpdateCampaign Entity.

api example: ‘id__eq=00000000000000000000000000000000’

Return type:str
device_filter_helper

Helper for creating the device filter string.

This helper can be used instead of setting device filter directly. This allows the campaign filter to be created in a way which is similar to the device listing filter.

  • See mbed_cloud.foundation.entities.devices.device.Device.list for details.
Return type:mbed_cloud.client.api_filter.ApiFilter
device_metadata(filter=None, order=None, max_results=None, page_size=None, include=None)

List all campaign device metadata

REST API Documentation.

Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – Filtering when listing entities is not supported by the API for this entity.
  • order (str) – ASC or DESC
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – How many objects to retrieve in the page. The minimum limit is 2 and the maximum is 1000. Limit values outside of this range are set to the closest limit.
  • include (str) – A comma-separated list of data fields to return. Currently supported: total_count
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(CampaignDeviceMetadata)

finished

The campaign finish timestamp

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
id

The campaign ID

This field must be set when updating or deleting an existing UpdateCampaign Entity.

api example: ‘00000000000000000000000000000000’

Return type:str
list(filter=None, order=None, max_results=None, page_size=None, include=None)

List all campaigns

REST API Documentation.

API Filters

The following filters are supported by the API when listing UpdateCampaign entities:

Field eq neq gte lte in nin like
created_at     Y Y Y Y  
description Y Y     Y Y  
device_filter Y Y     Y Y  
finished     Y Y Y Y  
id Y Y     Y Y  
name Y Y     Y Y  
root_manifest_id Y Y     Y Y  
started_at     Y Y Y Y  
state Y Y     Y Y  
updated_at     Y Y Y Y  
when     Y Y Y Y  

Example Usage

from mbed_cloud.foundation import UpdateCampaign
from mbed_cloud import ApiFilter

api_filter = ApiFilter()
api_filter.add_filter("created_at", "in", <filter value>)
for update_campaign in UpdateCampaign().list(filter=api_filter):
    print(update_campaign.created_at)
Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – An optional filter to apply when listing entities, please see the above API Filters table for supported filters.
  • order (str) – The order of the records. Acceptable values: ASC, DESC. Default: ASC
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – How many objects to retrieve in the page. The minimum limit is 2 and the maximum is 1000. Limit values outside of this range are set to the closest limit.
  • include (str) – A comma-separated list of data fields to return. Currently supported: total_count
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(UpdateCampaign)

name

The campaign name

api example: ‘campaign’

Return type:str
phase

The current phase of the campaign.

Return type:str
read()

Get a campaign.

REST API Documentation.

Return type:UpdateCampaign
root_manifest_id

api example: ‘00000000000000000000000000000000’

Return type:str
root_manifest_url

api example: ‘http://example.com/00000000000000000000000000000000

Return type:str
start()

Start a campaign.

REST API Documentation.

Return type:UpdateCampaign
started_at

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
stop()

Stop a campaign.

REST API Documentation.

Return type:UpdateCampaign
update()

Modify a campaign

REST API Documentation.

Return type:UpdateCampaign
updated_at

The time the object was updated

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
when

The scheduled start time for the campaign. The campaign will start within 1 minute when then start time has elapsed.

api example: ‘2017-05-22T12:37:55.576563Z’

Return type:datetime
class mbed_cloud.foundation.User(_client=None, account_id=None, active_sessions=None, address=None, created_at=None, creation_time=None, custom_fields=None, email=None, email_verified=None, full_name=None, id=None, is_gtc_accepted=None, is_marketing_accepted=None, is_totp_enabled=None, last_login_time=None, login_history=None, login_profiles=None, password=None, password_changed_time=None, phone_number=None, status=None, totp_scratch_codes=None, updated_at=None, username=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local User instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • account_id (str) – The ID of the account.
  • active_sessions (list) – List of active user sessions.
  • address (str) – Address.
  • created_at (datetime) – Creation UTC time RFC3339.
  • creation_time (int) – A timestamp of the user creation in the storage, in milliseconds.
  • custom_fields (dict) – User’s account-specific custom properties. The value is a string.
  • email (str) – (Required) The email address.
  • email_verified (bool) – A flag indicating whether the user’s email address has been verified or not.
  • full_name (str) – The full name of the user.
  • id (str) – (Required) The ID of the user.
  • is_gtc_accepted (bool) – A flag indicating that the user has accepted General Terms and Conditions.
  • is_marketing_accepted (bool) – A flag indicating that the user has consented to receive marketing information.
  • is_totp_enabled (bool) – A flag indicating whether two-factor authentication (TOTP) has been enabled.
  • last_login_time (int) – A timestamp of the latest login of the user, in milliseconds.
  • login_history (list) – Timestamps, succeedings, IP addresses and user agent information of the last five logins of the user, with timestamps in RFC3339 format.
  • login_profiles (list) – A list of login profiles for the user. Specified as the identity providers the user is associated with.
  • password (str) – The password when creating a new user. It will be generated when not present in the request.
  • password_changed_time (int) – A timestamp of the latest change of the user password, in milliseconds.
  • phone_number (str) – Phone number.
  • status (str) – The status of the user. ENROLLING state indicates that the user is in the middle of the enrollment process. INVITED means that the user has not accepted the invitation request. RESET means that the password must be changed immediately. INACTIVE users are locked out and not permitted to use the system.
  • totp_scratch_codes (list) – A list of scratch codes for the two-factor authentication. Visible only when 2FA is requested to be enabled or the codes regenerated.
  • updated_at (datetime) – Last update UTC time RFC3339.
  • username (str) – A username.
account_id

The ID of the account.

api example: ‘01619571e2e90242ac12000600000000’

Return type:str
active_sessions

List of active user sessions.

Return type:list[ActiveSession]
address

Address.

api example: ‘110 Fulbourn Rd, Cambridge, United Kingdom’

Return type:str
create(action=’create’)

Create a new user.

REST API Documentation.

Parameters:action (str) – Action, either create or invite.
Return type:User
created_at

Creation UTC time RFC3339.

api example: ‘2018-02-13T09:35:20Z’

Return type:datetime
creation_time

A timestamp of the user creation in the storage, in milliseconds.

api example: 1518630727683

Return type:int
custom_fields

User’s account-specific custom properties. The value is a string.

Return type:dict
delete()

Delete a user.

REST API Documentation.

Return type:User
email

The email address.

This field must be set when creating a new User Entity.

api example: ‘user@arm.com

Return type:str
email_verified

A flag indicating whether the user’s email address has been verified or not.

api example: True

Return type:bool
full_name

The full name of the user.

api example: ‘User Doe’

Return type:str
id

The ID of the user.

This field must be set when updating or deleting an existing User Entity.

api example: ‘01619571e2e89242ac12000600000000’

Return type:str
is_gtc_accepted

A flag indicating that the user has accepted General Terms and Conditions.

api example: True

Return type:bool
is_marketing_accepted

A flag indicating that the user has consented to receive marketing information.

api example: True

Return type:bool
is_totp_enabled

A flag indicating whether two-factor authentication (TOTP) has been enabled.

api example: True

Return type:bool
last_login_time

A timestamp of the latest login of the user, in milliseconds.

api example: 1518630727688

Return type:int
list(filter=None, order=’ASC’, max_results=None, page_size=50, include=None)

Get the details of all users.

REST API Documentation.

API Filters

The following filters are supported by the API when listing User entities:

Field eq neq gte lte in nin like
email Y            
login_profiles Y            
status Y       Y Y  

Example Usage

from mbed_cloud.foundation import User
from mbed_cloud import ApiFilter

api_filter = ApiFilter()
api_filter.add_filter("email", "eq", <filter value>)
for user in User().list(filter=api_filter):
    print(user.email)
Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – An optional filter to apply when listing entities, please see the above API Filters table for supported filters.
  • order (str) – Record order based on creation time. Acceptable values: ASC, DESC. Default: ASC.
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return (2-1000). Default 50.
  • include (str) – Comma-separated additional data to return. Currently supported: total_count.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(User)

login_history

Timestamps, succeedings, IP addresses and user agent information of the last five logins of the user, with timestamps in RFC3339 format.

Return type:list[LoginHistory]
login_profiles

A list of login profiles for the user. Specified as the identity providers the user is associated with.

Return type:list[LoginProfile]
password

The password when creating a new user. It will be generated when not present in the request.

api example: ‘PZf9eEUH43DAPE9ULINFeuj’

Return type:str
password_changed_time

A timestamp of the latest change of the user password, in milliseconds.

api example: 1518630727688

Return type:int
phone_number

Phone number.

api example: ‘+44 (1223) 400 400’

Return type:str
read()

Details of a user.

REST API Documentation.

Return type:User
status

The status of the user. ENROLLING state indicates that the user is in the middle of the enrollment process. INVITED means that the user has not accepted the invitation request. RESET means that the password must be changed immediately. INACTIVE users are locked out and not permitted to use the system.

api example: ‘ACTIVE’

Return type:str
totp_scratch_codes

A list of scratch codes for the two-factor authentication. Visible only when 2FA is requested to be enabled or the codes regenerated.

Return type:list
update()

Update user details.

REST API Documentation.

Return type:User
updated_at

Last update UTC time RFC3339.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
username

A username.

api example: ‘admin’

Return type:str
class mbed_cloud.foundation.UserInvitation(_client=None, account_id=None, created_at=None, email=None, expiration=None, id=None, login_profiles=None, updated_at=None, user_id=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local UserInvitation instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • account_id (str) – The ID of the account the user is invited to.
  • created_at (datetime) – Creation UTC time RFC3339.
  • email (str) – (Required) Email address of the invited user.
  • expiration (datetime) – Invitation expiration as UTC time RFC3339.
  • id (str) – (Required) The ID of the invitation.
  • login_profiles (list) – A list of login profiles for the user. Specified as the identity providers the user is associated with.
  • updated_at (datetime) – Last update UTC time RFC3339.
  • user_id (str) – The ID of the invited user.
account_id

The ID of the account the user is invited to.

api example: ‘01619571e2e90242ac12000600000000’

Return type:str
create(valid_for_days=30)

Create a user invitation.

REST API Documentation.

Parameters:valid_for_days (int) – Specifies how many days the invitation will be valid for.
Return type:UserInvitation
created_at

Creation UTC time RFC3339.

api example: ‘2018-02-13T09:35:20Z’

Return type:datetime
delete()

Delete a user invitation.

REST API Documentation.

Return type:UserInvitation
email

Email address of the invited user.

This field must be set when creating a new UserInvitation Entity.

api example: ‘friend@arm.com

Return type:str
expiration

Invitation expiration as UTC time RFC3339.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
id

The ID of the invitation.

This field must be set when updating or deleting an existing UserInvitation Entity.

api example: ‘01619571e2e89242ac12000600000000’

Return type:str
list(filter=None, order=’ASC’, max_results=None, page_size=50, include=None)

Get the details of all user invitations.

REST API Documentation.

API Filters

The following filters are supported by the API when listing UserInvitation entities:

Field eq neq gte lte in nin like
login_profiles Y            

Example Usage

from mbed_cloud.foundation import UserInvitation
from mbed_cloud import ApiFilter

api_filter = ApiFilter()
api_filter.add_filter("login_profiles", "eq", <filter value>)
for user_invitation in UserInvitation().list(filter=api_filter):
    print(user_invitation.login_profiles)
Parameters:
  • filter (mbed_cloud.client.api_filter.ApiFilter) – An optional filter to apply when listing entities, please see the above API Filters table for supported filters.
  • order (str) – Record order based on creation time. Acceptable values: ASC, DESC. Default: ASC.
  • max_results (int) – Total maximum number of results to retrieve
  • page_size (int) – The number of results to return (2-1000). Default 50.
  • include (str) – Comma separated additional data to return.
Returns:

An iterator object which yields instances of an entity.

Return type:

mbed_cloud.pagination.PaginatedResponse(UserInvitation)

login_profiles

A list of login profiles for the user. Specified as the identity providers the user is associated with.

Return type:list[LoginProfile]
read()

Details of a user invitation.

REST API Documentation.

Return type:UserInvitation
updated_at

Last update UTC time RFC3339.

api example: ‘2018-02-14T15:24:14Z’

Return type:datetime
user_id

The ID of the invited user.

api example: ‘01619571e2e90242ac12000600000000’

Return type:str
class mbed_cloud.foundation.VerificationResponse(_client=None, message=None, successful=None)

Bases: mbed_cloud.foundation.common.entity_base.Entity

Creates a local VerificationResponse instance

Parameters can be supplied on creation of the instance or given by setting the properties on the instance after creation.

Parameters marked as required must be set for one or more operations on the entity. For details on when they are required please see the documentation for the setter method.

Parameters:
  • message (str) – Provides details in case of failure.
  • successful (bool) – Indicates whether the certificate issuer was verified successfully.
message

Provides details in case of failure.

api example: ‘message describing the verification failure’

Return type:str
successful

Indicates whether the certificate issuer was verified successfully.

Return type:bool

Subpackages