Skip to content

Commit

Permalink
Update Create User and List Tags (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
satterly authored Dec 1, 2017
1 parent 0b44d13 commit 550c140
Show file tree
Hide file tree
Showing 9 changed files with 459 additions and 246 deletions.
Binary file modified _build/doctrees/api/reference.doctree
Binary file not shown.
Binary file modified _build/doctrees/environment.pickle
Binary file not shown.
Binary file modified _build/doctrees/gettingstarted/tutorial-1-deploy-alerta.doctree
Binary file not shown.
Binary file modified _build/doctrees/quick-start.doctree
Binary file not shown.
120 changes: 94 additions & 26 deletions _build/html/_sources/api/reference.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,85 @@ Example Response
"total": 1
}
.. _tags:

Tags
----

A tag cannot be created -- it is a dynamically derived resource based on existing alerts.

List all tags
~~~~~~~~~~~~~

Returns a list of tags grouped by environment and an alert count for each.

::

GET /tags

Parameters
++++++++++

+-----------------+----------+----------------------------------------------+
| Name | Type | Description |
+=================+==========+==============================================+
| ``<attr>`` | string | |
+-----------------+----------+----------------------------------------------+

Example Request
+++++++++++++++

.. code-block:: bash
$ curl http://localhost:8080/tags?environment=Production \
-H 'Authorization: Key demo-key'
Example Response
++++++++++++++++

::

200 OK

.. code-block:: json
{
"status": "ok",
"tags": [
{
"count": 2,
"environment": "Production",
"tag": "linux"
},
{
"count": 1,
"environment": "Production",
"tag": "dc2"
},
{
"count": 1,
"environment": "Production",
"tag": "hp"
},
{
"count": 2,
"environment": "Production",
"tag": "dell"
},
{
"count": 2,
"environment": "Production",
"tag": "dc1"
},
{
"count": 2,
"environment": "Production",
"tag": "linux2.6"
}
],
"total": 6
}
.. _blackouts:

Blackout Periods
Expand Down Expand Up @@ -1497,11 +1576,11 @@ Users
Create a user
~~~~~~~~~~~~~

Creates a new user.
Creates a new Basic Auth user.

::

POST /user
POST /auth/signup

Input
+++++
Expand All @@ -1511,54 +1590,39 @@ Input
+====================+==========+===========================================+
| ``name`` | string | |
+--------------------+----------+-------------------------------------------+
| ``login`` | string | |
| ``email`` | string | |
+--------------------+----------+-------------------------------------------+
| ``password`` | string | |
+--------------------+----------+-------------------------------------------+
| ``provider`` | string | |
+--------------------+----------+-------------------------------------------+
| ``text`` | string | |
+--------------------+----------+-------------------------------------------+
| ``email_verified`` | string | |
+--------------------+----------+-------------------------------------------+

Example Request
+++++++++++++++

.. code-block:: bash
$ curl -XPOST http://localhost:8080/user \
$ curl -XPOST http://localhost:8080/auth/signup \
-H 'Authorization: Key demo-key' \
-H 'Content-type: application/json' \
-d '{
"name": "Joe Bloggs",
"login": "[email protected]",
"email": "[email protected]",
"password": "secret",
"text": "demo user",
"email_verified": true
"text": "demo user"
}'
Example Response
++++++++++++++++

::

201 CREATED
200 OK

.. code-block:: json
{
"id": "166b41d6-849f-440d-ba30-1a5345d86fb6",
"status": "ok",
"user": {
"createTime": "2017-01-02T00:23:24.487Z",
"email_verified": true,
"id": "166b41d6-849f-440d-ba30-1a5345d86fb6",
"login": "[email protected]",
"name": "Joe Bloggs",
"provider": "basic",
"text": "demo user"
}
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI4Y2IwYjYyNC0zY2Q3LTQ1YjktOThhNS01ZGZhYzVmMDE2NmMiLCJyb2xlcyI6WyJ1c2VyIl0sImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6ODA4MC8iLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJqb2UuYmxvZ2dzQGV4YW1wbGUuY29tIiwibmFtZSI6IkpvZSBCbG9nZ3MiLCJlbWFpbCI6ImpvZS5ibG9nZ3NAZXhhbXBsZS5jb20iLCJzY29wZSI6InJlYWQgd3JpdGUiLCJqdGkiOiI2ODlhMmY3Yy0zNTJlLTQ5M2ItYWZjYi1iOWUwOTE3ODAyMDgiLCJleHAiOjE1MTMxODIxNDcsInByb3ZpZGVyIjoiYmFzaWMiLCJpYXQiOjE1MTE5NzI1NDcsIm5iZiI6MTUxMTk3MjU0NywiYXVkIjoiaHR0cDovL2xvY2FsaG9zdDo4MDgwLyJ9.c5jpr8YksoJmoZ6KUwsYP5fgwZr-jdA4W3JUCbv1vXU"
}
Update a user
Expand All @@ -1579,15 +1643,19 @@ Input
+====================+==========+===========================================+
| ``name`` | string | |
+--------------------+----------+-------------------------------------------+
| ``login`` | string | |
| ``email`` | string | |
+--------------------+----------+-------------------------------------------+
| ``password`` | string | |
+--------------------+----------+-------------------------------------------+
| ``provider`` | string | |
| ``status`` | string | |
+--------------------+----------+-------------------------------------------+
| ``roles`` | set | set of roles |
+--------------------+----------+-------------------------------------------+
| ``attributes`` | dict | dictionary of key-value pairs |
+--------------------+----------+-------------------------------------------+
| ``text`` | string | |
+--------------------+----------+-------------------------------------------+
| ``email_verified`` | string | |
| ``email_verified`` | boolean | |
+--------------------+----------+-------------------------------------------+

Example Request
Expand Down
Loading

0 comments on commit 550c140

Please sign in to comment.