Class: Apcera::PackagesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/apcera/api/packages_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = nil) ⇒ PackagesApi

Returns a new instance of PackagesApi.



7
8
9
# File 'lib/apcera/api/packages_api.rb', line 7

def initialize(api_client = nil)
  @api_client = api_client || Configuration.api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



5
6
7
# File 'lib/apcera/api/packages_api.rb', line 5

def api_client
  @api_client
end

Instance Method Details

#packages_dependencies_post(opts = {}) ⇒ Array<Package>

Returns a list of packages that fulfill the specified dependency type and name for the specified namespace. Returns a list of packages that fulfill the specified dependency type and name for the specified namespace.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :targetjob_resource (PackageDependsRequest)

    JSON object that identifies the namespace we&#39;re resolving dependencies within, and the package dependencies that need to be fully resolved.

  • :authorization (String)

Returns:



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
# File 'lib/apcera/api/packages_api.rb', line 145

def packages_dependencies_post(opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: PackagesApi#packages_dependencies_post ..."
  end
  
  
  # resource path
  path = "/packages/dependencies".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'targetjob_resource'])
  

  auth_names = ['authorization']
  result = @api_client.call_api(:POST, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<Package>')
  if Configuration.debugging
    Configuration.logger.debug "API called: PackagesApi#packages_dependencies_post. Result: #{result.inspect}"
  end
  return result
end

#packages_get(opts = {}) ⇒ Array<Package>

Returns a list of packages on the cluster. Returns a list of packages on the cluster, optionally filtered by package name, FQN, UUID or other properties. Pagination is also supported.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :tag (Array<String>)

    List of tags. Only packages with the specified tags are returned.

  • :excluded_tags (Array<String>)

    List of excluded tags. Only packages without the specified tags are returned.

  • :ids (Array<String>)

    List of package UUIDs. Only packages with specifed UUIDs to return.

  • :name (String)

    Local name of package to return.

  • :fqn (String)

    FQN of package to return.

  • :match_partial_fqn (String)

    If ‘true`, packages that partially match the FQN specified by `fqn` parameter are returned. If `false` (default) then `fqn` must exactly match an available package.

  • :package_id (String)

    UUID of the package to return.

  • :provides_type (String)

    Type of packages to return. Valid values are ‘os`, `package`, `runtime`, or `file`.

  • :provides_name (String)

    Name that describes the packages to return. Value can be an exact package name (&#39;java-1.6&#39; or &#39;ubuntu-13.10&#39;, for example) or a generalized requirement (&#39;linux&#39;, for example).

  • :authorization (String)

Returns:



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
# File 'lib/apcera/api/packages_api.rb', line 25

def packages_get(opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: PackagesApi#packages_get ..."
  end
  
  
  if opts[:'provides_type'] && !['file', 'package', 'runtime', 'os'].include?(opts[:'provides_type'])
    fail 'invalid value for "provides_type", must be one of file, package, runtime, os'
  end
  
  # resource path
  path = "/packages".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'tag'] = opts[:'tag'] if opts[:'tag']
  query_params[:'excluded_tags'] = opts[:'excluded_tags'] if opts[:'excluded_tags']
  query_params[:'ids'] = opts[:'ids'] if opts[:'ids']
  query_params[:'name'] = opts[:'name'] if opts[:'name']
  query_params[:'fqn'] = opts[:'fqn'] if opts[:'fqn']
  query_params[:'matchPartialFQN'] = opts[:'match_partial_fqn'] if opts[:'match_partial_fqn']
  query_params[:'package_id'] = opts[:'package_id'] if opts[:'package_id']
  query_params[:'provides_type'] = opts[:'provides_type'] if opts[:'provides_type']
  query_params[:'provides_name'] = opts[:'provides_name'] if opts[:'provides_name']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['authorization']
  result = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<Package>')
  if Configuration.debugging
    Configuration.logger.debug "API called: PackagesApi#packages_get. Result: #{result.inspect}"
  end
  return result
end

#packages_package_uuid_resources_resource_uuid_put(package_uuid, resource_uuid, binary_data, content_digest, opts = {}) ⇒ nil

Uploads a package resource for the specified package. Uploads a specific package resource to the specified package.

Parameters:

  • package_uuid

    UUID of the package.

  • resource_uuid

    UUID of the resource.

  • binary_data

    Binary package resource (GZIP). The resource&#39;s content length and SHA must match the values specified made in a previous call to [‘POST /packages`](#operation–packages-post).

  • content_digest
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
# File 'lib/apcera/api/packages_api.rb', line 312

def packages_package_uuid_resources_resource_uuid_put(package_uuid, resource_uuid, binary_data, content_digest, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: PackagesApi#packages_package_uuid_resources_resource_uuid_put ..."
  end
  
  
  # verify the required parameter 'package_uuid' is set
  fail "Missing the required parameter 'package_uuid' when calling packages_package_uuid_resources_resource_uuid_put" if package_uuid.nil?
  
  # verify the required parameter 'resource_uuid' is set
  fail "Missing the required parameter 'resource_uuid' when calling packages_package_uuid_resources_resource_uuid_put" if resource_uuid.nil?
  
  # verify the required parameter 'binary_data' is set
  fail "Missing the required parameter 'binary_data' when calling packages_package_uuid_resources_resource_uuid_put" if binary_data.nil?
  
  # verify the required parameter 'content_digest' is set
  fail "Missing the required parameter 'content_digest' when calling packages_package_uuid_resources_resource_uuid_put" if content_digest.nil?
  
  # resource path
  path = "/packages/{package_uuid}/resources/{resource_uuid}".sub('{format}','json').sub('{' + 'package_uuid' + '}', package_uuid.to_s).sub('{' + 'resource_uuid' + '}', resource_uuid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/octet-stream']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'Content-Digest'] = content_digest
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(binary_data)
  

  auth_names = ['authorization']
  @api_client.call_api(:PUT, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if Configuration.debugging
    Configuration.logger.debug "API called: PackagesApi#packages_package_uuid_resources_resource_uuid_put"
  end
  return nil
end

#packages_post(pkg, opts = {}) ⇒ Package

Creates a new package. Creates a new package from the provided JSON object.

Parameters:

  • pkg

    An object that defines the properties of the new package.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



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
# File 'lib/apcera/api/packages_api.rb', line 90

def packages_post(pkg, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: PackagesApi#packages_post ..."
  end
  
  
  # verify the required parameter 'pkg' is set
  fail "Missing the required parameter 'pkg' when calling packages_post" if pkg.nil?
  
  # resource path
  path = "/packages".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(pkg)
  

  auth_names = ['authorization']
  result = @api_client.call_api(:POST, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Package')
  if Configuration.debugging
    Configuration.logger.debug "API called: PackagesApi#packages_post. Result: #{result.inspect}"
  end
  return result
end

#packages_resources_uuid_get(uuid, opts = {}) ⇒ nil

Downloads the specified package&#39;s binary resource. Downloads the specified package&#39;s binary resource.

Parameters:

  • uuid

    UUID of the package.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


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
# File 'lib/apcera/api/packages_api.rb', line 197

def packages_resources_uuid_get(uuid, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: PackagesApi#packages_resources_uuid_get ..."
  end
  
  
  # verify the required parameter 'uuid' is set
  fail "Missing the required parameter 'uuid' when calling packages_resources_uuid_get" if uuid.nil?
  
  # resource path
  path = "/packages/resources/{uuid}".sub('{format}','json').sub('{' + 'uuid' + '}', uuid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['authorization']
  @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if Configuration.debugging
    Configuration.logger.debug "API called: PackagesApi#packages_resources_uuid_get"
  end
  return nil
end

#packages_resources_uuid_put(uuid, binary_data, opts = {}) ⇒ nil

Uploads package resources for the specified package. Uploads package resources for the specified package.

Parameters:

  • uuid

    UUID of the package.

  • binary_data

    Binary package resource (GZIP). The resource&#39;s content length and SHA must match the values specified made in a previous call to [‘POST /packages`](#operation–packages-post).

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/apcera/api/packages_api.rb', line 252

def packages_resources_uuid_put(uuid, binary_data, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: PackagesApi#packages_resources_uuid_put ..."
  end
  
  
  # verify the required parameter 'uuid' is set
  fail "Missing the required parameter 'uuid' when calling packages_resources_uuid_put" if uuid.nil?
  
  # verify the required parameter 'binary_data' is set
  fail "Missing the required parameter 'binary_data' when calling packages_resources_uuid_put" if binary_data.nil?
  
  # resource path
  path = "/packages/resources/{uuid}".sub('{format}','json').sub('{' + 'uuid' + '}', uuid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/octet-stream']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(binary_data)
  

  auth_names = ['authorization']
  @api_client.call_api(:PUT, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if Configuration.debugging
    Configuration.logger.debug "API called: PackagesApi#packages_resources_uuid_put"
  end
  return nil
end

#packages_uuid_delete(uuid, opts = {}) ⇒ nil

Deletes the specified package. Deletes the specified package.

Parameters:

  • uuid

    UUID of the package to delete.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
# File 'lib/apcera/api/packages_api.rb', line 489

def packages_uuid_delete(uuid, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: PackagesApi#packages_uuid_delete ..."
  end
  
  
  # verify the required parameter 'uuid' is set
  fail "Missing the required parameter 'uuid' when calling packages_uuid_delete" if uuid.nil?
  
  # resource path
  path = "/packages/{uuid}".sub('{format}','json').sub('{' + 'uuid' + '}', uuid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['authorization']
  @api_client.call_api(:DELETE, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if Configuration.debugging
    Configuration.logger.debug "API called: PackagesApi#packages_uuid_delete"
  end
  return nil
end

#packages_uuid_get(uuid, opts = {}) ⇒ Package

Returns the specified package. Returns the specified package.

Parameters:

  • uuid

    UUID of the package.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
# File 'lib/apcera/api/packages_api.rb', line 376

def packages_uuid_get(uuid, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: PackagesApi#packages_uuid_get ..."
  end
  
  
  # verify the required parameter 'uuid' is set
  fail "Missing the required parameter 'uuid' when calling packages_uuid_get" if uuid.nil?
  
  # resource path
  path = "/packages/{uuid}".sub('{format}','json').sub('{' + 'uuid' + '}', uuid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['authorization']
  result = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Package')
  if Configuration.debugging
    Configuration.logger.debug "API called: PackagesApi#packages_uuid_get. Result: #{result.inspect}"
  end
  return result
end

#packages_uuid_put(uuid, package, opts = {}) ⇒ nil

Updates the specified package&#39;s properties. Updates the specified package with the properties defined in the provided package object.

Parameters:

  • uuid

    UUID of the package.

  • package

    A Package object containing the updated properties for the specified package.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
# File 'lib/apcera/api/packages_api.rb', line 432

def packages_uuid_put(uuid, package, opts = {})

  if Configuration.debugging
    Configuration.logger.debug "Calling API: PackagesApi#packages_uuid_put ..."
  end
  
  
  # verify the required parameter 'uuid' is set
  fail "Missing the required parameter 'uuid' when calling packages_uuid_put" if uuid.nil?
  
  # verify the required parameter 'package' is set
  fail "Missing the required parameter 'package' when calling packages_uuid_put" if package.nil?
  
  # resource path
  path = "/packages/{uuid}".sub('{format}','json').sub('{' + 'uuid' + '}', uuid.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = []
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
  header_params[:'authorization'] = opts[:'authorization'] if opts[:'authorization']

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(package)
  

  auth_names = ['authorization']
  @api_client.call_api(:PUT, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if Configuration.debugging
    Configuration.logger.debug "API called: PackagesApi#packages_uuid_put"
  end
  return nil
end