Deployments

In this section we take a look at the creation and handling of deployments inside user-created projects.

Deployments are the way you organize your clusters of sensors (Spots) that are geographically close together in any hierarchical project.

Once created, a deployment can hold any number of Spots, which in turn hold the sensors which send data to the API link.

Note that all of the sensors associated with a Deployment will be traced at the commit interval of the Deployment they are associated with, the user must create a new Deployment with a different commit interval if they want some sensors' data to be uploaded at different intervals.

Creating a Deployment

The user is able to create a new deployment from the website, whenever a new project is created, by pressing the "Edit project" button in the Projects view, or by calling the following endpoint with any valid form of authorization.

Creates a new Deployment

POST https://api.airtrace.io/v1/projects/{id_project}/deployments

Path Parameters

Name
Type
Description

id_project*

String

The id of the project in which the new deployment will be created

Request Body

Name
Type
Description

name*

String

Name of the new deployment

type

String

The deployment type (default is "map")

status*

String

Is set to "active" for the deployment to work

data*

[Double, Double, Double]

Map coordinates of the deployment

commit_interval*

Integer

A valid commit interval at which the data will be uploaded to the Blockchain

Deployment Information

In the Projects page, the user can press the "View" button of any project to access all the Deployments associated with that project

Your deployments

Alternatively, the user can call the following endpoint to access all of the Deployments associated with any specific project that is owned by the user.

Returns all Deployments associated with a Project

GET https://api.airtrace.io/v1/projects/{id}/deployments

Creating new Spots

The user can create new Spots at the Map Screen when creating or editing a new Deployment.

Spots Map

Alternatively, the user can create a new Spot for any Deployment by calling the following API endpoint:

Creates a new Spot associated with a specific Deployment

POST /projects/{id}/deployments/{id_deployment}/spots

Path Parameters

Name
Type
Description

id_project*

String

The id of the project that will contain the Spot

id_deployment*

String

The id of the Deployment that will contain the Spot

Request Body

Name
Type
Description

name*

String

The name of the Spot the user wants to create

status*

String

Is set to "active" for the project to work

location*

[Double, Double, Double]

The map coordinates of the Spot

sensors_spots

[Integer...]

List of the ids of the Sensors associated with this Spot, the field is optional as the Sensors can be associated after Spot creation

categories_spots

[Integer...]

List of the ids of the Categories associated with this Spot, the field is optional as the Categories can be associated after Spot creation

Adding sensors to your Spots

The user can select any number of sensors from the list of the sensors supported by Airtrace and directly assign them to the Spot whenever a Deployment is being created or edited.

The sensors will be assigned to your Spot and their identities will automatically be created using the unique user-provided primary identifier for the user's sensor.

Selecting a new sensor for a Spot

Alternatively, the user can assign a sensor to any Spot by calling the following API endpoint:

Assigns a Sensor to a specific Spot

POST /projects/{id}/deployments/{id_deployment}/spots/{id_spot}​/sensors

Path Parameters

Name
Type
Description

id_project*

String

The id of the project that will contain the Spot

id_deployment*

String

The id of the Deployment that will contain the Spot

id_spot*

String

The id of the Spot the sensor will be assigned to

Request Body

Name
Type
Description

id_sensor*

String

The id of the sensor that will be assigned to the Spot

Note that after calling this endpoint, the Deployment will not immediately upload data from that sensor to the blockchain, as an identity needs to be created and associated with the sensor_spot first for it to be able to upload data.

For more information on identity creation and assigning see Identities

Adding Categories to your Spots

The user can add categories to any Spot they own during Deployment creation or editing in the website.

Alternatively, the user can assign a category to any Spot by calling the following API endpoint:

Assigns a Category to a specific Spot

POST /projects/{id}/deployments/{id_deployment}/spots/{id_spot}​/categories

Path Parameters

Name
Type
Description

id_project*

String

The id of the project that will contain the Spot

id_deployment*

String

The id of the Deployment that will contain the Spot

id_spot*

String

The id of the Spot the sensor will be assigned to

Request Body

Name
Type
Description

id_category*

String

The id of the category that will be assigned to the Spot

Last updated