Class: Nodeum::TapeLibrariesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/nodeum_sdk/api/tape_libraries_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TapeLibrariesApi

Returns a new instance of TapeLibrariesApi.



19
20
21
# File 'lib/nodeum_sdk/api/tape_libraries_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/nodeum_sdk/api/tape_libraries_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_tape_library(tape_library_body, opts = {}) ⇒ TapeLibrary

Creates a new tape library. **API Key Scope**: tape_libraries / create

Parameters:

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/nodeum_sdk/api/tape_libraries_api.rb', line 27

def create_tape_library(tape_library_body, opts = {})
  data, _status_code, _headers = create_tape_library_with_http_info(tape_library_body, opts)
  data
end

#create_tape_library_with_http_info(tape_library_body, opts = {}) ⇒ Array<(TapeLibrary, Integer, Hash)>

Creates a new tape library. **API Key Scope**: tape_libraries / create

Parameters:

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

    the optional parameters

Returns:

  • (Array<(TapeLibrary, Integer, Hash)>)

    TapeLibrary data, response status code and response headers



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
# File 'lib/nodeum_sdk/api/tape_libraries_api.rb', line 37

def create_tape_library_with_http_info(tape_library_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TapeLibrariesApi.create_tape_library ...'
  end
  # verify the required parameter 'tape_library_body' is set
  if @api_client.config.client_side_validation && tape_library_body.nil?
    fail ArgumentError, "Missing the required parameter 'tape_library_body' when calling TapeLibrariesApi.create_tape_library"
  end
  # resource path
  local_var_path = '/tape_libraries'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

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

  # return_type
  return_type = opts[:return_type] || 'TapeLibrary' 

  # auth_names
  auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TapeLibrariesApi#create_tape_library\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#destroy_tape_library(tape_library_id, opts = {}) ⇒ nil

Destroys a specific tape library. **API Key Scope**: tape_libraries / destroy

Parameters:

  • tape_library_id (String)

    Numeric ID, serial, or name of tape library.

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

    the optional parameters

Returns:

  • (nil)


91
92
93
94
# File 'lib/nodeum_sdk/api/tape_libraries_api.rb', line 91

def destroy_tape_library(tape_library_id, opts = {})
  destroy_tape_library_with_http_info(tape_library_id, opts)
  nil
end

#destroy_tape_library_with_http_info(tape_library_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Destroys a specific tape library. **API Key Scope**: tape_libraries / destroy

Parameters:

  • tape_library_id (String)

    Numeric ID, serial, or name of tape library.

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

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



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
# File 'lib/nodeum_sdk/api/tape_libraries_api.rb', line 101

def destroy_tape_library_with_http_info(tape_library_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TapeLibrariesApi.destroy_tape_library ...'
  end
  # verify the required parameter 'tape_library_id' is set
  if @api_client.config.client_side_validation && tape_library_id.nil?
    fail ArgumentError, "Missing the required parameter 'tape_library_id' when calling TapeLibrariesApi.destroy_tape_library"
  end
  # resource path
  local_var_path = '/tape_libraries/{tape_library_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TapeLibrariesApi#destroy_tape_library\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#index_tape_libraries(opts = {}) ⇒ TapeLibraryCollection

Lists all tape libraries. **API Key Scope**: tape_libraries / index

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of items to display for pagination.

  • :offset (Integer)

    The number of items to skip for pagination.

  • :sort_by (Array<String>)

    Sort results by attribute. Can sort on multiple attributes, separated by &#x60;|&#x60;. Order direction can be suffixing the attribute by either &#x60;:asc&#x60; (default) or &#x60;:desc&#x60;.

  • :id (String)

    Filter on id

  • :name (String)

    Filter on name

  • :serial (String)

    Filter on serial

  • :comment (String)

    Filter on comment

  • :protocol (String)

    Filter on protocol

  • :vendor (String)

    Filter on vendor

  • :product (String)

    Filter on product

  • :firmware (String)

    Filter on firmware

  • :device (String)

    Filter on device

  • :libso (String)

    Filter on libso

  • :acs (String)

    Filter on acs

  • :status (String)

    Filter on status

  • :storage_slots (String)

    Filter on storage slots

  • :storage_slots_address (String)

    Filter on storage slots address

  • :io_slots (String)

    Filter on io slots

  • :io_slots_address (String)

    Filter on io slots address

  • :price (String)

    Filter on price

Returns:



170
171
172
173
# File 'lib/nodeum_sdk/api/tape_libraries_api.rb', line 170

def index_tape_libraries(opts = {})
  data, _status_code, _headers = index_tape_libraries_with_http_info(opts)
  data
end

#index_tape_libraries_with_http_info(opts = {}) ⇒ Array<(TapeLibraryCollection, Integer, Hash)>

Lists all tape libraries. **API Key Scope**: tape_libraries / index

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    The number of items to display for pagination.

  • :offset (Integer)

    The number of items to skip for pagination.

  • :sort_by (Array<String>)

    Sort results by attribute. Can sort on multiple attributes, separated by &#x60;|&#x60;. Order direction can be suffixing the attribute by either &#x60;:asc&#x60; (default) or &#x60;:desc&#x60;.

  • :id (String)

    Filter on id

  • :name (String)

    Filter on name

  • :serial (String)

    Filter on serial

  • :comment (String)

    Filter on comment

  • :protocol (String)

    Filter on protocol

  • :vendor (String)

    Filter on vendor

  • :product (String)

    Filter on product

  • :firmware (String)

    Filter on firmware

  • :device (String)

    Filter on device

  • :libso (String)

    Filter on libso

  • :acs (String)

    Filter on acs

  • :status (String)

    Filter on status

  • :storage_slots (String)

    Filter on storage slots

  • :storage_slots_address (String)

    Filter on storage slots address

  • :io_slots (String)

    Filter on io slots

  • :io_slots_address (String)

    Filter on io slots address

  • :price (String)

    Filter on price

Returns:

  • (Array<(TapeLibraryCollection, Integer, Hash)>)

    TapeLibraryCollection data, response status code and response headers



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
# File 'lib/nodeum_sdk/api/tape_libraries_api.rb', line 199

def index_tape_libraries_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TapeLibrariesApi.index_tape_libraries ...'
  end
  # resource path
  local_var_path = '/tape_libraries'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'sort_by'] = @api_client.build_collection_param(opts[:'sort_by'], :pipe) if !opts[:'sort_by'].nil?
  query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
  query_params[:'serial'] = opts[:'serial'] if !opts[:'serial'].nil?
  query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?
  query_params[:'protocol'] = opts[:'protocol'] if !opts[:'protocol'].nil?
  query_params[:'vendor'] = opts[:'vendor'] if !opts[:'vendor'].nil?
  query_params[:'product'] = opts[:'product'] if !opts[:'product'].nil?
  query_params[:'firmware'] = opts[:'firmware'] if !opts[:'firmware'].nil?
  query_params[:'device'] = opts[:'device'] if !opts[:'device'].nil?
  query_params[:'libso'] = opts[:'libso'] if !opts[:'libso'].nil?
  query_params[:'acs'] = opts[:'acs'] if !opts[:'acs'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'storage_slots'] = opts[:'storage_slots'] if !opts[:'storage_slots'].nil?
  query_params[:'storage_slots_address'] = opts[:'storage_slots_address'] if !opts[:'storage_slots_address'].nil?
  query_params[:'io_slots'] = opts[:'io_slots'] if !opts[:'io_slots'].nil?
  query_params[:'io_slots_address'] = opts[:'io_slots_address'] if !opts[:'io_slots_address'].nil?
  query_params[:'price'] = opts[:'price'] if !opts[:'price'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'TapeLibraryCollection' 

  # auth_names
  auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TapeLibrariesApi#index_tape_libraries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#index_tape_library_devices(job_id, opts = {}) ⇒ TapeLibraryDeviceCollection

Lists tape libraries devices. **API Key Scope**: tape_libraries / devices

Parameters:

  • job_id (String)

    ID of active job

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

    the optional parameters

Returns:



267
268
269
270
# File 'lib/nodeum_sdk/api/tape_libraries_api.rb', line 267

def index_tape_library_devices(job_id, opts = {})
  data, _status_code, _headers = index_tape_library_devices_with_http_info(job_id, opts)
  data
end

#index_tape_library_devices_with_http_info(job_id, opts = {}) ⇒ Array<(TapeLibraryDeviceCollection, Integer, Hash)>

Lists tape libraries devices. **API Key Scope**: tape_libraries / devices

Parameters:

  • job_id (String)

    ID of active job

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

    the optional parameters

Returns:

  • (Array<(TapeLibraryDeviceCollection, Integer, Hash)>)

    TapeLibraryDeviceCollection data, response status code and response headers



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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# File 'lib/nodeum_sdk/api/tape_libraries_api.rb', line 277

def index_tape_library_devices_with_http_info(job_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TapeLibrariesApi.index_tape_library_devices ...'
  end
  # verify the required parameter 'job_id' is set
  if @api_client.config.client_side_validation && job_id.nil?
    fail ArgumentError, "Missing the required parameter 'job_id' when calling TapeLibrariesApi.index_tape_library_devices"
  end
  # resource path
  local_var_path = '/tape_libraries/-/devices'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'job_id'] = job_id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'queued', 'working', 'failed', ])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'TapeLibraryDeviceCollection' 

  # auth_names
  auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TapeLibrariesApi#index_tape_library_devices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#show_tape_library(tape_library_id, opts = {}) ⇒ TapeLibrary

Displays a specific tape library. **API Key Scope**: tape_libraries / show

Parameters:

  • tape_library_id (String)

    Numeric ID, serial, or name of tape library.

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

    the optional parameters

Returns:



330
331
332
333
# File 'lib/nodeum_sdk/api/tape_libraries_api.rb', line 330

def show_tape_library(tape_library_id, opts = {})
  data, _status_code, _headers = show_tape_library_with_http_info(tape_library_id, opts)
  data
end

#show_tape_library_with_http_info(tape_library_id, opts = {}) ⇒ Array<(TapeLibrary, Integer, Hash)>

Displays a specific tape library. **API Key Scope**: tape_libraries / show

Parameters:

  • tape_library_id (String)

    Numeric ID, serial, or name of tape library.

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

    the optional parameters

Returns:

  • (Array<(TapeLibrary, Integer, Hash)>)

    TapeLibrary data, response status code and response headers



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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
# File 'lib/nodeum_sdk/api/tape_libraries_api.rb', line 340

def show_tape_library_with_http_info(tape_library_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TapeLibrariesApi.show_tape_library ...'
  end
  # verify the required parameter 'tape_library_id' is set
  if @api_client.config.client_side_validation && tape_library_id.nil?
    fail ArgumentError, "Missing the required parameter 'tape_library_id' when calling TapeLibrariesApi.show_tape_library"
  end
  # resource path
  local_var_path = '/tape_libraries/{tape_library_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'TapeLibrary' 

  # auth_names
  auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TapeLibrariesApi#show_tape_library\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_tape_library(tape_library_id, tape_library_body, opts = {}) ⇒ TapeLibrary

Updates a specific tape library. **API Key Scope**: tape_libraries / update

Parameters:

  • tape_library_id (String)

    Numeric ID, serial, or name of tape library.

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

    the optional parameters

Returns:



393
394
395
396
# File 'lib/nodeum_sdk/api/tape_libraries_api.rb', line 393

def update_tape_library(tape_library_id, tape_library_body, opts = {})
  data, _status_code, _headers = update_tape_library_with_http_info(tape_library_id, tape_library_body, opts)
  data
end

#update_tape_library_with_http_info(tape_library_id, tape_library_body, opts = {}) ⇒ Array<(TapeLibrary, Integer, Hash)>

Updates a specific tape library. **API Key Scope**: tape_libraries / update

Parameters:

  • tape_library_id (String)

    Numeric ID, serial, or name of tape library.

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

    the optional parameters

Returns:

  • (Array<(TapeLibrary, Integer, Hash)>)

    TapeLibrary data, response status code and response headers



404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# File 'lib/nodeum_sdk/api/tape_libraries_api.rb', line 404

def update_tape_library_with_http_info(tape_library_id, tape_library_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TapeLibrariesApi.update_tape_library ...'
  end
  # verify the required parameter 'tape_library_id' is set
  if @api_client.config.client_side_validation && tape_library_id.nil?
    fail ArgumentError, "Missing the required parameter 'tape_library_id' when calling TapeLibrariesApi.update_tape_library"
  end
  # verify the required parameter 'tape_library_body' is set
  if @api_client.config.client_side_validation && tape_library_body.nil?
    fail ArgumentError, "Missing the required parameter 'tape_library_body' when calling TapeLibrariesApi.update_tape_library"
  end
  # resource path
  local_var_path = '/tape_libraries/{tape_library_id}'.sub('{' + 'tape_library_id' + '}', CGI.escape(tape_library_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

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

  # return_type
  return_type = opts[:return_type] || 'TapeLibrary' 

  # auth_names
  auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TapeLibrariesApi#update_tape_library\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end