|
14 | 14 | description: Allows to create annotations in Grafana from playbooks. |
15 | 15 | short_description: Create annotations in Grafana through the dedicated API. |
16 | 16 | options: |
17 | | - addr: |
| 17 | + url: |
18 | 18 | required: true |
19 | 19 | description: |
20 | 20 | - address of the grafana REST API |
|
30 | 30 | required: false |
31 | 31 | description: |
32 | 32 | - Grafana API token |
33 | | - time: |
| 33 | + tstamp: |
34 | 34 | required: false |
35 | 35 | description: |
36 | 36 | - epoch datetime in seconds. |
37 | 37 | If not specified, the current localtime is used. |
38 | | - timeEnd: |
| 38 | + end_tstamp: |
39 | 39 | required: false |
40 | 40 | description: |
41 | 41 | - epoch datetime in seconds, automatically define the annotation as a region annotation. |
|
48 | 48 | required: true |
49 | 49 | description: |
50 | 50 | - Text to be displayed in the annotation |
51 | | - secure: |
52 | | - required: false |
53 | | - default: false |
54 | | - description: |
55 | | - - If true, an https connection will be established with the Grafana server. |
56 | 51 | ''' |
57 | 52 |
|
58 | 53 | EXAMPLES = ''' |
59 | 54 | - name: Create a global annotation |
60 | 55 | grafana_annotations: |
61 | | - addr: "10.4.3.173:8080" |
| 56 | + url: "10.4.3.173:8080/api/annotations" |
62 | 57 | user: "grafana_login" |
63 | 58 | passwd: "grafana_password" |
64 | 59 | text: "Started update of production environment" |
65 | 60 |
|
66 | 61 | - name: Create a global annotation |
67 | 62 | grafana_annotations: |
68 | | - addr: "10.4.3.173:8080" |
| 63 | + url: "10.4.3.173:8080/api/annotations" |
69 | 64 | user: "grafana_login" |
70 | 65 | passwd: "grafana_password" |
71 | | - time: 1513000095 |
| 66 | + tstamp: 1513000095 |
72 | 67 | text: "Planned intervention on production server" |
73 | 68 |
|
74 | 69 | - name: Create a global region annotation |
75 | 70 | grafana_annotations: |
76 | | - addr: "10.4.3.173:8080" |
| 71 | + url: "10.4.3.173:8080/api/annotations" |
77 | 72 | user: "grafana_login" |
78 | 73 | passwd: "grafana_password" |
79 | | - time: 1513000095 |
80 | | - timeEnd: 1513005095 |
| 74 | + tstamp: 1513000095 |
| 75 | + end_tstamp: 1513005095 |
81 | 76 | text: "Execution of the xxxx playbook" |
82 | 77 |
|
83 | 78 | ''' |
84 | 79 |
|
85 | 80 |
|
86 | | - |
87 | | - |
88 | 81 | def default_filter(annos, annotation): |
89 | 82 | """default filter comparing 'time', 'text' and 'tags' parameters""" |
90 | 83 | result = [] |
|
0 commit comments