-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathenv.default.req.notecard.api.json
More file actions
97 lines (97 loc) · 3.47 KB
/
Copy pathenv.default.req.notecard.api.json
File metadata and controls
97 lines (97 loc) · 3.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/blues/notecard-schema/master/env.default.req.notecard.api.json",
"title": "env.default Request Application Programming Interface (API) Schema",
"description": "Used by the Notecard host to specify a default value for an environment variable until that variable is overridden by a device, project or fleet-wide setting at Notehub.",
"type": "object",
"version": "1.1.2",
"apiVersion": "9.1.1",
"skus": [
"CELL",
"CELL+WIFI",
"LORA",
"SKYLO",
"WIFI"
],
"properties": {
"name": {
"description": "The name of the environment variable (case-insensitive).",
"type": "string"
},
"sync": {
"description": "Set to `true` to trigger an immediate sync.",
"type": "boolean"
},
"text": {
"description": "The value of the variable. Pass `\"\"` or omit from the request to delete it.",
"type": "string"
},
"req": {
"description": "Request for the Notecard (expects response)",
"const": "env.default"
},
"cmd": {
"description": "Command for the Notecard (no response)",
"const": "env.default"
}
},
"oneOf": [
{
"required": [
"req"
],
"properties": {
"req": {
"const": "env.default"
}
}
},
{
"required": [
"cmd"
],
"properties": {
"cmd": {
"const": "env.default"
}
}
}
],
"required": [
"name"
],
"unevaluatedProperties": false,
"annotations": [
{
"title": "note",
"description": "Environment variables set with `env.default` on **Notecard LoRa** do not propagate up to Notehub. If looking for a simple way to share a variable from a Notecard to Notehub, please refer to [var.set](/api-reference/notecard-api/var-requests/latest#var-set)."
}
],
"samples": [
{
"title": "Set Default Environment Variable",
"description": "Set a default value for an environment variable.",
"json": "{\"req\": \"env.default\", \"name\": \"monitor-pump\", \"text\": \"on\"}"
},
{
"title": "Clear Default Environment Variable",
"description": "Clear the default value for an environment variable by omitting text.",
"json": "{\"req\": \"env.default\", \"name\": \"monitor-pump\"}"
},
{
"title": "Set Empty String Default",
"description": "Set an environment variable default to an empty string.",
"json": "{\"req\": \"env.default\", \"name\": \"debug-mode\", \"text\": \"\"}"
},
{
"title": "Set Numeric Default",
"description": "Set a default value for a numeric environment variable.",
"json": "{\"req\": \"env.default\", \"name\": \"sample-rate\", \"text\": \"60\"}"
},
{
"title": "Set Default and Sync",
"description": "Set a default environment variable and trigger an immediate sync.",
"json": "{\"req\": \"env.default\", \"name\": \"monitor-pump\", \"text\": \"on\", \"sync\": true}"
}
]
}