deployment-tracker-client 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +13 -0
- data/README.md +71 -0
- data/Rakefile +49 -0
- data/codegen_conf.json +4 -0
- data/deployment-tracker-client.rb.gemspec +27 -0
- data/examples/basic.rb +27 -0
- data/lib/deployment-tracker-client/api/default_api.rb +482 -0
- data/lib/deployment-tracker-client/models/base_object.rb +83 -0
- data/lib/deployment-tracker-client/models/deployment.rb +118 -0
- data/lib/deployment-tracker-client/models/error_response.rb +36 -0
- data/lib/deployment-tracker-client/models/log_message.rb +36 -0
- data/lib/deployment-tracker-client/models/object_response.rb +36 -0
- data/lib/deployment-tracker-client/models/server.rb +68 -0
- data/lib/deployment-tracker-client/version.rb +3 -0
- data/lib/deployment-tracker-client.rb +13 -0
- data/lib/swagger_client/monkey.rb +90 -0
- data/lib/swagger_client/swagger/configuration.rb +29 -0
- data/lib/swagger_client/swagger/request.rb +264 -0
- data/lib/swagger_client/swagger/response.rb +70 -0
- data/lib/swagger_client/swagger/version.rb +5 -0
- data/lib/swagger_client/swagger.rb +78 -0
- data/lib/swagger_client.rb +12 -0
- metadata +156 -0
@@ -0,0 +1,482 @@
|
|
1
|
+
require "uri"
|
2
|
+
|
3
|
+
module DeploymentTrackerClient
|
4
|
+
class DefaultApi
|
5
|
+
basePath = "http://localhost:8080/"
|
6
|
+
# apiInvoker = APIInvoker
|
7
|
+
|
8
|
+
#
|
9
|
+
# Return the current application configuration
|
10
|
+
# @param [Hash] opts the optional parameters
|
11
|
+
# @return [ObjectResponse]
|
12
|
+
def self.config(opts = {})
|
13
|
+
|
14
|
+
|
15
|
+
# resource path
|
16
|
+
path = "/config".sub('{format}','json')
|
17
|
+
|
18
|
+
# query parameters
|
19
|
+
query_params = {}
|
20
|
+
|
21
|
+
# header parameters
|
22
|
+
header_params = {}
|
23
|
+
|
24
|
+
# HTTP header 'Accept' (if needed)
|
25
|
+
_header_accept = []
|
26
|
+
_header_accept_result =SwaggerClient::Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
27
|
+
|
28
|
+
# HTTP header 'Content-Type'
|
29
|
+
_header_content_type = []
|
30
|
+
header_params['Content-Type'] =SwaggerClient::Swagger::Request.select_header_content_type(_header_content_type)
|
31
|
+
|
32
|
+
# form parameters
|
33
|
+
form_params = {}
|
34
|
+
|
35
|
+
# http body (model)
|
36
|
+
post_body = nil
|
37
|
+
|
38
|
+
|
39
|
+
auth_names = []
|
40
|
+
response =SwaggerClient::Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body
|
41
|
+
obj = ObjectResponse.new() and obj.build_from_hash(response)
|
42
|
+
end
|
43
|
+
|
44
|
+
#
|
45
|
+
# Run a health check and return the test results
|
46
|
+
# @param [Hash] opts the optional parameters
|
47
|
+
# @return [ObjectResponse]
|
48
|
+
def self.healthcheck(opts = {})
|
49
|
+
|
50
|
+
|
51
|
+
# resource path
|
52
|
+
path = "/healthcheck".sub('{format}','json')
|
53
|
+
|
54
|
+
# query parameters
|
55
|
+
query_params = {}
|
56
|
+
|
57
|
+
# header parameters
|
58
|
+
header_params = {}
|
59
|
+
|
60
|
+
# HTTP header 'Accept' (if needed)
|
61
|
+
_header_accept = []
|
62
|
+
_header_accept_result =SwaggerClient::Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
63
|
+
|
64
|
+
# HTTP header 'Content-Type'
|
65
|
+
_header_content_type = []
|
66
|
+
header_params['Content-Type'] =SwaggerClient::Swagger::Request.select_header_content_type(_header_content_type)
|
67
|
+
|
68
|
+
# form parameters
|
69
|
+
form_params = {}
|
70
|
+
|
71
|
+
# http body (model)
|
72
|
+
post_body = nil
|
73
|
+
|
74
|
+
|
75
|
+
auth_names = []
|
76
|
+
response =SwaggerClient::Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body
|
77
|
+
obj = ObjectResponse.new() and obj.build_from_hash(response)
|
78
|
+
end
|
79
|
+
|
80
|
+
#
|
81
|
+
# Get the list of most recently completed deployments
|
82
|
+
# @param offset Which result to start with
|
83
|
+
# @param limit Number of results to return
|
84
|
+
# @param [Hash] opts the optional parameters
|
85
|
+
# @return [array[Deployment]]
|
86
|
+
def self.get_deployments(offset, limit, opts = {})
|
87
|
+
|
88
|
+
# verify the required parameter 'offset' is set
|
89
|
+
raise "Missing the required parameter 'offset' when calling get_deployments" if offset.nil?
|
90
|
+
|
91
|
+
# verify the required parameter 'limit' is set
|
92
|
+
raise "Missing the required parameter 'limit' when calling get_deployments" if limit.nil?
|
93
|
+
|
94
|
+
|
95
|
+
# resource path
|
96
|
+
path = "/v1/deployments".sub('{format}','json')
|
97
|
+
|
98
|
+
# query parameters
|
99
|
+
query_params = {}
|
100
|
+
query_params[:'offset'] = offset
|
101
|
+
query_params[:'limit'] = limit
|
102
|
+
|
103
|
+
# header parameters
|
104
|
+
header_params = {}
|
105
|
+
|
106
|
+
# HTTP header 'Accept' (if needed)
|
107
|
+
_header_accept = []
|
108
|
+
_header_accept_result =SwaggerClient::Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
109
|
+
|
110
|
+
# HTTP header 'Content-Type'
|
111
|
+
_header_content_type = []
|
112
|
+
header_params['Content-Type'] =SwaggerClient::Swagger::Request.select_header_content_type(_header_content_type)
|
113
|
+
|
114
|
+
# form parameters
|
115
|
+
form_params = {}
|
116
|
+
|
117
|
+
# http body (model)
|
118
|
+
post_body = nil
|
119
|
+
|
120
|
+
|
121
|
+
auth_names = []
|
122
|
+
response =SwaggerClient::Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body
|
123
|
+
response.map {|response| obj = Deployment.new() and obj.build_from_hash(response) }
|
124
|
+
end
|
125
|
+
|
126
|
+
#
|
127
|
+
# Get a deployment
|
128
|
+
# @param id Unique Identifier (UUID) of the deployment to retrieve
|
129
|
+
# @param [Hash] opts the optional parameters
|
130
|
+
# @return [Deployment]
|
131
|
+
def self.get_deployment(id, opts = {})
|
132
|
+
|
133
|
+
# verify the required parameter 'id' is set
|
134
|
+
raise "Missing the required parameter 'id' when calling get_deployment" if id.nil?
|
135
|
+
|
136
|
+
|
137
|
+
# resource path
|
138
|
+
path = "/v1/deployments/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
|
139
|
+
|
140
|
+
# query parameters
|
141
|
+
query_params = {}
|
142
|
+
|
143
|
+
# header parameters
|
144
|
+
header_params = {}
|
145
|
+
|
146
|
+
# HTTP header 'Accept' (if needed)
|
147
|
+
_header_accept = []
|
148
|
+
_header_accept_result =SwaggerClient::Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
149
|
+
|
150
|
+
# HTTP header 'Content-Type'
|
151
|
+
_header_content_type = []
|
152
|
+
header_params['Content-Type'] =SwaggerClient::Swagger::Request.select_header_content_type(_header_content_type)
|
153
|
+
|
154
|
+
# form parameters
|
155
|
+
form_params = {}
|
156
|
+
|
157
|
+
# http body (model)
|
158
|
+
post_body = nil
|
159
|
+
|
160
|
+
|
161
|
+
auth_names = []
|
162
|
+
response =SwaggerClient::Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body
|
163
|
+
obj = Deployment.new() and obj.build_from_hash(response)
|
164
|
+
end
|
165
|
+
|
166
|
+
#
|
167
|
+
# Record the completion of a new deployment
|
168
|
+
# @param id Unique Identifier (UUID) of the deployment that has completed
|
169
|
+
# @param body The Deployment object to be updated
|
170
|
+
# @param [Hash] opts the optional parameters
|
171
|
+
# @return [nil]
|
172
|
+
def self.put_deployment(id, body, opts = {})
|
173
|
+
|
174
|
+
# verify the required parameter 'id' is set
|
175
|
+
raise "Missing the required parameter 'id' when calling put_deployment" if id.nil?
|
176
|
+
|
177
|
+
# verify the required parameter 'body' is set
|
178
|
+
raise "Missing the required parameter 'body' when calling put_deployment" if body.nil?
|
179
|
+
|
180
|
+
|
181
|
+
# resource path
|
182
|
+
path = "/v1/deployments/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
|
183
|
+
|
184
|
+
# query parameters
|
185
|
+
query_params = {}
|
186
|
+
|
187
|
+
# header parameters
|
188
|
+
header_params = {}
|
189
|
+
|
190
|
+
# HTTP header 'Accept' (if needed)
|
191
|
+
_header_accept = ['text/plain']
|
192
|
+
_header_accept_result =SwaggerClient::Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
193
|
+
|
194
|
+
# HTTP header 'Content-Type'
|
195
|
+
_header_content_type = []
|
196
|
+
header_params['Content-Type'] =SwaggerClient::Swagger::Request.select_header_content_type(_header_content_type)
|
197
|
+
|
198
|
+
# form parameters
|
199
|
+
form_params = {}
|
200
|
+
|
201
|
+
# http body (model)
|
202
|
+
post_body =SwaggerClient::Swagger::Request.object_to_http_body(body)
|
203
|
+
|
204
|
+
|
205
|
+
auth_names = []
|
206
|
+
SwaggerClient::Swagger::Request.new(:PUT, path, {:params => query_params,:headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make
|
207
|
+
nil
|
208
|
+
end
|
209
|
+
|
210
|
+
#
|
211
|
+
# Record the start of a new deployment
|
212
|
+
# @param id Unique Identifier (UUID) of the deployment that is starting
|
213
|
+
# @param body The Deployment object to be created
|
214
|
+
# @param [Hash] opts the optional parameters
|
215
|
+
# @return [nil]
|
216
|
+
def self.post_deployment(id, body, opts = {})
|
217
|
+
|
218
|
+
# verify the required parameter 'id' is set
|
219
|
+
raise "Missing the required parameter 'id' when calling post_deployment" if id.nil?
|
220
|
+
|
221
|
+
# verify the required parameter 'body' is set
|
222
|
+
raise "Missing the required parameter 'body' when calling post_deployment" if body.nil?
|
223
|
+
|
224
|
+
|
225
|
+
# resource path
|
226
|
+
path = "/v1/deployments/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
|
227
|
+
|
228
|
+
# query parameters
|
229
|
+
query_params = {}
|
230
|
+
|
231
|
+
# header parameters
|
232
|
+
header_params = {}
|
233
|
+
|
234
|
+
# HTTP header 'Accept' (if needed)
|
235
|
+
_header_accept = ['text/plain']
|
236
|
+
_header_accept_result =SwaggerClient::Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
237
|
+
|
238
|
+
# HTTP header 'Content-Type'
|
239
|
+
_header_content_type = []
|
240
|
+
header_params['Content-Type'] =SwaggerClient::Swagger::Request.select_header_content_type(_header_content_type)
|
241
|
+
|
242
|
+
# form parameters
|
243
|
+
form_params = {}
|
244
|
+
|
245
|
+
# http body (model)
|
246
|
+
post_body =SwaggerClient::Swagger::Request.object_to_http_body(body)
|
247
|
+
|
248
|
+
|
249
|
+
auth_names = []
|
250
|
+
SwaggerClient::Swagger::Request.new(:POST, path, {:params => query_params,:headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make
|
251
|
+
nil
|
252
|
+
end
|
253
|
+
|
254
|
+
#
|
255
|
+
# Record a log message associated with a deployment
|
256
|
+
# @param id Unique Identifier (UUID) of the deployment that is starting
|
257
|
+
# @param body The log message to be recorded
|
258
|
+
# @param [Hash] opts the optional parameters
|
259
|
+
# @return [nil]
|
260
|
+
def self.post_logs(id, body, opts = {})
|
261
|
+
|
262
|
+
# verify the required parameter 'id' is set
|
263
|
+
raise "Missing the required parameter 'id' when calling post_logs" if id.nil?
|
264
|
+
|
265
|
+
# verify the required parameter 'body' is set
|
266
|
+
raise "Missing the required parameter 'body' when calling post_logs" if body.nil?
|
267
|
+
|
268
|
+
|
269
|
+
# resource path
|
270
|
+
path = "/v1/deployments/{id}/logs".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
|
271
|
+
|
272
|
+
# query parameters
|
273
|
+
query_params = {}
|
274
|
+
|
275
|
+
# header parameters
|
276
|
+
header_params = {}
|
277
|
+
|
278
|
+
# HTTP header 'Accept' (if needed)
|
279
|
+
_header_accept = ['text/plain']
|
280
|
+
_header_accept_result =SwaggerClient::Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
281
|
+
|
282
|
+
# HTTP header 'Content-Type'
|
283
|
+
_header_content_type = []
|
284
|
+
header_params['Content-Type'] =SwaggerClient::Swagger::Request.select_header_content_type(_header_content_type)
|
285
|
+
|
286
|
+
# form parameters
|
287
|
+
form_params = {}
|
288
|
+
|
289
|
+
# http body (model)
|
290
|
+
post_body =SwaggerClient::Swagger::Request.object_to_http_body(body)
|
291
|
+
|
292
|
+
|
293
|
+
auth_names = []
|
294
|
+
SwaggerClient::Swagger::Request.new(:POST, path, {:params => query_params,:headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make
|
295
|
+
nil
|
296
|
+
end
|
297
|
+
|
298
|
+
#
|
299
|
+
# Record the completion of a deployment to a server
|
300
|
+
# @param id Unique Identifier (UUID) of the deployment that has completed
|
301
|
+
# @param body The server on which the deployment has completed
|
302
|
+
# @param [Hash] opts the optional parameters
|
303
|
+
# @return [nil]
|
304
|
+
def self.put_server(id, body, opts = {})
|
305
|
+
|
306
|
+
# verify the required parameter 'id' is set
|
307
|
+
raise "Missing the required parameter 'id' when calling put_server" if id.nil?
|
308
|
+
|
309
|
+
# verify the required parameter 'body' is set
|
310
|
+
raise "Missing the required parameter 'body' when calling put_server" if body.nil?
|
311
|
+
|
312
|
+
|
313
|
+
# resource path
|
314
|
+
path = "/v1/deployments/{id}/servers".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
|
315
|
+
|
316
|
+
# query parameters
|
317
|
+
query_params = {}
|
318
|
+
|
319
|
+
# header parameters
|
320
|
+
header_params = {}
|
321
|
+
|
322
|
+
# HTTP header 'Accept' (if needed)
|
323
|
+
_header_accept = ['text/plain']
|
324
|
+
_header_accept_result =SwaggerClient::Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
325
|
+
|
326
|
+
# HTTP header 'Content-Type'
|
327
|
+
_header_content_type = []
|
328
|
+
header_params['Content-Type'] =SwaggerClient::Swagger::Request.select_header_content_type(_header_content_type)
|
329
|
+
|
330
|
+
# form parameters
|
331
|
+
form_params = {}
|
332
|
+
|
333
|
+
# http body (model)
|
334
|
+
post_body =SwaggerClient::Swagger::Request.object_to_http_body(body)
|
335
|
+
|
336
|
+
|
337
|
+
auth_names = []
|
338
|
+
SwaggerClient::Swagger::Request.new(:PUT, path, {:params => query_params,:headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make
|
339
|
+
nil
|
340
|
+
end
|
341
|
+
|
342
|
+
#
|
343
|
+
# Record the start of a deployment to a server
|
344
|
+
# @param id Unique Identifier (UUID) of the deployment that is starting
|
345
|
+
# @param body The server on which the deployment is starting
|
346
|
+
# @param [Hash] opts the optional parameters
|
347
|
+
# @return [nil]
|
348
|
+
def self.post_server(id, body, opts = {})
|
349
|
+
|
350
|
+
# verify the required parameter 'id' is set
|
351
|
+
raise "Missing the required parameter 'id' when calling post_server" if id.nil?
|
352
|
+
|
353
|
+
# verify the required parameter 'body' is set
|
354
|
+
raise "Missing the required parameter 'body' when calling post_server" if body.nil?
|
355
|
+
|
356
|
+
|
357
|
+
# resource path
|
358
|
+
path = "/v1/deployments/{id}/servers".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)
|
359
|
+
|
360
|
+
# query parameters
|
361
|
+
query_params = {}
|
362
|
+
|
363
|
+
# header parameters
|
364
|
+
header_params = {}
|
365
|
+
|
366
|
+
# HTTP header 'Accept' (if needed)
|
367
|
+
_header_accept = ['text/plain']
|
368
|
+
_header_accept_result =SwaggerClient::Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
369
|
+
|
370
|
+
# HTTP header 'Content-Type'
|
371
|
+
_header_content_type = []
|
372
|
+
header_params['Content-Type'] =SwaggerClient::Swagger::Request.select_header_content_type(_header_content_type)
|
373
|
+
|
374
|
+
# form parameters
|
375
|
+
form_params = {}
|
376
|
+
|
377
|
+
# http body (model)
|
378
|
+
post_body =SwaggerClient::Swagger::Request.object_to_http_body(body)
|
379
|
+
|
380
|
+
|
381
|
+
auth_names = []
|
382
|
+
SwaggerClient::Swagger::Request.new(:POST, path, {:params => query_params,:headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make
|
383
|
+
nil
|
384
|
+
end
|
385
|
+
|
386
|
+
#
|
387
|
+
# Return a list of all servers that have been deployed to
|
388
|
+
# @param offset Which result to start with
|
389
|
+
# @param limit Number of results to return
|
390
|
+
# @param [Hash] opts the optional parameters
|
391
|
+
# @return [array[string]]
|
392
|
+
def self.get_all_servers(offset, limit, opts = {})
|
393
|
+
|
394
|
+
# verify the required parameter 'offset' is set
|
395
|
+
raise "Missing the required parameter 'offset' when calling get_all_servers" if offset.nil?
|
396
|
+
|
397
|
+
# verify the required parameter 'limit' is set
|
398
|
+
raise "Missing the required parameter 'limit' when calling get_all_servers" if limit.nil?
|
399
|
+
|
400
|
+
|
401
|
+
# resource path
|
402
|
+
path = "/v1/servers".sub('{format}','json')
|
403
|
+
|
404
|
+
# query parameters
|
405
|
+
query_params = {}
|
406
|
+
query_params[:'offset'] = offset
|
407
|
+
query_params[:'limit'] = limit
|
408
|
+
|
409
|
+
# header parameters
|
410
|
+
header_params = {}
|
411
|
+
|
412
|
+
# HTTP header 'Accept' (if needed)
|
413
|
+
_header_accept = []
|
414
|
+
_header_accept_result =SwaggerClient::Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
415
|
+
|
416
|
+
# HTTP header 'Content-Type'
|
417
|
+
_header_content_type = []
|
418
|
+
header_params['Content-Type'] =SwaggerClient::Swagger::Request.select_header_content_type(_header_content_type)
|
419
|
+
|
420
|
+
# form parameters
|
421
|
+
form_params = {}
|
422
|
+
|
423
|
+
# http body (model)
|
424
|
+
post_body = nil
|
425
|
+
|
426
|
+
|
427
|
+
auth_names = []
|
428
|
+
response =SwaggerClient::Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body
|
429
|
+
response.map {|response| obj = string.new() and obj.build_from_hash(response) }
|
430
|
+
end
|
431
|
+
|
432
|
+
#
|
433
|
+
# Return a list of all servers that have been deployed to
|
434
|
+
# @param hostname The hostname for the server
|
435
|
+
# @param offset Which result to start with
|
436
|
+
# @param limit Number of results to return
|
437
|
+
# @param [Hash] opts the optional parameters
|
438
|
+
# @return [array[Server]]
|
439
|
+
def self.get_server_by_hostname(hostname, offset, limit, opts = {})
|
440
|
+
|
441
|
+
# verify the required parameter 'hostname' is set
|
442
|
+
raise "Missing the required parameter 'hostname' when calling get_server_by_hostname" if hostname.nil?
|
443
|
+
|
444
|
+
# verify the required parameter 'offset' is set
|
445
|
+
raise "Missing the required parameter 'offset' when calling get_server_by_hostname" if offset.nil?
|
446
|
+
|
447
|
+
# verify the required parameter 'limit' is set
|
448
|
+
raise "Missing the required parameter 'limit' when calling get_server_by_hostname" if limit.nil?
|
449
|
+
|
450
|
+
|
451
|
+
# resource path
|
452
|
+
path = "/v1/servers/{hostname}".sub('{format}','json').sub('{' + 'hostname' + '}', hostname.to_s)
|
453
|
+
|
454
|
+
# query parameters
|
455
|
+
query_params = {}
|
456
|
+
query_params[:'offset'] = offset
|
457
|
+
query_params[:'limit'] = limit
|
458
|
+
|
459
|
+
# header parameters
|
460
|
+
header_params = {}
|
461
|
+
|
462
|
+
# HTTP header 'Accept' (if needed)
|
463
|
+
_header_accept = []
|
464
|
+
_header_accept_result =SwaggerClient::Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
465
|
+
|
466
|
+
# HTTP header 'Content-Type'
|
467
|
+
_header_content_type = []
|
468
|
+
header_params['Content-Type'] =SwaggerClient::Swagger::Request.select_header_content_type(_header_content_type)
|
469
|
+
|
470
|
+
# form parameters
|
471
|
+
form_params = {}
|
472
|
+
|
473
|
+
# http body (model)
|
474
|
+
post_body = nil
|
475
|
+
|
476
|
+
|
477
|
+
auth_names = []
|
478
|
+
response =SwaggerClient::Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body
|
479
|
+
response.map {|response| obj = Server.new() and obj.build_from_hash(response) }
|
480
|
+
end
|
481
|
+
end
|
482
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
module DeploymentTrackerClient
|
2
|
+
# base class containing fundamental method such as to_hash, build_from_hash and more
|
3
|
+
class BaseObject
|
4
|
+
|
5
|
+
# return the object in the form of hash
|
6
|
+
def to_body
|
7
|
+
body = {}
|
8
|
+
self.class.attribute_map.each_pair do |key, value|
|
9
|
+
body[value] = self.send(key) unless self.send(key).nil?
|
10
|
+
end
|
11
|
+
body
|
12
|
+
end
|
13
|
+
|
14
|
+
# build the object from hash
|
15
|
+
def build_from_hash(attributes)
|
16
|
+
return nil unless attributes.is_a?(Hash)
|
17
|
+
self.class.swagger_types.each_pair do |key, type|
|
18
|
+
if type =~ /^array\[(.*)\]/i
|
19
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
20
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
21
|
+
else
|
22
|
+
#TODO show warning in debug mode
|
23
|
+
end
|
24
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
25
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
26
|
+
else
|
27
|
+
# data not found in attributes(hash), not an issue as the data can be optional
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
self
|
32
|
+
end
|
33
|
+
|
34
|
+
def _deserialize(type, value)
|
35
|
+
case type.to_sym
|
36
|
+
when :DateTime
|
37
|
+
DateTime.parse(value)
|
38
|
+
when :string
|
39
|
+
value.to_s
|
40
|
+
when :int
|
41
|
+
value.to_i
|
42
|
+
when :double
|
43
|
+
value.to_f
|
44
|
+
when :boolean
|
45
|
+
if value =~ /^(true|t|yes|y|1)$/i
|
46
|
+
true
|
47
|
+
else
|
48
|
+
false
|
49
|
+
end
|
50
|
+
else # model
|
51
|
+
_model = DeploymentTrackerClient.const_get(type).new
|
52
|
+
_model.build_from_hash(value)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# to_body is an alias to to_body (backward compatibility)
|
57
|
+
def to_hash
|
58
|
+
hash = {}
|
59
|
+
self.class.attribute_map.each_pair do |key, value|
|
60
|
+
if self.send(key).is_a?(Array)
|
61
|
+
next if self.send(key).empty?
|
62
|
+
hash[value] = self.send(key).select{|v| !v.nil?}.map{ |v| _to_hash v} unless self.send(key).nil?
|
63
|
+
else
|
64
|
+
unless (_tmp_value = _to_hash self.send(key)).nil?
|
65
|
+
hash[value] = _tmp_value
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
hash
|
70
|
+
end
|
71
|
+
|
72
|
+
# Method to output non-array value in the form of hash
|
73
|
+
# For object, use to_hash. Otherwise, just return the value
|
74
|
+
def _to_hash(value)
|
75
|
+
if value.respond_to? :to_hash
|
76
|
+
value.to_hash
|
77
|
+
else
|
78
|
+
value
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
module DeploymentTrackerClient
|
2
|
+
#
|
3
|
+
class Deployment < BaseObject
|
4
|
+
attr_accessor :deployment_id, :engine, :engine_version, :host, :user, :environment, :package, :version, :result, :elapsed_seconds, :servers
|
5
|
+
# attribute mapping from ruby-style variable name to JSON key
|
6
|
+
def self.attribute_map
|
7
|
+
{
|
8
|
+
|
9
|
+
# Unique identifier of a deployment. UUID
|
10
|
+
:'deployment_id' => :'deployment_id',
|
11
|
+
|
12
|
+
# The execution engine of the deployment
|
13
|
+
:'engine' => :'engine',
|
14
|
+
|
15
|
+
# The version of the execution engine
|
16
|
+
:'engine_version' => :'engine_version',
|
17
|
+
|
18
|
+
# The host from which the deployment is being executed
|
19
|
+
:'host' => :'host',
|
20
|
+
|
21
|
+
# The user executing the deploymetn
|
22
|
+
:'user' => :'user',
|
23
|
+
|
24
|
+
# The target environment of the deployment
|
25
|
+
:'environment' => :'environment',
|
26
|
+
|
27
|
+
# The name of the software application or service being deployed
|
28
|
+
:'package' => :'package',
|
29
|
+
|
30
|
+
# The version of the package being deployed
|
31
|
+
:'version' => :'version',
|
32
|
+
|
33
|
+
# The result of running the deployment
|
34
|
+
:'result' => :'result',
|
35
|
+
|
36
|
+
# The elapsed time of the deployment, in seconds
|
37
|
+
:'elapsed_seconds' => :'elapsed_seconds',
|
38
|
+
|
39
|
+
# The servers that participated in the deployment
|
40
|
+
:'servers' => :'servers'
|
41
|
+
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# attribute type
|
46
|
+
def self.swagger_types
|
47
|
+
{
|
48
|
+
:'deployment_id' => :'string',
|
49
|
+
:'engine' => :'string',
|
50
|
+
:'engine_version' => :'string',
|
51
|
+
:'host' => :'string',
|
52
|
+
:'user' => :'string',
|
53
|
+
:'environment' => :'string',
|
54
|
+
:'package' => :'string',
|
55
|
+
:'version' => :'string',
|
56
|
+
:'result' => :'string',
|
57
|
+
:'elapsed_seconds' => :'int',
|
58
|
+
:'servers' => :'array[Server]'
|
59
|
+
|
60
|
+
}
|
61
|
+
end
|
62
|
+
|
63
|
+
def initialize(attributes = {})
|
64
|
+
return if !attributes.is_a?(Hash) || attributes.empty?
|
65
|
+
|
66
|
+
# convert string to symbol for hash key
|
67
|
+
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
68
|
+
|
69
|
+
|
70
|
+
if attributes[:'deployment_id']
|
71
|
+
@deployment_id = attributes[:'deployment_id']
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes[:'engine']
|
75
|
+
@engine = attributes[:'engine']
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes[:'engine_version']
|
79
|
+
@engine_version = attributes[:'engine_version']
|
80
|
+
end
|
81
|
+
|
82
|
+
if attributes[:'host']
|
83
|
+
@host = attributes[:'host']
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes[:'user']
|
87
|
+
@user = attributes[:'user']
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes[:'environment']
|
91
|
+
@environment = attributes[:'environment']
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes[:'package']
|
95
|
+
@package = attributes[:'package']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes[:'version']
|
99
|
+
@version = attributes[:'version']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes[:'result']
|
103
|
+
@result = attributes[:'result']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes[:'elapsed_seconds']
|
107
|
+
@elapsed_seconds = attributes[:'elapsed_seconds']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes[:'servers']
|
111
|
+
if (value = attributes[:'servers']).is_a?(Array)
|
112
|
+
@servers = value
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|