forked from elastest/elastest-instrumentation-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.yaml
executable file
·279 lines (279 loc) · 8.51 KB
/
api.yaml
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
swagger: '2.0'
info:
version: 1.0.0
title: ElasTest Instrumentation Manager
description: RESTful API specification for the ElasTest Instrumentation Manager (EIM)
termsOfService: TBD
contact:
name: David Rojo (ATOS)
email: [email protected]
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
host: elastest.io
basePath: /api
schemes:
- http
- https
consumes:
- application/json
produces:
- application/json
paths:
/publickey:
get:
tags:
- Publickey
summary: Retrieve public key
description: A client retrieves the public key
operationId: getPublickey
consumes:
- application/json
produces:
- application/json
responses:
'200':
description: Successful operation
schema:
$ref: '#/definitions/Publickey'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
'/agent/{agentId}':
get:
tags:
- Agent
summary: Retrieve a agent
description: Returns the agent with the given ID. Returns all its details.
operationId: getAgentByID
consumes:
- application/json
produces:
- application/json
parameters:
- name: agentId
in: path
description: ID of agent
required: true
type: string
responses:
'200':
description: Successful operation
schema:
$ref: '#/definitions/AgentFull'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Network not found
schema:
$ref: '#/definitions/AgentFull'
delete:
tags:
- Agent
summary: Delete a agent
description: A client delete a agent
operationId: deleteAgentByID
consumes:
- application/json
produces:
- '*/*'
parameters:
- name: agentId
in: path
description: Id of agent to delete
required: true
type: string
responses:
'200':
description: Network deleted successfully
schema:
type: string
'204':
description: No Content
'400':
description: Bad Request
schema:
type: string
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Network not found
schema:
type: string
/agent:
get:
tags:
- Agent
summary: Returns all existing agents
description: Returns all agents with all details
operationId: getAllAgents
consumes:
- application/json
produces:
- application/json
responses:
'200':
description: Successful operation
schema:
$ref: '#/definitions/AgentFull'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
post:
tags:
- Agent
summary: Register an agent
description: A client registers an agent
operationId: postAgent
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: body
description: Definition of an agent that is going to be created
required: true
schema:
$ref: '#/definitions/Host'
responses:
'200':
description: Agent creation OK
schema:
$ref: '#/definitions/Agent'
'201':
description: Created
'400':
description: Bad Request
schema:
$ref: '#/definitions/Agent'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
'/agent/{agentId}/{actionId}':
post:
tags:
- Agent
summary: Submit an action ti an agent
description: A client submit an action to an agent
operationId: postAction
consumes:
- application/json
produces:
- application/json
parameters:
- name: agentId
in: path
description: Id of agent to that receives the action
required: true
type: string
- name: actionId
in: path
description: action to apply
required: true
type: string
responses:
'200':
description: Action applied OK
schema:
$ref: '#/definitions/AgentFull'
'204':
description: No Content
'400':
description: Bad Request
schema:
$ref: '#/definitions/AgentFull'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Agent not found
schema:
$ref: '#/definitions/AgentFull'
definitions:
Publickey:
type: object
required:
- publickey
properties:
publickey:
type: string
example: >-
ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAABAQCp9ujzo4XgfcFFHZqqHvf25PP/TSAP89pxSx9sqsNsY7EPOMTpQVpYRuooaJQk7pwr8SzHJkWA2KzNcfs1hneIsfWPqhDmeDliwm3cFIrPQ3juFaoD03eRzS36F+qKyN8og5PxSCPSBtDdvdn0gvTA9j1IXQJ4oeUIxr3s8dIJiYpKY3wQeJTVCRQNGHZWrnjgSZ0YCH0wiEpUAT4mfUWmpjSyVmH8q2l2REuJbgVy5rQ7sMqaf/BvbAiKgqLYDOrcGQNjGj6in1Fuwj9vPvhyvRaNrkfj2NuA5RFN+2wPbYyClxEurFJWsD/GEHNKnd/0X88ubhZ89sIEiUYL8KB
root@0b83a3aa4d3a
description: This entity defines the publickey of EIM.
Agent:
type: object
required:
- agentId
- host
properties:
agentId:
type: string
host:
type: string
description: This entity defines an agent.
Host:
type: object
required:
- address
- user
- private_key
- logstash_ip
- logstash_port
properties:
address:
type: string
example: 172.19.0.4
user:
type: string
example: root
private_key:
type: string
example: -----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAvLGBDZ5cFC3Pm7NQr9NfU37tNfcEwiAcDe0KS50b0Ecytux0\nfG4JMhghBW2zUfq2XZhBF3y9dXaoDo3w6QcqH3V9GiBF3D08687rjZnrIRHS1CzP\nwgh/pwpkGyZ6Qq7/OUGBxttr0Rc7j07VmoodqGS8hN9iioFa4Y35VPp/hzMaAek4\nN8XViyzEssKqBY821+H+dQ8ymaO2x0vgis/CHtpo8wvBD/oeDXWuTkCE5JmWWrD8\nxm/WkbFPPQJ8KewTNizjl5y4bAHxB5aLfZuriBKubqHZi9dXfwxeGA5R7VdTdyP0\njrP9JAN9dKkg8E7ewKxR6oP+MUbGHYITF/4+fwIDAQABAoIBAGQ7sj8GuQjrENY3\nmYvcr02OJfm9nuRz5BMtsINcEJN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sJ+bTZw4xM4ubu5MShBbHVm\nPP4kdYhct6W0hc0iOUTslMkCZOwFKDvR+oLI73FZhLIPMy7jq5ZfiGgVcYQyB68c\n6eOAvdSrK5di8A3qWvGnZwlXuXT2JCOflfUHmKa8uOdMgDZ9yaED\n-----END RSA PRIVATE KEY-----
logstash_ip:
type: string
example: 172.19.0.2
logstash_port:
type: string
example: 5044
AgentFull:
type: object
required:
- agentId
- host
- monitored
- logstash_ip
- logstash_port
properties:
agentId:
type: string
example: 541
host:
type: string
example: 172.19.0.4
monitored:
type: boolean
example: true
logstash_ip:
type: string
example: 172.19.0.2
logstash_port:
type: string
example: 5044
description: This entity defines an agent with all information available.