-
Notifications
You must be signed in to change notification settings - Fork 124
/
Copy pathmarklogic-api-basic-auth-example.yml
174 lines (174 loc) · 6.59 KB
/
marklogic-api-basic-auth-example.yml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# MarkLogic Management API Documentation https://docs.marklogic.com/REST/management
# Tested with MarkLogic v10
# This example hits a number of MarkLogic API endpoints to gather relevant
# monitoring data
# NOTE: This example works with Basic Authentication setup on the MarkLogic
# API. Use the Digest Authentication example in this repo if you are using
# any other authentication
---
integrations:
- name: nri-flex
timeout: 60s
# interval: 30s ## deafult is 30s, can change if desired
# env:
# EVENT_LIMIT: 500 ## default is 500, increase if needed
config:
name: marklogic-metric
global:
# Alter these global settings based on your setup
base_url: http://localhost:8002/manage/LATEST
headers:
accept: application/json
authorization: Your Authorization Token
apis:
# API call documented here: https://docs.marklogic.com/REST/GET/manage/v2@view=status
- event_type: marklogicSummarySample
url: ?view=status&format=json
start_key:
- local-cluster-status
- status-relations
remove_keys:
- time
- units
- uriref
- typeref
# API call documented here: https://docs.marklogic.com/REST/GET/manage/v2/hosts@view=status
- event_type: marklogicHostSummarySample
url: /hosts?view=status&format=json
start_key:
- host-status-list
- status-list-summary
remove_keys:
- time
- units
# API call documented here: https://docs.marklogic.com/REST/GET/manage/v2/servers@view=status
- event_type: marklogicServerSummarySample
url: /servers?view=status&format=json
start_key:
- server-status-list
- status-list-summary
remove_keys:
- time
- units
# API call documented here: https://docs.marklogic.com/REST/GET/manage/v2/forests@view=status
- event_type: marklogicForestSummarySample
url: /forests?view=status&format=json
start_key:
- forest-status-list
- status-list-summary
remove_keys:
- time
- units
# API call to get list of databases to use in next API call
- event_type: mlDatabasesSample
url: /databases?format=json
start_key:
- database-default-list
- list-items
- list-item
ignore_output: true
# Loop through databases in above API call and get data for each
# API call documented here: https://docs.marklogic.com/REST/GET/manage/v2/databases/[id-or-name]@view=status
- event_type: marklogicDatabaseDetailSample
url: /databases/${lookup.marklogicDatabasesSample:nameref}?view=status&format=json
dedupe_lookups:
- nameref
start_key:
- database-status
- status-properties
remove_keys:
- meta
- relations
- time
- units
custom_attributes:
dbName: ${lookup.marklogicDatabasesSample:nameref}
# API call to get list of forests to use in next API call
- event_type: mlForestsSample
url: /forests?format=json
start_key:
- forest-default-list
- list-items
- list-item
ignore_output: true
# Loop through databases in above API call and get data for each
# API call documented here: https://docs.marklogic.com/REST/GET/manage/v2/forests/[id-or-name]@view=status
- event_type: marklogicForestDetailSample
url: /forests/${lookup.mlForestsSample:nameref}?view=status&format=json
dedupe_lookups:
- nameref
start_key:
- forest-status
- status-properties
remove_keys:
- time
- units
custom_attributes:
forestName: ${lookup.mlForestsSample:nameref}
# API call to get list of servers to use in next API call
- event_type: mlServersSample
url: /servers?format=json
start_key:
- server-default-list
- list-items
- list-item
remove_keys:
- relation-id
ignore_output: true
# Loop through servers in above API call and get data for each
# API call documented here: https://docs.marklogic.com/REST/GET/manage/v2/servers/[id-or-name]@view=status
- event_type: marklogicServerDetailSample
url: /servers/${lookup.mlServersSample:nameref}?group-id=${lookup.mlServersSample:groupnameref}&view=status&format=json
dedupe_lookups:
- nameref
start_key:
- server-status
- status-properties
remove_keys:
- units
custom_attributes:
serverName: ${lookup.mlServersSample:nameref}
# API call to get list of hosts to use in next API call
- event_type: mlHostsSample
url: /hosts?format=json
start_key:
- host-default-list
- list-items
- list-item
ignore_output: true
# Loop through hosts in above API call and get data for each
# API call documented here: https://docs.marklogic.com/REST/GET/manage/v2/hosts/[id-or-name]@view=status
- event_type: marklogicHostDetailSample
url: /hosts/${lookup.mlHostsSample:nameref}?view=status&format=json
dedupe_lookups:
- nameref
start_key:
- host-status
- status-properties
remove_keys:
- time
- units
custom_attributes:
mlHostName: ${lookup.mlHostsSample:nameref}
# API call to get list of groups to use in next API call
- event_type: mlGroupsSample
url: /groups?format=json
start_key:
- group-default-list
- list-items
- list-item
ignore_output: true
# Loop through groups in above API call and get data for each
# API call documented here: https://docs.marklogic.com/REST/GET/manage/v2/groups/[id-or-name]@view=status
- event_type: marklogicGroupDetailSample
url: /groups/${lookup.mlGroupsSample:nameref}?view=status&format=json
dedupe_lookups:
- nameref
start_key:
- group-status
- status-properties
remove_keys:
- time
- units
custom_attributes:
groupName: ${lookup.mlGroupsSample:nameref}