Просмотр исходного кода

docs: update annotaions http api

Marcus Efraimsson 7 лет назад
Родитель
Сommit
6848fe0edf
1 измененных файлов с 38 добавлено и 12 удалено
  1. 38 12
      docs/sources/http_api/annotations.md

+ 38 - 12
docs/sources/http_api/annotations.md

@@ -97,7 +97,7 @@ Creates an annotation in the Grafana database. The `dashboardId` and `panelId` f
 
 
 **Example Request**:
 **Example Request**:
 
 
-```json
+```http
 POST /api/annotations HTTP/1.1
 POST /api/annotations HTTP/1.1
 Accept: application/json
 Accept: application/json
 Content-Type: application/json
 Content-Type: application/json
@@ -115,7 +115,7 @@ Content-Type: application/json
 
 
 **Example Response**:
 **Example Response**:
 
 
-```json
+```http
 HTTP/1.1 200
 HTTP/1.1 200
 Content-Type: application/json
 Content-Type: application/json
 
 
@@ -135,7 +135,7 @@ format (string with multiple tags being separated by a space).
 
 
 **Example Request**:
 **Example Request**:
 
 
-```json
+```http
 POST /api/annotations/graphite HTTP/1.1
 POST /api/annotations/graphite HTTP/1.1
 Accept: application/json
 Accept: application/json
 Content-Type: application/json
 Content-Type: application/json
@@ -150,7 +150,7 @@ Content-Type: application/json
 
 
 **Example Response**:
 **Example Response**:
 
 
-```json
+```http
 HTTP/1.1 200
 HTTP/1.1 200
 Content-Type: application/json
 Content-Type: application/json
 
 
@@ -160,15 +160,15 @@ Content-Type: application/json
 }
 }
 ```
 ```
 
 
-## Replace Annotation
+## Update Annotation
 
 
 `PUT /api/annotations/:id`
 `PUT /api/annotations/:id`
 
 
-Replaces the annotation that matches the specified id.
+Updates all properties of an annotation that matches the specified id. To only update certain property, consider using the [Patch Annotation](#patch-annotation) operation.
 
 
 **Example Request**:
 **Example Request**:
 
 
-```json
+```http
 PUT /api/annotations/1141 HTTP/1.1
 PUT /api/annotations/1141 HTTP/1.1
 Accept: application/json
 Accept: application/json
 Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
 Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
@@ -183,17 +183,28 @@ Content-Type: application/json
 }
 }
 ```
 ```
 
 
-## Update Annotation
+**Example Response**:
+
+```http
+HTTP/1.1 200
+Content-Type: application/json
+
+{
+    "message":"Annotation updated"
+}
+```
+
+## Patch Annotation
 
 
 `PATCH /api/annotations/:id`
 `PATCH /api/annotations/:id`
 
 
 Updates one or more properties of an annotation that matches the specified id.
 Updates one or more properties of an annotation that matches the specified id.
 
 
-The `PATCH` operation currently supports updating of the `text`, `tags`, `time` and `timeEnd` properties. It does not handle updating of the `isRegion` and `regionId` properties. To make an annotation regional or vice versa, consider using the `PUT` operation.
+This operation currently supports updating of the `text`, `tags`, `time` and `timeEnd` properties. It does not handle updating of the `isRegion` and `regionId` properties. To make an annotation regional or vice versa, consider using the [Update Annotation](#update-annotation) operation.
 
 
 **Example Request**:
 **Example Request**:
 
 
-```json
+```http
 PATCH /api/annotations/1145 HTTP/1.1
 PATCH /api/annotations/1145 HTTP/1.1
 Accept: application/json
 Accept: application/json
 Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
 Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
@@ -205,6 +216,17 @@ Content-Type: application/json
 }
 }
 ```
 ```
 
 
+**Example Response**:
+
+```http
+HTTP/1.1 200
+Content-Type: application/json
+
+{
+    "message":"Annotation patched"
+}
+```
+
 ## Delete Annotation By Id
 ## Delete Annotation By Id
 
 
 `DELETE /api/annotations/:id`
 `DELETE /api/annotations/:id`
@@ -226,7 +248,9 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
 HTTP/1.1 200
 HTTP/1.1 200
 Content-Type: application/json
 Content-Type: application/json
 
 
-{"message":"Annotation deleted"}
+{
+    "message":"Annotation deleted"
+}
 ```
 ```
 
 
 ## Delete Annotation By RegionId
 ## Delete Annotation By RegionId
@@ -250,5 +274,7 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
 HTTP/1.1 200
 HTTP/1.1 200
 Content-Type: application/json
 Content-Type: application/json
 
 
-{"message":"Annotation region deleted"}
+{
+    "message":"Annotation region deleted"
+}
 ```
 ```