Skip to content

Commit 113c922

Browse files
satterlyclaude
andcommitted
Complete API reference: add groups, scopes, notes, management endpoints
- Add 15 missing endpoints: alert notes CRUD, groups CRUD (8 endpoints), scopes list, housekeeping, switchboard, config - Fix heartbeat.rst: add latency, maxLatency, since, status, href attrs - Fix alert.rst: add default value for group attribute - Fix query-syntax.rst: remove outdated note about unsupported operators (+, -, date ranges) which are now implemented Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent dc9c225 commit 113c922

4 files changed

Lines changed: 346 additions & 3 deletions

File tree

source/api/alert.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ The following alert attributes are populated at source:
3434
| ``service`` | list of effected services |
3535
+-----------------+---------------------------------------------------------+
3636
| ``group`` | event group used to group events of similar type |
37+
| | (default ``Misc``) |
3738
+-----------------+---------------------------------------------------------+
3839
| ``value`` | event value eg. ``100%``, ``Down``, ``PingFail``, |
3940
| | ``55ms``, ``ORA-1664`` |

source/api/heartbeat.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,19 @@ Attributes added when processing heartbeats
4343
| ``customer`` | assigned based on the owner of the API key used when submitting the heartbeat, |
4444
| | if "Customer Views" are enabled |
4545
+----------------------+---------------------------------------------------------------------------------+
46+
| ``latency`` | round-trip latency in milliseconds (computed from ``createTime`` and |
47+
| | ``receiveTime``) |
48+
+----------------------+---------------------------------------------------------------------------------+
49+
| ``maxLatency`` | maximum acceptable latency threshold from ``HEARTBEAT_MAX_LATENCY`` config |
50+
| | (default 2000ms) |
51+
+----------------------+---------------------------------------------------------------------------------+
52+
| ``since`` | seconds since last heartbeat was received |
53+
+----------------------+---------------------------------------------------------------------------------+
54+
| ``status`` | computed status: ``ok`` if within timeout and latency threshold, ``slow`` if |
55+
| | latency exceeds ``maxLatency``, ``expired`` if timeout exceeded |
56+
+----------------------+---------------------------------------------------------------------------------+
57+
| ``href`` | URL reference to the heartbeat resource |
58+
+----------------------+---------------------------------------------------------------------------------+
4659

4760
Example
4861
-------

source/api/query-syntax.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,5 @@ Parentheses can be used to group multiple clauses to a single field::
243243
status:(open OR ack)
244244
text:(full text search)
245245

246-
.. note:: The following are not currently supported: boolean operators (+,-), range
247-
queries by date, and range queries based on severity levels.
248-
249246
.. note:: The following will not be supported: fuzziness, proximity searches, and
250247
boosting which are features specific to Lucene and/or Elasticsearch.

source/api/reference.rst

Lines changed: 332 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,68 @@ Example Request
453453
-H 'Content-type: application/json' \
454454
-d '{ "note": "This is the sample note" }'
455455
456+
List alert notes
457+
~~~~~~~~~~~~~~~~~
458+
459+
Lists all notes for an alert.
460+
461+
::
462+
463+
GET /alert/:id/notes
464+
465+
Example Request
466+
+++++++++++++++
467+
468+
.. code-block:: bash
469+
470+
$ curl http://localhost:8080/alert/17d8e7ea-b3ba-4bb1-9c5a-29e60865f258/notes \
471+
-H 'Authorization: Key demo-key'
472+
473+
Update an alert note
474+
~~~~~~~~~~~~~~~~~~~~
475+
476+
Updates an existing note on an alert.
477+
478+
::
479+
480+
PUT /alert/:id/note/:note_id
481+
482+
Input
483+
+++++
484+
485+
+-----------------+----------+----------------------------------------------+
486+
| Name | Type | Description |
487+
+=================+==========+==============================================+
488+
| ``note`` | string | **Required** updated note text |
489+
+-----------------+----------+----------------------------------------------+
490+
491+
Example Request
492+
+++++++++++++++
493+
494+
.. code-block:: bash
495+
496+
$ curl -XPUT http://localhost:8080/alert/17d8e7ea-b3ba-4bb1-9c5a-29e60865f258/note/ab01c02d-1234-5678-abcd-ef0123456789 \
497+
-H 'Authorization: Key demo-key' \
498+
-H 'Content-type: application/json' \
499+
-d '{ "note": "Updated note text" }'
500+
501+
Delete an alert note
502+
~~~~~~~~~~~~~~~~~~~~
503+
504+
Permanently deletes a note from an alert.
505+
506+
::
507+
508+
DELETE /alert/:id/note/:note_id
509+
510+
Example Request
511+
+++++++++++++++
512+
513+
.. code-block:: bash
514+
515+
$ curl -XDELETE http://localhost:8080/alert/17d8e7ea-b3ba-4bb1-9c5a-29e60865f258/note/ab01c02d-1234-5678-abcd-ef0123456789 \
516+
-H 'Authorization: Key demo-key'
517+
456518
Delete an alert
457519
~~~~~~~~~~~~~~~
458520

@@ -2120,6 +2182,196 @@ Example Request
21202182
$ curl -XDELETE http://localhost:8080/user/166b41d6-849f-440d-ba30-1a5345d86fb6 \
21212183
-H 'Authorization: Key demo-key'
21222184
2185+
.. _groups:
2186+
2187+
Groups
2188+
------
2189+
2190+
.. _create_group:
2191+
2192+
Create a group
2193+
~~~~~~~~~~~~~~
2194+
2195+
Creates a new group.
2196+
2197+
::
2198+
2199+
POST /group
2200+
2201+
Input
2202+
+++++
2203+
2204+
+-----------------+----------+----------------------------------------------+
2205+
| Name | Type | Description |
2206+
+=================+==========+==============================================+
2207+
| ``name`` | string | **Required** group name |
2208+
+-----------------+----------+----------------------------------------------+
2209+
| ``text`` | string | description of the group |
2210+
+-----------------+----------+----------------------------------------------+
2211+
2212+
Example Request
2213+
+++++++++++++++
2214+
2215+
.. code-block:: bash
2216+
2217+
$ curl -XPOST http://localhost:8080/group \
2218+
-H 'Authorization: Key demo-key' \
2219+
-H 'Content-type: application/json' \
2220+
-d '{
2221+
"name": "alerta_ops",
2222+
"text": "Operations team"
2223+
}'
2224+
2225+
.. _get_group:
2226+
2227+
Get a group
2228+
~~~~~~~~~~~
2229+
2230+
Retrieves a group with the given group ID.
2231+
2232+
::
2233+
2234+
GET /group/:id
2235+
2236+
Example Request
2237+
+++++++++++++++
2238+
2239+
.. code-block:: bash
2240+
2241+
$ curl http://localhost:8080/group/5c0c5c8e-1b2a-3c4d-5e6f-7a8b9c0d1e2f \
2242+
-H 'Authorization: Key demo-key'
2243+
2244+
.. _get_groups:
2245+
2246+
List all groups
2247+
~~~~~~~~~~~~~~~
2248+
2249+
Returns a list of groups.
2250+
2251+
::
2252+
2253+
GET /groups
2254+
2255+
Example Request
2256+
+++++++++++++++
2257+
2258+
.. code-block:: bash
2259+
2260+
$ curl http://localhost:8080/groups \
2261+
-H 'Authorization: Key demo-key'
2262+
2263+
.. _put_group:
2264+
2265+
Update a group
2266+
~~~~~~~~~~~~~~
2267+
2268+
Updates the specified group by setting the values of the parameters
2269+
passed. Any parameters not provided will be left unchanged.
2270+
2271+
::
2272+
2273+
PUT /group/:id
2274+
2275+
Input
2276+
+++++
2277+
2278+
+-----------------+----------+----------------------------------------------+
2279+
| Name | Type | Description |
2280+
+=================+==========+==============================================+
2281+
| ``name`` | string | group name |
2282+
+-----------------+----------+----------------------------------------------+
2283+
| ``text`` | string | description of the group |
2284+
+-----------------+----------+----------------------------------------------+
2285+
2286+
Example Request
2287+
+++++++++++++++
2288+
2289+
.. code-block:: bash
2290+
2291+
$ curl -XPUT http://localhost:8080/group/5c0c5c8e-1b2a-3c4d-5e6f-7a8b9c0d1e2f \
2292+
-H 'Authorization: Key demo-key' \
2293+
-H 'Content-type: application/json' \
2294+
-d '{
2295+
"name": "alerta_ops",
2296+
"text": "Updated description"
2297+
}'
2298+
2299+
.. _delete_group:
2300+
2301+
Delete a group
2302+
~~~~~~~~~~~~~~
2303+
2304+
Permanently deletes a group.
2305+
2306+
::
2307+
2308+
DELETE /group/:id
2309+
2310+
Example Request
2311+
+++++++++++++++
2312+
2313+
.. code-block:: bash
2314+
2315+
$ curl -XDELETE http://localhost:8080/group/5c0c5c8e-1b2a-3c4d-5e6f-7a8b9c0d1e2f \
2316+
-H 'Authorization: Key demo-key'
2317+
2318+
.. _get_group_users:
2319+
2320+
List group members
2321+
~~~~~~~~~~~~~~~~~~
2322+
2323+
Returns a list of users that are members of the specified group.
2324+
2325+
::
2326+
2327+
GET /group/:id/users
2328+
2329+
Example Request
2330+
+++++++++++++++
2331+
2332+
.. code-block:: bash
2333+
2334+
$ curl http://localhost:8080/group/5c0c5c8e-1b2a-3c4d-5e6f-7a8b9c0d1e2f/users \
2335+
-H 'Authorization: Key demo-key'
2336+
2337+
.. _add_group_user:
2338+
2339+
Add user to group
2340+
~~~~~~~~~~~~~~~~~
2341+
2342+
Adds a user to the specified group.
2343+
2344+
::
2345+
2346+
PUT /group/:id/user/:user_id
2347+
2348+
Example Request
2349+
+++++++++++++++
2350+
2351+
.. code-block:: bash
2352+
2353+
$ curl -XPUT http://localhost:8080/group/5c0c5c8e-1b2a-3c4d-5e6f-7a8b9c0d1e2f/user/166b41d6-849f-440d-ba30-1a5345d86fb6 \
2354+
-H 'Authorization: Key demo-key'
2355+
2356+
.. _remove_group_user:
2357+
2358+
Remove user from group
2359+
~~~~~~~~~~~~~~~~~~~~~~
2360+
2361+
Removes a user from the specified group.
2362+
2363+
::
2364+
2365+
DELETE /group/:id/user/:user_id
2366+
2367+
Example Request
2368+
+++++++++++++++
2369+
2370+
.. code-block:: bash
2371+
2372+
$ curl -XDELETE http://localhost:8080/group/5c0c5c8e-1b2a-3c4d-5e6f-7a8b9c0d1e2f/user/166b41d6-849f-440d-ba30-1a5345d86fb6 \
2373+
-H 'Authorization: Key demo-key'
2374+
21232375
.. _perms:
21242376

21252377
Permissions
@@ -2307,6 +2559,30 @@ Example Request
23072559
"match": "alerta_rw"
23082560
}'
23092561
2562+
.. _scopes:
2563+
2564+
Scopes
2565+
------
2566+
2567+
.. _get_scopes:
2568+
2569+
List all scopes
2570+
~~~~~~~~~~~~~~~
2571+
2572+
Returns a list of all available permission scopes.
2573+
2574+
::
2575+
2576+
GET /scopes
2577+
2578+
Example Request
2579+
+++++++++++++++
2580+
2581+
.. code-block:: bash
2582+
2583+
$ curl http://localhost:8080/scopes \
2584+
-H 'Authorization: Key demo-key'
2585+
23102586
.. _customers:
23112587

23122588
Customers
@@ -2904,3 +3180,59 @@ Example Response
29043180
# HELP alerta_uptime_msecs milliseconds since app has started
29053181
# TYPE alerta_uptime_msecs counter
29063182
alerta_uptime_msecs 1422377
3183+
3184+
.. _mgmt_housekeeping:
3185+
3186+
Housekeeping
3187+
~~~~~~~~~~~~
3188+
3189+
Triggers housekeeping to expire timed-out alerts and delete old closed/expired alerts.
3190+
3191+
::
3192+
3193+
GET /management/housekeeping
3194+
3195+
Example Request
3196+
+++++++++++++++
3197+
3198+
.. code-block:: bash
3199+
3200+
$ curl http://localhost:8080/management/housekeeping \
3201+
-H 'Authorization: Key demo-key'
3202+
3203+
.. _mgmt_switchboard:
3204+
3205+
Switchboard
3206+
~~~~~~~~~~~
3207+
3208+
Get or set feature switches used to toggle runtime features.
3209+
3210+
::
3211+
3212+
GET /management/switchboard
3213+
3214+
Example Request
3215+
+++++++++++++++
3216+
3217+
.. code-block:: bash
3218+
3219+
$ curl http://localhost:8080/management/switchboard \
3220+
-H 'Authorization: Key demo-key'
3221+
3222+
.. _client_config:
3223+
3224+
Client Configuration
3225+
~~~~~~~~~~~~~~~~~~~~
3226+
3227+
Get client configuration settings used by the web UI.
3228+
3229+
::
3230+
3231+
GET /config
3232+
3233+
Example Request
3234+
+++++++++++++++
3235+
3236+
.. code-block:: bash
3237+
3238+
$ curl http://localhost:8080/config

0 commit comments

Comments
 (0)