Create a new Deployment Group for a Product
curl --request POST \
--url https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/deployments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"conditions": {
"tags": [
"prod"
],
"version": ">= 1.0.0"
},
"firmware": "d9f8c63a-1234-5678-abcd-ef0123456789",
"name": "production",
"notes": "Rolled out for the summer campaign hardware batch",
"state": "on"
}
'import requests
url = "https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/deployments"
payload = {
"conditions": {
"tags": ["prod"],
"version": ">= 1.0.0"
},
"firmware": "d9f8c63a-1234-5678-abcd-ef0123456789",
"name": "production",
"notes": "Rolled out for the summer campaign hardware batch",
"state": "on"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
conditions: {tags: ['prod'], version: '>= 1.0.0'},
firmware: 'd9f8c63a-1234-5678-abcd-ef0123456789',
name: 'production',
notes: 'Rolled out for the summer campaign hardware batch',
state: 'on'
})
};
fetch('https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/deployments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/deployments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'conditions' => [
'tags' => [
'prod'
],
'version' => '>= 1.0.0'
],
'firmware' => 'd9f8c63a-1234-5678-abcd-ef0123456789',
'name' => 'production',
'notes' => 'Rolled out for the summer campaign hardware batch',
'state' => 'on'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/deployments"
payload := strings.NewReader("{\n \"conditions\": {\n \"tags\": [\n \"prod\"\n ],\n \"version\": \">= 1.0.0\"\n },\n \"firmware\": \"d9f8c63a-1234-5678-abcd-ef0123456789\",\n \"name\": \"production\",\n \"notes\": \"Rolled out for the summer campaign hardware batch\",\n \"state\": \"on\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/deployments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"conditions\": {\n \"tags\": [\n \"prod\"\n ],\n \"version\": \">= 1.0.0\"\n },\n \"firmware\": \"d9f8c63a-1234-5678-abcd-ef0123456789\",\n \"name\": \"production\",\n \"notes\": \"Rolled out for the summer campaign hardware batch\",\n \"state\": \"on\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/deployments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"conditions\": {\n \"tags\": [\n \"prod\"\n ],\n \"version\": \">= 1.0.0\"\n },\n \"firmware\": \"d9f8c63a-1234-5678-abcd-ef0123456789\",\n \"name\": \"production\",\n \"notes\": \"Rolled out for the summer campaign hardware batch\",\n \"state\": \"on\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"conditions": {
"tags": [
"beta"
],
"version": ">= 1.0.0"
},
"current_release": {
"firmware": {
"architecture": "arm",
"platform": "rpi0",
"uuid": "d9f8c63a-1234-5678-abcd-ef0123456789",
"version": "1.0.0"
},
"inserted_at": "2024-01-01T00:00:00Z",
"number": 3,
"updated_at": "2024-01-01T00:00:00Z"
},
"delta_updatable": false,
"device_count": 42,
"firmware_uuid": "d9f8c63a-1234-5678-abcd-ef0123456789",
"is_active": true,
"name": "production",
"notes": "Rolled out for the summer campaign hardware batch",
"releases_count": 3,
"state": "on"
}
}{
"errors": {
"detail": "Resource Not Found or Authorization Insufficient"
}
}{
"errors": {
"detail": "Resource Not Found or Authorization Insufficient"
}
}{
"errors": {
"identifier": [
"can't be blank"
]
}
}Deployment Groups
Create a new Deployment Group for a Product
POST
/
api
/
orgs
/
{org_name}
/
products
/
{product_name}
/
deployments
Create a new Deployment Group for a Product
curl --request POST \
--url https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/deployments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"conditions": {
"tags": [
"prod"
],
"version": ">= 1.0.0"
},
"firmware": "d9f8c63a-1234-5678-abcd-ef0123456789",
"name": "production",
"notes": "Rolled out for the summer campaign hardware batch",
"state": "on"
}
'import requests
url = "https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/deployments"
payload = {
"conditions": {
"tags": ["prod"],
"version": ">= 1.0.0"
},
"firmware": "d9f8c63a-1234-5678-abcd-ef0123456789",
"name": "production",
"notes": "Rolled out for the summer campaign hardware batch",
"state": "on"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
conditions: {tags: ['prod'], version: '>= 1.0.0'},
firmware: 'd9f8c63a-1234-5678-abcd-ef0123456789',
name: 'production',
notes: 'Rolled out for the summer campaign hardware batch',
state: 'on'
})
};
fetch('https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/deployments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/deployments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'conditions' => [
'tags' => [
'prod'
],
'version' => '>= 1.0.0'
],
'firmware' => 'd9f8c63a-1234-5678-abcd-ef0123456789',
'name' => 'production',
'notes' => 'Rolled out for the summer campaign hardware batch',
'state' => 'on'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/deployments"
payload := strings.NewReader("{\n \"conditions\": {\n \"tags\": [\n \"prod\"\n ],\n \"version\": \">= 1.0.0\"\n },\n \"firmware\": \"d9f8c63a-1234-5678-abcd-ef0123456789\",\n \"name\": \"production\",\n \"notes\": \"Rolled out for the summer campaign hardware batch\",\n \"state\": \"on\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/deployments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"conditions\": {\n \"tags\": [\n \"prod\"\n ],\n \"version\": \">= 1.0.0\"\n },\n \"firmware\": \"d9f8c63a-1234-5678-abcd-ef0123456789\",\n \"name\": \"production\",\n \"notes\": \"Rolled out for the summer campaign hardware batch\",\n \"state\": \"on\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/deployments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"conditions\": {\n \"tags\": [\n \"prod\"\n ],\n \"version\": \">= 1.0.0\"\n },\n \"firmware\": \"d9f8c63a-1234-5678-abcd-ef0123456789\",\n \"name\": \"production\",\n \"notes\": \"Rolled out for the summer campaign hardware batch\",\n \"state\": \"on\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"conditions": {
"tags": [
"beta"
],
"version": ">= 1.0.0"
},
"current_release": {
"firmware": {
"architecture": "arm",
"platform": "rpi0",
"uuid": "d9f8c63a-1234-5678-abcd-ef0123456789",
"version": "1.0.0"
},
"inserted_at": "2024-01-01T00:00:00Z",
"number": 3,
"updated_at": "2024-01-01T00:00:00Z"
},
"delta_updatable": false,
"device_count": 42,
"firmware_uuid": "d9f8c63a-1234-5678-abcd-ef0123456789",
"is_active": true,
"name": "production",
"notes": "Rolled out for the summer campaign hardware batch",
"releases_count": 3,
"state": "on"
}
}{
"errors": {
"detail": "Resource Not Found or Authorization Insufficient"
}
}{
"errors": {
"detail": "Resource Not Found or Authorization Insufficient"
}
}{
"errors": {
"identifier": [
"can't be blank"
]
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Deployment Group creation request body
POST body for creating a Deployment Group
Firmware UUID
Show child attributes
Show child attributes
Example:
{
"tag_operator": "and",
"tags": ["beta"],
"version": ">= 1.0.0"
}
Free-text notes describing why this deployment group is being created
Available options:
on, off Response
Deployment Group response
Response schema for a single Deployment Group
Show child attributes
Show child attributes
Example:
{
"conditions": { "tags": ["beta"], "version": ">= 1.0.0" },
"current_release": {
"firmware": {
"architecture": "arm",
"platform": "rpi0",
"uuid": "d9f8c63a-1234-5678-abcd-ef0123456789",
"version": "1.0.0"
},
"inserted_at": "2024-01-01T00:00:00Z",
"number": 3,
"updated_at": "2024-01-01T00:00:00Z"
},
"delta_updatable": false,
"device_count": 42,
"firmware_uuid": "d9f8c63a-1234-5678-abcd-ef0123456789",
"is_active": true,
"name": "production",
"notes": "Rolled out for the summer campaign hardware batch",
"releases_count": 3,
"state": "on"
}

