Skip to content

Commit b2b560f

Browse files
authored
Merge pull request #174 from HarperDB/CORE-2725/initial-validation
Add status operations
2 parents e5bcd70 + cd96b9d commit b2b560f

File tree

1 file changed

+109
-0
lines changed

1 file changed

+109
-0
lines changed

docs/developers/operations-api/system-operations.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ _Operation is restricted to super_user roles only_
2020
"message": "Restarting HarperDB. This may take up to 60 seconds."
2121
}
2222
```
23+
2324
---
2425

2526
## Restart Service
@@ -47,6 +48,7 @@ _Operation is restricted to super_user roles only_
4748
```
4849

4950
---
51+
5052
## System Information
5153
Returns detailed metrics on the host system.
5254

@@ -61,3 +63,110 @@ _Operation is restricted to super_user roles only_
6163
"operation": "system_information"
6264
}
6365
```
66+
67+
---
68+
69+
## Set Status
70+
Sets a status value that can be used for application-specific status tracking. Status values are stored in memory and are not persisted across restarts.
71+
72+
_Operation is restricted to super_user roles only_
73+
74+
* operation _(required)_ - must always be `set_status`
75+
* id _(required)_ - the key identifier for the status
76+
* status _(required)_ - the status value to set (string between 1-512 characters)
77+
78+
### Body
79+
```json
80+
{
81+
"operation": "set_status",
82+
"id": "primary",
83+
"status": "active"
84+
}
85+
```
86+
87+
### Response: 200
88+
```json
89+
{
90+
"id": "primary",
91+
"status": "active",
92+
"__createdtime__": 1621364589543,
93+
"__updatedtime__": 1621364589543
94+
}
95+
```
96+
97+
### Notes
98+
- The `id` parameter must be one of the allowed status types: 'primary', 'maintenance', or 'availability'
99+
- If no `id` is specified, it defaults to 'primary'
100+
- For 'availability' status, only 'Available' or 'Unavailable' values are accepted
101+
- For other status types, any string value is accepted
102+
103+
---
104+
105+
## Get Status
106+
Retrieves a status value previously set with the set_status operation.
107+
108+
_Operation is restricted to super_user roles only_
109+
110+
* operation _(required)_ - must always be `get_status`
111+
* id _(optional)_ - the key identifier for the status to retrieve (defaults to all statuses if not provided)
112+
113+
### Body
114+
```json
115+
{
116+
"operation": "get_status",
117+
"id": "primary"
118+
}
119+
```
120+
121+
### Response: 200
122+
```json
123+
{
124+
"id": "primary",
125+
"status": "active",
126+
"__createdtime__": 1621364589543,
127+
"__updatedtime__": 1621364589543
128+
}
129+
```
130+
131+
If no id parameter is provided, all status values will be returned:
132+
```json
133+
[
134+
{
135+
"id": "primary",
136+
"status": "active",
137+
"__createdtime__": 1621364589543,
138+
"__updatedtime__": 1621364589543
139+
},
140+
{
141+
"id": "maintenance",
142+
"status": "scheduled",
143+
"__createdtime__": 1621364600123,
144+
"__updatedtime__": 1621364600123
145+
}
146+
]
147+
```
148+
149+
---
150+
151+
## Clear Status
152+
Removes a status entry by its ID.
153+
154+
_Operation is restricted to super_user roles only_
155+
156+
* operation _(required)_ - must always be `clear_status`
157+
* id _(required)_ - the key identifier for the status to remove
158+
159+
### Body
160+
```json
161+
{
162+
"operation": "clear_status",
163+
"id": "primary"
164+
}
165+
```
166+
167+
### Response: 200
168+
```json
169+
{
170+
"message": "Status successfully cleared"
171+
}
172+
```

0 commit comments

Comments
 (0)