Ionburst Cloud SDKs

Develop and deploy applications with the Ionburst Cloud SDK

SDKs are currently available for the Ionburst Cloud API in the following languages:

.NET

The Ionburst SDK for .NET/.NET Core is available now on NuGeT.

Repository

The source code for the Ionburst .NET/.NET Core SDK is available here.

NuGeT

Ionburst.SDK

Node.js

The Ionburst SDK for Node.js is available now on npm.

Repository

The source code for the Ionburst Node.js SDK is available here.

NPM

ionburst-sdk-javascript

Python

The Ionburst SDK for Python is available now on PyPI (pip).

Repository

The source code for the Ionburst Python SDK is available here.

PyPi

ionburst-sdk-python

Go

The Ionburst SDK for Go is currently under development.

Repository

The source code for the Ionburst Go SDK will shortly be available here.

Configuration

The Ionburst SDKs can be configured using two main methods:

  • Environment variables
  • Credentials file

This list should be taken as the order of precedence.

Environment Variables

If the credentials file is not used, then environment variables can be used:

  • Ionburst API ID: IONBURST_ID
  • Ionburst API Key: IONBURST_KEY
export IONBURST_ID=IB******************
export IONBURST_KEY=eW91aGF2ZXRvb211Y2h0aW1lb255b3VyaGFuZHMh

Credentials File

The Ionburst credentials file is stored within a well-known directory in the user's home folder.

  • MacOS/Linux: ~/.ionburst/credentials
  • Windows: %USERPROFILE%\.ionburst\credentials

The credentials file is INI formatted, and allows multiple sets of credentials to be used:

[example_profile]
ionburst_id=IB******************
ionburst_key=eW91aGF2ZXRvb211Y2h0aW1lb255b3VyaGFuZHMh
[example_profile2]
ionburst_id=IB******************
ionburst_key=c2VyaW91c2x5Li4uZ29vdXRzaWRlYW5kcGxheSEK
ionburst_uri=https://api.example.ionburst.io/

Further Configuration

Further configuration of the Ionburst SDK can be specified in a configuration file, placed in the root of the project.

.NET

.NET Configuration

Further configuration for the Ionburst SDK can be specified in the appsettings.json file.

"Ionburst": {
"Profile": "example_profile",
"IonburstUri": "https://api.example.ionburst.io/",
"TraceCredentialsFile": "OFF"
}
  • Profile specifies the configuration to use from the Ionburst credentials file.
  • IonburstUri specifies the Ionburst API endpoint to use.
  • TraceCredentialsFile is a debug setting that can be used to trace how the SDK picks up credentials. This should not be set to ON in production.

Python

Python Configuration

Further configuration for the Ionburst SDK can be specified in a config.json file.

"Ionburst": {
"Profile": "example_profile",
"IonburstUri": "https://api.example.ionburst.io/",
"TraceCredentialsFile": "OFF"
}
  • Profile specifies the configuration to use from the Ionburst credentials file.
  • IonburstUri specifies the Ionburst API endpoint to use.
  • TraceCredentialsFile is a debug setting that can be used to trace how the SDK picks up credentials. This should not be set to ON in production.

Node.js

Node.js Configuration

Further configuration for the Ionburst Node.js SDK can be specified in a config.json file.

"Ionburst": {
"Profile": "example_profile",
"IonburstUri": "https://api.example.ionburst.io/",
"TraceCredentialsFile": "OFF"
}
  • Profile specifies the configuration to use from the Ionburst credentials file.
  • IonburstUri specifies the Ionburst API endpoint to use.
  • TraceCredentialsFile is a debug setting that can be used to trace how the SDK picks up credentials. This should not be set to ON in production.

Go

Go Configuration

Coming soon!

Usage

Creating a Client

.NET

An Ionburst client can be created by passing an Ionburst API URI directly. Doing so will override any configured value:

IIonburstClient client = IonburstClientFactory.CreateIonburstClient("https://api.example.ionburst.io/");

If the value is defined in configuration then the client creation does not require parameters:

IIonburstClient client = IonburstClientFactory.CreateIonburstClient();

Python

An Ionburst client can be created by passing an Ionburst API URI directly. Doing so will override any configured value:

from Ionburst import Ionburst
ionburst = Ionburst("https://api.example.ionburst.io/")

If the value is defined in configuration then the client creation does not require parameters:

from Ionburst import Ionburst
ionburst = Ionburst()

Node.js

An Ionburst client can be created by passing an Ionburst API URI directly. Doing so will override any configured value:

const Ionburst = require('ionburst-sdk')
var ionburst = Ionburst("https://api.example.ionburst.io/");

If the value is defined in configuration then the client creation does not require parameters:

const Ionburst = require('ionburst-sdk')
var ionburst = Ionburst();

Go

Coming soon!

Classifications

.NET

A list of available Ionburst classifications can be retrieved like so:

GetPolicyClassificationRequest classRequest = new GetPolicyClassificationRequest();
GetPolicyClassificationResult classResult = await client.GetClassificationsAsync(classRequest);
if (classResult.StatusCode == 200)
{
Console.WriteLine($"[{string.Join(",", classResult.ClassificationList)}]");
}

Python

A list of available Ionburst classifications can be retrieved like so:

data = ionburst.getClassifications()

Node.js

A list of available Ionburst classifications can be retrieved like so:

const Ionburst = require('ionburst-sdk')
var ionburst = Ionburst();

Go

Coming soon!

Upload Data

.NET

PutObjectRequest putRequest = new PutObjectRequest
{
Particle = "TestObject",
PolicyClassification = "Restricted",
DataStream = input
};
Task<PutObjectResult> putTask = client.PutAsync(putRequest);
PutObjectResult putResult = putTask.Result;

Python

result = ionburst.put({
id: '...',
data: '...',
classstr: '...' // Not Required
})

Node.js

Upload with callback:

ionburst.put({
id: '...',
data: '...',
classstr: '...' // Not Required
}, function(err, data) {
...
});

Upload with async/await:

let data = await ionburst.putAsync({
id: '...',
data: '...',
classstr: '...' // Not Required
});

Go

Coming soon!

Downloading Data

.NET

GetObjectRequest getRequest = new GetObjectRequest
{
Particle = "TestObject"
};
Task<GetObjectResult> getTask = client.GetAsync(getRequest);
GetObjectResult getResult = getTask.Result;

Python

result = ionburst.get(id)

Node.js

Download with callback:

ionburst.get(id, function(err, data) {
...
});

Download with async/await:

let data = await ionburst.getAsync(id);

Go

Coming soon!

Delete Data

.NET

DeleteObjectRequest deleteRequest = new DeleteObjectRequest
{
Particle = "TestObject"
};
Task<DeleteObjectResult> deleteTask = client.DeleteAsync(deleteRequest);
DeleteObjectResult deleteResult = deleteTask.Result;

Python

result = ionburst.delete(id)

Node.js

Delete with callback:

ionburst.delete(id, function(err, data) {
...
});

Delete with async/await:

let data = await ionburst.deleteAsync(id);

Go

Coming soon!

Upload Data (Deferred)

.NET

PutObjectRequest putRequest = new PutObjectRequest
{
Particle = objectId,
PolicyClassification = "Restricted",
DataStream = input,
PhasedMode = true
};
DeferredActionResult deferredPut = client.StartDeferredActionAsync(putRequest).Result;

Python

token = ionburst.startDeferredAction({
action: 'PUT',
id: '...',
data: '...',
classstr: '...' // Not Required
})

Node.js

Deferred upload with callback:

ionburst.startDeferredAction({
action: 'PUT',
id: '...',
data: '...',
classstr: '...' // Not Required
}, function(err, token) {
...
});

Deferred upload with async/await:

let token = await ionburst.startDeferredActionAsync({
action: 'PUT',
id: '...',
data: '...',
classstr: '...' // Not Required
});

Go

Coming soon!

Download Data (Deferred)

.NET

GetObjectRequest getRequest = new GetObjectRequest
{
Particle = objectId,
PhasedMode = true
};
DeferredActionResult deferredGet = client.StartDeferredActionAsync(getRequest).Result;

Python

token = ionburst.startDeferredAction({
action: 'GET',
id: '...'
})

Node.js

Deferred download with callback:

ionburst.startDeferredAction({
action: 'GET',
id: '...'
}, function(err, token) {
...
});

Deferred download with async/await:

let token = await ionburst.startDeferredActionAsync({
action: 'GET',
id: '...'
});

Go

Coming soon!

Check Deferred Request

.NET

DeferredCheckResult deferredPutResult = client.CheckDeferredActionAsync(putRequest).Result;

Python

result = ionburst.checkDeferred(token)

Node.js

Check deferred status with callback:

ionburst.checkDeferred(token, function(err, token) {
...
});

Check deferred status with async/await:

let result = await ionburst.fetch(token);

Go

Coming soon!

Fetch Data (Deferred)

.NET

getResult = client.GetAsync(getRequest).Result;

Python

result = ionburst.fetch(token)

Node.js

Fetch data with callback:

ionburst.fetch(token, function(err, result) {
...
});

Fetch data with async/await:

let result = await ionburst.fetchAsync(token);

Go

Coming soon!