Fixes for annotations API (#9577)

* annotations: throw error if no text specified and set default time to Now() if empty, #9571

* annotations: fix saving graphite event with empty string tags

* docs: add /api/annotations/graphite endpoint docs, #9571
This commit is contained in:
Alexander Zobnin
2017-10-18 11:13:02 +03:00
committed by Torkel Ödegaard
parent 5910453e8a
commit 74e90d01ec
2 changed files with 66 additions and 14 deletions

View File

@ -120,6 +120,37 @@ Content-Type: application/json
PUT /api/annotations/1141 HTTP/1.1
Accept: application/json
Content-Type: application/json
{
"time":1507037197339,
"isRegion":true,
"timeEnd":1507180805056,
"text":"Annotation Description",
"tags":["tag3","tag4","tag5"]
}
```
## Delete Annotation By Id
`DELETE /api/annotation/:id`
Deletes the annotation that matches the specified id.
**Example Request**:
```http
DELETE /api/annotation/1 HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
**Example Response**:
```http
HTTP/1.1 200
Content-Type: application/json
```
## Delete Annotation By RegionId