Class: Nodeum::TaskDestinationsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TaskDestinationsApi

Returns a new instance of TaskDestinationsApi.



19
20
21
# File 'lib/nodeum_sdk/api/task_destinations_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/task_destinations_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_task_destination(task_id, task_destination_body, opts = {}) ⇒ TaskDestinationDown

Creates a new task destination. **API Key Scope**: task_destinations / create

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it's recommanded to use numeric ID.

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/nodeum_sdk/api/task_destinations_api.rb', line 28

def create_task_destination(task_id, task_destination_body, opts = {})
  data, _status_code, _headers = create_task_destination_with_http_info(task_id, task_destination_body, opts)
  data
end

#create_task_destination_with_http_info(task_id, task_destination_body, opts = {}) ⇒ Array<(TaskDestinationDown, Integer, Hash)>

Creates a new task destination. **API Key Scope**: task_destinations / create

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID.

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

    the optional parameters

Returns:

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

    TaskDestinationDown data, response status code and response headers



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

def create_task_destination_with_http_info(task_id, task_destination_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskDestinationsApi.create_task_destination ...'
  end
  # verify the required parameter 'task_id' is set
  if @api_client.config.client_side_validation && task_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_id' when calling TaskDestinationsApi.create_task_destination"
  end
  # verify the required parameter 'task_destination_body' is set
  if @api_client.config.client_side_validation && task_destination_body.nil?
    fail ArgumentError, "Missing the required parameter 'task_destination_body' when calling TaskDestinationsApi.create_task_destination"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_destinations'.sub('{' + 'task_id' + '}', CGI.escape(task_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(task_destination_body) 

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

  # 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: TaskDestinationsApi#create_task_destination\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#destroy_task_destination(task_id, task_destination_id, opts = {}) ⇒ nil

Destroys a specific task destination. **API Key Scope**: task_destinations / destroy

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID.

  • task_destination_id (Integer)

    Numeric ID of task destination.

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

    the optional parameters

Returns:

  • (nil)


98
99
100
101
# File 'lib/nodeum_sdk/api/task_destinations_api.rb', line 98

def destroy_task_destination(task_id, task_destination_id, opts = {})
  destroy_task_destination_with_http_info(task_id, task_destination_id, opts)
  nil
end

#destroy_task_destination_with_http_info(task_id, task_destination_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Destroys a specific task destination. **API Key Scope**: task_destinations / destroy

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID.

  • task_destination_id (Integer)

    Numeric ID of task destination.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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

def destroy_task_destination_with_http_info(task_id, task_destination_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskDestinationsApi.destroy_task_destination ...'
  end
  # verify the required parameter 'task_id' is set
  if @api_client.config.client_side_validation && task_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_id' when calling TaskDestinationsApi.destroy_task_destination"
  end
  # verify the required parameter 'task_destination_id' is set
  if @api_client.config.client_side_validation && task_destination_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_destination_id' when calling TaskDestinationsApi.destroy_task_destination"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_destinations/{task_destination_id}'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s)).sub('{' + 'task_destination_id' + '}', CGI.escape(task_destination_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: TaskDestinationsApi#destroy_task_destination\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#index_task_destinations(task_id, opts = {}) ⇒ TaskDestinationCollection

Lists all task destinations. **API Key Scope**: task_destinations / index

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID.

  • 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

  • :folder_id (String)

    Filter on folder id

  • :tape_id (String)

    Filter on tape id

  • :pool_id (String)

    Filter on a pool id

Returns:



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

def index_task_destinations(task_id, opts = {})
  data, _status_code, _headers = index_task_destinations_with_http_info(task_id, opts)
  data
end

#index_task_destinations_with_http_info(task_id, opts = {}) ⇒ Array<(TaskDestinationCollection, Integer, Hash)>

Lists all task destinations. **API Key Scope**: task_destinations / index

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID.

  • 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

  • :folder_id (String)

    Filter on folder id

  • :tape_id (String)

    Filter on tape id

  • :pool_id (String)

    Filter on a pool id

Returns:

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

    TaskDestinationCollection data, response status code and response headers



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

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

  # 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[:'folder_id'] = opts[:'folder_id'] if !opts[:'folder_id'].nil?
  query_params[:'tape_id'] = opts[:'tape_id'] if !opts[:'tape_id'].nil?
  query_params[:'pool_id'] = opts[:'pool_id'] if !opts[:'pool_id'].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] || 'TaskDestinationCollection' 

  # 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: TaskDestinationsApi#index_task_destinations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#show_task_destination(task_id, task_destination_id, opts = {}) ⇒ TaskDestinationDown

Displays a specific task destination. **API Key Scope**: task_destinations / show

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID.

  • task_destination_id (Integer)

    Numeric ID of task destination.

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

    the optional parameters

Returns:



247
248
249
250
# File 'lib/nodeum_sdk/api/task_destinations_api.rb', line 247

def show_task_destination(task_id, task_destination_id, opts = {})
  data, _status_code, _headers = show_task_destination_with_http_info(task_id, task_destination_id, opts)
  data
end

#show_task_destination_with_http_info(task_id, task_destination_id, opts = {}) ⇒ Array<(TaskDestinationDown, Integer, Hash)>

Displays a specific task destination. **API Key Scope**: task_destinations / show

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID.

  • task_destination_id (Integer)

    Numeric ID of task destination.

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

    the optional parameters

Returns:

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

    TaskDestinationDown data, response status code and response headers



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
302
303
304
305
306
307
# File 'lib/nodeum_sdk/api/task_destinations_api.rb', line 258

def show_task_destination_with_http_info(task_id, task_destination_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskDestinationsApi.show_task_destination ...'
  end
  # verify the required parameter 'task_id' is set
  if @api_client.config.client_side_validation && task_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_id' when calling TaskDestinationsApi.show_task_destination"
  end
  # verify the required parameter 'task_destination_id' is set
  if @api_client.config.client_side_validation && task_destination_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_destination_id' when calling TaskDestinationsApi.show_task_destination"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_destinations/{task_destination_id}'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s)).sub('{' + 'task_destination_id' + '}', CGI.escape(task_destination_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] || 'TaskDestinationDown' 

  # 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: TaskDestinationsApi#show_task_destination\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_task_destination(task_id, task_destination_id, task_destination_body, opts = {}) ⇒ TaskDestinationDown

Updates a specific task destination. **API Key Scope**: task_destinations / update

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID.

  • task_destination_id (Integer)

    Numeric ID of task destination.

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

    the optional parameters

Returns:



316
317
318
319
# File 'lib/nodeum_sdk/api/task_destinations_api.rb', line 316

def update_task_destination(task_id, task_destination_id, task_destination_body, opts = {})
  data, _status_code, _headers = update_task_destination_with_http_info(task_id, task_destination_id, task_destination_body, opts)
  data
end

#update_task_destination_with_http_info(task_id, task_destination_id, task_destination_body, opts = {}) ⇒ Array<(TaskDestinationDown, Integer, Hash)>

Updates a specific task destination. **API Key Scope**: task_destinations / update

Parameters:

  • task_id (String)

    Numeric ID or name of task. Task names are not unique, it&#39;s recommanded to use numeric ID.

  • task_destination_id (Integer)

    Numeric ID of task destination.

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

    the optional parameters

Returns:

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

    TaskDestinationDown data, response status code and response headers



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

def update_task_destination_with_http_info(task_id, task_destination_id, task_destination_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskDestinationsApi.update_task_destination ...'
  end
  # verify the required parameter 'task_id' is set
  if @api_client.config.client_side_validation && task_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_id' when calling TaskDestinationsApi.update_task_destination"
  end
  # verify the required parameter 'task_destination_id' is set
  if @api_client.config.client_side_validation && task_destination_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_destination_id' when calling TaskDestinationsApi.update_task_destination"
  end
  # verify the required parameter 'task_destination_body' is set
  if @api_client.config.client_side_validation && task_destination_body.nil?
    fail ArgumentError, "Missing the required parameter 'task_destination_body' when calling TaskDestinationsApi.update_task_destination"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_destinations/{task_destination_id}'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s)).sub('{' + 'task_destination_id' + '}', CGI.escape(task_destination_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(task_destination_body) 

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

  # 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: TaskDestinationsApi#update_task_destination\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end