Skip to main content

Edge Deployments Actions

https://api.losant.com/applications/APPLICATION_ID/edge/deployments

Below are the various requests that can be performed against the Edge Deployments resource, as well as the expected parameters and the potential responses.

Get​

Returns the edge deployments for an application

Method And Url​

GET https://api.losant.com/applications/APPLICATION_ID/edge/deployments

Authentication​

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Application, all.Application.bounded, all.Application.read, all.Organization, all.Organization.bounded, all.Organization.read, all.User, all.User.bounded, all.User.read, edgeDeployments.*, or edgeDeployments.get.

Request Path Components​

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Query Parameters​

NameRequiredDescriptionDefaultExample
sortFieldNField to sort the results by. Accepted values are: id, deviceId, flowId, desiredVersion, currentVersion, creationDate, lastUpdatedlastUpdatedsortField=creationDate
sortDirectionNDirection to sort the results by. Accepted values are: asc, descascsortDirection=asc
pageNWhich page of results to return0page=0
perPageNHow many items to return per page100perPage=10
deviceIdNFilter deployments to the given Device IDdeviceId=575ecf887ae143cd83dc4aa2
versionNFilter deployments to the given Workflow Version (matches against both current and desired)version=myFlowVersion
filterEmptyNFilter out deployments where both the current and desired version are null.filterEmpty=true
flowIdNFilter deployments to the given Workflow IDflowId=575ed18f7ae143cd83dc4aa6

Request Headers​

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example​

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X GET \
https://api.losant.com/applications/APPLICATION_ID/edge/deployments

Successful Responses​

CodeTypeDescription
200Edge DeploymentsCollection of edge deployments

Error Responses​

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application was not found

Release​

Deploy an edge workflow version to one or more edge devices. Version can be blank, if removal is desired.

Method And Url​

POST https://api.losant.com/applications/APPLICATION_ID/edge/deployments/release

Authentication​

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Application, all.Application.bounded, all.Organization, all.Organization.bounded, all.User, all.User.bounded, edgeDeployments.*, or edgeDeployments.release.

Request Path Components​

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Headers​

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body​

The body of the request should be serialized JSON that validates against the Edge Deployment Release schema. For example, the following would be a valid body for this request:

{
"deployments": [
{
"flowId": "575ed18f7ae143cd83dc4aa6",
"version": "v1.2.3"
}
],
"deviceIds": [
"575ecf887ae143cd83dc4aa2"
]
}

Curl Example​

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
-d '{"deployments":[{"flowId":"575ed18f7ae143cd83dc4aa6","version":"v1.2.3"}],"deviceIds":["575ecf887ae143cd83dc4aa2"]}' \
https://api.losant.com/applications/APPLICATION_ID/edge/deployments/release

Successful Responses​

CodeTypeDescription
202SuccessIf deployment release has been accepted for processing

Error Responses​

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application was not found

Remove​

Remove all edge deployments from a device, remove all edge deployments of a workflow, or remove a specific workflow from a specific device

Method And Url​

POST https://api.losant.com/applications/APPLICATION_ID/edge/deployments/remove

Authentication​

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Application, all.Application.bounded, all.Organization, all.Organization.bounded, all.User, all.User.bounded, edgeDeployments.*, or edgeDeployments.remove.

Request Path Components​

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Headers​

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body​

The body of the request should be serialized JSON that validates against the Edge Deployment Remove schema. For example, the following would be a valid body for this request:

{
"flowId": "575ed18f7ae143cd83dc4aa6",
"deviceId": null
}

Curl Example​

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
-d '{"flowId":"575ed18f7ae143cd83dc4aa6","deviceId":null}' \
https://api.losant.com/applications/APPLICATION_ID/edge/deployments/remove

Successful Responses​

CodeTypeDescription
202SuccessIf deployment removal has been accepted for processing

Error Responses​

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application was not found

Replace​

Replace deployments of an edge workflow version with a new version. New version can be blank, if removal is desired.

Method And Url​

POST https://api.losant.com/applications/APPLICATION_ID/edge/deployments/replace

Authentication​

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Application, all.Application.bounded, all.Organization, all.Organization.bounded, all.User, all.User.bounded, edgeDeployments.*, or edgeDeployments.replace.

Request Path Components​

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Headers​

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body​

The body of the request should be serialized JSON that validates against the Edge Deployment Replace schema. For example, the following would be a valid body for this request:

{
"flowId": "575ed18f7ae143cd83dc4aa6",
"oldVersion": "v1.2.3",
"newVersion": "v1.2.4"
}

Curl Example​

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
-d '{"flowId":"575ed18f7ae143cd83dc4aa6","oldVersion":"v1.2.3","newVersion":"v1.2.4"}' \
https://api.losant.com/applications/APPLICATION_ID/edge/deployments/replace

Successful Responses​

CodeTypeDescription
202SuccessIf deployment replacement has been accepted for processing

Error Responses​

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application was not found

Schemas​

Edge Deployment Release​

Schema for deploying one or more edge workflows to one or more edge devices

Edge Deployment Release Schema​

  • ▶
    {} 2 keys
    • "http://json-schema.org/draft-07/schema#"
    • ▶
      [] 2 items

    Edge Deployment Release Example​

    • ▶
      {} 2 keys
      • ▶
        [] 1 item
        • ▶
          [] 1 item

        Edge Deployment Remove​

        Schema for removing edge deployments. Can remove a specific workflow from a specific device, can remove all workflows from a specific device, or can remove a specific workflow from all devices.

        Edge Deployment Remove Schema​

        • ▶
          {} 5 keys
          • "http://json-schema.org/draft-07/schema#"
          • "object"
          • ▶
            {} 2 keys
            • ▶
              {} 2 keys
              • ▶
                {} 2 keys
              • false
              • ▶
                [] 2 items

              Edge Deployment Remove Example​

              • ▶
                {} 2 keys
                • "575ed18f7ae143cd83dc4aa6"
                • null

              Edge Deployment Replace​

              Schema for replacing a deployment of a workflow version with a different workflow version

              Edge Deployment Replace Schema​

              • ▶
                {} 5 keys
                • "http://json-schema.org/draft-07/schema#"
                • "object"
                • ▶
                  {} 3 keys
                  • ▶
                    {} 2 keys
                    • ▶
                      {} 3 keys
                      • ▶
                        {} 3 keys
                      • false
                      • ▶
                        [] 3 items

                      Edge Deployment Replace Example​

                      • ▶
                        {} 3 keys
                        • "575ed18f7ae143cd83dc4aa6"
                        • "v1.2.3"
                        • "v1.2.4"

                      Edge Deployments​

                      Schema for a collection of Edge Deployments

                      Edge Deployments Schema​

                      • ▶
                        {} 3 keys
                        • "http://json-schema.org/draft-07/schema#"
                        • "object"
                        • ▶
                          {} 14 keys
                          • ▶
                            {} 2 keys
                            • ▶
                              {} 1 key
                              • ▶
                                {} 1 key
                                • ▶
                                  {} 1 key
                                  • ▶
                                    {} 1 key
                                    • ▶
                                      {} 1 key
                                      • ▶
                                        {} 1 key
                                        • ▶
                                          {} 1 key
                                          • ▶
                                            {} 2 keys
                                            • ▶
                                              {} 2 keys
                                              • ▶
                                                {} 2 keys
                                                • ▶
                                                  {} 2 keys
                                                  • ▶
                                                    {} 3 keys
                                                    • ▶
                                                      {} 1 key

                                                  Edge Deployments Example​

                                                  • ▶
                                                    {} 8 keys
                                                    • ▶
                                                      [] 1 item
                                                      • 1
                                                      • 4
                                                      • 1
                                                      • 0
                                                      • "id"
                                                      • "asc"
                                                      • "575ec8687ae143cd83dc4a97"

                                                    Error​

                                                    Schema for errors returned by the API

                                                    Error Schema​

                                                    • ▶
                                                      {} 3 keys
                                                      • "http://json-schema.org/draft-07/schema#"
                                                      • "object"
                                                      • ▶
                                                        {} 3 keys
                                                        • ▶
                                                          {} 1 key
                                                          • ▶
                                                            {} 1 key
                                                            • ▶
                                                              {} 2 keys

                                                          Error Example​

                                                          • ▶
                                                            {} 2 keys
                                                            • "NotFound"
                                                            • "Application was not found"

                                                          Success​

                                                          Schema for reporting a successful operation

                                                          Success Schema​

                                                          • ▶
                                                            {} 3 keys
                                                            • "http://json-schema.org/draft-07/schema#"
                                                            • "object"
                                                            • ▶
                                                              {} 1 key
                                                              • ▶
                                                                {} 2 keys

                                                            Success Example​

                                                            • ▶
                                                              {} 1 key
                                                              • true

                                                            Was this page helpful?


                                                            Still looking for help? You can also search the Losant Forums or submit your question there.