SCI (Server Command Interface) API

SCI Overview

Provide access to Device Cloud Server Command Interface used for sending messages to devices connected to Device Cloud.

SCI API Documentation

Server Command Interface functionality

class devicecloud.sci.TargetABC

Abstract base class for all target types

class devicecloud.sci.DeviceTarget(device_id)

Target a specific device

class devicecloud.sci.AllTarget

Target all devices

class devicecloud.sci.TagTarget(tag)

Target devices having a specific tag

class devicecloud.sci.GroupTarget(group)

Target devices in a specific group

class devicecloud.sci.AsyncRequestProxy(job_id, conn)

An object representing an asynychronous SCI request.

Can be used for polling the status of the corresponding request.

Variables
  • job_id – the ID in device cloud of the job

  • response – the response to the request if completed

  • completed – True if the request has completed, False otherwise; queries on read

class devicecloud.sci.ServerCommandInterfaceAPI(conn)

Encapsulate Server Command Interface API

get_async_job(job_id)

Query an asynchronous SCI job by ID

This is useful if the job was not created with send_sci_async().

Parameters

job_id (int) – The job ID to query

Returns

The SCI response from GETting the job information

send_sci_async(operation, target, payload, **sci_options)

Send an asynchronous SCI request, and wraps the job in an object to manage it

Parameters
  • operation (str) – The operation is one of {send_message, update_firmware, disconnect, query_firmware_targets, file_system, data_service, and reboot}

  • target (TargetABC or list of TargetABC instances) – The device(s) to be targeted with this request

TODO: document other params

send_sci(operation, target, payload, reply=None, synchronous=None, sync_timeout=None, cache=None, allow_offline=None, wait_for_reconnect=None, attribute=None)

Send SCI request to 1 or more targets

Parameters
  • operation (str) – The operation is one of {send_message, update_firmware, disconnect, query_firmware_targets, file_system, data_service, and reboot}

  • target (TargetABC or list of TargetABC instances) – The device(s) to be targeted with this request

TODO: document other params