Class: Nodeum::TaskSourcesApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TaskSourcesApi

Returns a new instance of TaskSourcesApi.



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

def api_client
  @api_client
end

Instance Method Details

#create_task_source(task_id, task_source_body, opts = {}) ⇒ TaskSourceDown

Creates a new task source. **API Key Scope**: task_sources / create

Parameters:

  • task_id (String)

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

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

    the optional parameters

Returns:



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

def create_task_source(task_id, task_source_body, opts = {})
  data, _status_code, _headers = create_task_source_with_http_info(task_id, task_source_body, opts)
  data
end

#create_task_source_with_http_info(task_id, task_source_body, opts = {}) ⇒ Array<(TaskSourceDown, Integer, Hash)>

Creates a new task source. **API Key Scope**: task_sources / 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_source_body (TaskSourceUp)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    TaskSourceDown 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_sources_api.rb', line 39

def create_task_source_with_http_info(task_id, task_source_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskSourcesApi.create_task_source ...'
  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 TaskSourcesApi.create_task_source"
  end
  # verify the required parameter 'task_source_body' is set
  if @api_client.config.client_side_validation && task_source_body.nil?
    fail ArgumentError, "Missing the required parameter 'task_source_body' when calling TaskSourcesApi.create_task_source"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_sources'.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_source_body) 

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

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

#destroy_task_source(task_id, task_source_id, opts = {}) ⇒ nil

Destroys a specific task source. **API Key Scope**: task_sources / 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_source_id (Integer)

    Numeric ID of task source.

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

    the optional parameters

Returns:

  • (nil)


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

def destroy_task_source(task_id, task_source_id, opts = {})
  destroy_task_source_with_http_info(task_id, task_source_id, opts)
  nil
end

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

Destroys a specific task source. **API Key Scope**: task_sources / 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_source_id (Integer)

    Numeric ID of task source.

  • 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_sources_api.rb', line 109

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

#index_task_sources(task_id, opts = {}) ⇒ TaskSourceCollection

Lists all task sources. **API Key Scope**: task_sources / 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

  • :file_id (String)

    Filter on file id

  • :import_file_id (String)

    Filter on import file id

  • :tape_id (String)

    Filter on tape id

  • :pool_id (String)

    Filter on a pool id

Returns:



171
172
173
174
# File 'lib/nodeum_sdk/api/task_sources_api.rb', line 171

def index_task_sources(task_id, opts = {})
  data, _status_code, _headers = index_task_sources_with_http_info(task_id, opts)
  data
end

#index_task_sources_with_http_info(task_id, opts = {}) ⇒ Array<(TaskSourceCollection, Integer, Hash)>

Lists all task sources. **API Key Scope**: task_sources / 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

  • :file_id (String)

    Filter on file id

  • :import_file_id (String)

    Filter on import file id

  • :tape_id (String)

    Filter on tape id

  • :pool_id (String)

    Filter on a pool id

Returns:

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

    TaskSourceCollection data, response status code and response headers



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/nodeum_sdk/api/task_sources_api.rb', line 189

def index_task_sources_with_http_info(task_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskSourcesApi.index_task_sources ...'
  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 TaskSourcesApi.index_task_sources"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_sources'.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[:'file_id'] = opts[:'file_id'] if !opts[:'file_id'].nil?
  query_params[:'import_file_id'] = opts[:'import_file_id'] if !opts[:'import_file_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] || 'TaskSourceCollection' 

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

#show_task_source(task_id, task_source_id, opts = {}) ⇒ TaskSourceDown

Displays a specific task source. **API Key Scope**: task_sources / 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_source_id (Integer)

    Numeric ID of task source.

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

    the optional parameters

Returns:



250
251
252
253
# File 'lib/nodeum_sdk/api/task_sources_api.rb', line 250

def show_task_source(task_id, task_source_id, opts = {})
  data, _status_code, _headers = show_task_source_with_http_info(task_id, task_source_id, opts)
  data
end

#show_task_source_with_http_info(task_id, task_source_id, opts = {}) ⇒ Array<(TaskSourceDown, Integer, Hash)>

Displays a specific task source. **API Key Scope**: task_sources / 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_source_id (Integer)

    Numeric ID of task source.

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

    the optional parameters

Returns:

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

    TaskSourceDown data, response status code and response headers



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
308
309
310
# File 'lib/nodeum_sdk/api/task_sources_api.rb', line 261

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

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

#update_task_source(task_id, task_source_id, task_source_body, opts = {}) ⇒ TaskSourceDown

Updates a specific task source. **API Key Scope**: task_sources / 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_source_id (Integer)

    Numeric ID of task source.

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

    the optional parameters

Returns:



319
320
321
322
# File 'lib/nodeum_sdk/api/task_sources_api.rb', line 319

def update_task_source(task_id, task_source_id, task_source_body, opts = {})
  data, _status_code, _headers = update_task_source_with_http_info(task_id, task_source_id, task_source_body, opts)
  data
end

#update_task_source_with_http_info(task_id, task_source_id, task_source_body, opts = {}) ⇒ Array<(TaskSourceDown, Integer, Hash)>

Updates a specific task source. **API Key Scope**: task_sources / 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_source_id (Integer)

    Numeric ID of task source.

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

    the optional parameters

Returns:

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

    TaskSourceDown data, response status code and response headers



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
384
385
386
# File 'lib/nodeum_sdk/api/task_sources_api.rb', line 331

def update_task_source_with_http_info(task_id, task_source_id, task_source_body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TaskSourcesApi.update_task_source ...'
  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 TaskSourcesApi.update_task_source"
  end
  # verify the required parameter 'task_source_id' is set
  if @api_client.config.client_side_validation && task_source_id.nil?
    fail ArgumentError, "Missing the required parameter 'task_source_id' when calling TaskSourcesApi.update_task_source"
  end
  # verify the required parameter 'task_source_body' is set
  if @api_client.config.client_side_validation && task_source_body.nil?
    fail ArgumentError, "Missing the required parameter 'task_source_body' when calling TaskSourcesApi.update_task_source"
  end
  # resource path
  local_var_path = '/tasks/{task_id}/task_sources/{task_source_id}'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s)).sub('{' + 'task_source_id' + '}', CGI.escape(task_source_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_source_body) 

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

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