-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathannotations_client.txt
49 lines (38 loc) · 1.24 KB
/
annotations_client.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# ANNOTATION CLIENT
New annotations client is available from 1.22 effectively deprecating
annotations in old client.
This client provides functionality to annotate charms in addition
to model, machine, service and unit previously done
through our old client.
New annotations client also supports bulk calls.
## API
Note that where SET call returns an error, Error in GET call return is params.ErrorResult.
### SET
For the SET annotations call that looks similar to this:
......{
"Type": "Annotations",
"Request": "Set",
"Params": {
"Annotations": {{
"EntityTag": a, "Annotations": pairs1
},{
"EntityTag": b, "Annotations": pairs2
}}
}}......
### GET
Corresponding GET annotations call may look like:
......{
"Type": "Annotations",
"Request": "Get",
"Params": {
"Entities": {
{Entity {"Tag": a}},
{Entity {"Tag": b},
}
}}......
Returning
{
"Results": {
{"EntityTag": a, "Annotations": pairs1, "Error": nil},
{"EntityTag": b, "Annotations": pairs2, "Error": nil},
}}