Class: ArtikCloud::DevicesManagementApi

Inherits:
Object
  • Object
show all
Defined in:
lib/artikcloud/api/devices_management_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DevicesManagementApi

Returns a new instance of DevicesManagementApi.



18
19
20
# File 'lib/artikcloud/api/devices_management_api.rb', line 18

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



16
17
18
# File 'lib/artikcloud/api/devices_management_api.rb', line 16

def api_client
  @api_client
end

Instance Method Details

#create_tasks(task_payload, opts = {}) ⇒ TaskEnvelope

Create a new task for one or more devices Create a new task for one or more devices

Parameters:

  • task_payload

    Task object to be created

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/artikcloud/api/devices_management_api.rb', line 27

def create_tasks(task_payload, opts = {})
  data, _status_code, _headers = create_tasks_with_http_info(task_payload, opts)
  return data
end

#create_tasks_with_http_info(task_payload, opts = {}) ⇒ Array<(TaskEnvelope, Fixnum, Hash)>

Create a new task for one or more devices Create a new task for one or more devices

Parameters:

  • task_payload

    Task object to be created

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

    the optional parameters

Returns:

  • (Array<(TaskEnvelope, Fixnum, Hash)>)

    TaskEnvelope 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
# File 'lib/artikcloud/api/devices_management_api.rb', line 37

def create_tasks_with_http_info(task_payload, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DevicesManagementApi.create_tasks ..."
  end
  # verify the required parameter 'task_payload' is set
  fail ArgumentError, "Missing the required parameter 'task_payload' when calling DevicesManagementApi.create_tasks" if task_payload.nil?
  # resource path
  local_var_path = "/devicemgmt/tasks".sub('{format}','json')

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(task_payload)
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'TaskEnvelope')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DevicesManagementApi#create_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_server_properties(did, opts = {}) ⇒ MetadataEnvelope

Deletes a device’s properties. Deletes a device’s properties.

Parameters:

  • did

    Device ID.

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

    the optional parameters

Returns:



78
79
80
81
# File 'lib/artikcloud/api/devices_management_api.rb', line 78

def delete_server_properties(did, opts = {})
  data, _status_code, _headers = delete_server_properties_with_http_info(did, opts)
  return data
end

#delete_server_properties_with_http_info(did, opts = {}) ⇒ Array<(MetadataEnvelope, Fixnum, Hash)>

Deletes a device&#39;s properties. Deletes a device&#39;s properties.

Parameters:

  • did

    Device ID.

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

    the optional parameters

Returns:

  • (Array<(MetadataEnvelope, Fixnum, Hash)>)

    MetadataEnvelope data, response status code and response headers



88
89
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
# File 'lib/artikcloud/api/devices_management_api.rb', line 88

def delete_server_properties_with_http_info(did, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DevicesManagementApi.delete_server_properties ..."
  end
  # verify the required parameter 'did' is set
  fail ArgumentError, "Missing the required parameter 'did' when calling DevicesManagementApi.delete_server_properties" if did.nil?
  # resource path
  local_var_path = "/devicemgmt/devices/{did}/serverproperties".sub('{format}','json').sub('{' + 'did' + '}', did.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'MetadataEnvelope')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DevicesManagementApi#delete_server_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_by_did(did, opts = {}) ⇒ TaskByDidListEnvelope

Returns the list of tasks for a particular device id with optional status filter. Returns the list of tasks for a particular device id with optional status filter.

Parameters:

  • did

    Device ID.

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

    the optional parameters

Options Hash (opts):

  • :count (Integer)

    Max results count.

  • :offset (Integer)

    Result starting offset.

  • :status (String)

    Status filter. Comma-separated statuses.

  • :order (String)

    Sort results by a field. Valid fields: createdOn.

  • :sort (String)

    Sort order. Valid values: asc or desc.

Returns:



134
135
136
137
# File 'lib/artikcloud/api/devices_management_api.rb', line 134

def get_all_by_did(did, opts = {})
  data, _status_code, _headers = get_all_by_did_with_http_info(did, opts)
  return data
end

#get_all_by_did_with_http_info(did, opts = {}) ⇒ Array<(TaskByDidListEnvelope, Fixnum, Hash)>

Returns the list of tasks for a particular device id with optional status filter. Returns the list of tasks for a particular device id with optional status filter.

Parameters:

  • did

    Device ID.

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

    the optional parameters

Options Hash (opts):

  • :count (Integer)

    Max results count.

  • :offset (Integer)

    Result starting offset.

  • :status (String)

    Status filter. Comma-separated statuses.

  • :order (String)

    Sort results by a field. Valid fields: createdOn.

  • :sort (String)

    Sort order. Valid values: asc or desc.

Returns:

  • (Array<(TaskByDidListEnvelope, Fixnum, Hash)>)

    TaskByDidListEnvelope data, response status code and response headers



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
# File 'lib/artikcloud/api/devices_management_api.rb', line 149

def get_all_by_did_with_http_info(did, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DevicesManagementApi.get_all_by_did ..."
  end
  # verify the required parameter 'did' is set
  fail ArgumentError, "Missing the required parameter 'did' when calling DevicesManagementApi.get_all_by_did" if did.nil?
  # resource path
  local_var_path = "/devicemgmt/devices/{did}/tasks".sub('{format}','json').sub('{' + 'did' + '}', did.to_s)

  # query parameters
  query_params = {}
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'TaskByDidListEnvelope')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DevicesManagementApi#get_all_by_did\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_device_types_info(dtid, opts = {}) ⇒ DeviceTypesInfoEnvelope

Read a device type device management information. Read a device type device management information.

Parameters:

  • dtid

    Device type ID.

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

    the optional parameters

Returns:



195
196
197
198
# File 'lib/artikcloud/api/devices_management_api.rb', line 195

def get_device_types_info(dtid, opts = {})
  data, _status_code, _headers = get_device_types_info_with_http_info(dtid, opts)
  return data
end

#get_device_types_info_with_http_info(dtid, opts = {}) ⇒ Array<(DeviceTypesInfoEnvelope, Fixnum, Hash)>

Read a device type device management information. Read a device type device management information.

Parameters:

  • dtid

    Device type ID.

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

    the optional parameters

Returns:

  • (Array<(DeviceTypesInfoEnvelope, Fixnum, Hash)>)

    DeviceTypesInfoEnvelope data, response status code and response headers



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/artikcloud/api/devices_management_api.rb', line 205

def get_device_types_info_with_http_info(dtid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DevicesManagementApi.get_device_types_info ..."
  end
  # verify the required parameter 'dtid' is set
  fail ArgumentError, "Missing the required parameter 'dtid' when calling DevicesManagementApi.get_device_types_info" if dtid.nil?
  # resource path
  local_var_path = "/devicemgmt/devicetypes/{dtid}".sub('{format}','json').sub('{' + 'dtid' + '}', dtid.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DeviceTypesInfoEnvelope')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DevicesManagementApi#get_device_types_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_manifest_properties(dtid, opts = {}) ⇒ MetadataPropertiesEnvelope

Get a device type’s device management manifest properties Get a device type’s device management manifest properties

Parameters:

  • dtid

    Device Type ID.

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

    the optional parameters

Returns:



246
247
248
249
# File 'lib/artikcloud/api/devices_management_api.rb', line 246

def get_manifest_properties(dtid, opts = {})
  data, _status_code, _headers = get_manifest_properties_with_http_info(dtid, opts)
  return data
end

#get_manifest_properties_with_http_info(dtid, opts = {}) ⇒ Array<(MetadataPropertiesEnvelope, Fixnum, Hash)>

Get a device type&#39;s device management manifest properties Get a device type&#39;s device management manifest properties

Parameters:

  • dtid

    Device Type ID.

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

    the optional parameters

Returns:

  • (Array<(MetadataPropertiesEnvelope, Fixnum, Hash)>)

    MetadataPropertiesEnvelope data, response status code and response headers



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
# File 'lib/artikcloud/api/devices_management_api.rb', line 256

def get_manifest_properties_with_http_info(dtid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DevicesManagementApi.get_manifest_properties ..."
  end
  # verify the required parameter 'dtid' is set
  fail ArgumentError, "Missing the required parameter 'dtid' when calling DevicesManagementApi.get_manifest_properties" if dtid.nil?
  # resource path
  local_var_path = "/devicemgmt/devicetypes/{dtid}/manifest/properties".sub('{format}','json').sub('{' + 'dtid' + '}', dtid.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'MetadataPropertiesEnvelope')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DevicesManagementApi#get_manifest_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_properties(did, opts = {}) ⇒ MetadataEnvelope

Read a device’s properties. Read a device’s properties.

Parameters:

  • did

    Device ID.

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

    the optional parameters

Options Hash (opts):

  • :include_timestamp (BOOLEAN)

    Include timestamp.

Returns:



298
299
300
301
# File 'lib/artikcloud/api/devices_management_api.rb', line 298

def get_properties(did, opts = {})
  data, _status_code, _headers = get_properties_with_http_info(did, opts)
  return data
end

#get_properties_with_http_info(did, opts = {}) ⇒ Array<(MetadataEnvelope, Fixnum, Hash)>

Read a device&#39;s properties. Read a device&#39;s properties.

Parameters:

  • did

    Device ID.

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

    the optional parameters

Options Hash (opts):

  • :include_timestamp (BOOLEAN)

    Include timestamp.

Returns:

  • (Array<(MetadataEnvelope, Fixnum, Hash)>)

    MetadataEnvelope data, response status code and response headers



309
310
311
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
# File 'lib/artikcloud/api/devices_management_api.rb', line 309

def get_properties_with_http_info(did, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DevicesManagementApi.get_properties ..."
  end
  # verify the required parameter 'did' is set
  fail ArgumentError, "Missing the required parameter 'did' when calling DevicesManagementApi.get_properties" if did.nil?
  # resource path
  local_var_path = "/devicemgmt/devices/{did}/properties".sub('{format}','json').sub('{' + 'did' + '}', did.to_s)

  # query parameters
  query_params = {}
  query_params[:'includeTimestamp'] = opts[:'include_timestamp'] if !opts[:'include_timestamp'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'MetadataEnvelope')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DevicesManagementApi#get_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_statuses(tid, opts = {}) ⇒ TaskStatusesEnvelope

Returns the details and status of a task id and the individual statuses of each device id in the list. Returns the details and status of a task id and the individual statuses of each device id in the list.

Parameters:

  • tid

    Task ID.

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

    the optional parameters

Options Hash (opts):

  • :count (Integer)

    Max results count.

  • :offset (Integer)

    Result starting offset.

  • :status (String)

    Status filter. Comma-separated statuses.

  • :dids (String)

    Devices filter. Comma-separated device IDs.

Returns:



355
356
357
358
# File 'lib/artikcloud/api/devices_management_api.rb', line 355

def get_statuses(tid, opts = {})
  data, _status_code, _headers = get_statuses_with_http_info(tid, opts)
  return data
end

#get_statuses_history(tid, opts = {}) ⇒ TaskStatusesHistoryEnvelope

Returns the history of the status changes for a specific task id, or for a specific device id in that task. Returns the history of the status changes for a specific task id, or for a specific device id in that task.

Parameters:

  • tid

    Task ID.

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

    the optional parameters

Options Hash (opts):

  • :did (String)

    Device ID. Optional.

Returns:



415
416
417
418
# File 'lib/artikcloud/api/devices_management_api.rb', line 415

def get_statuses_history(tid, opts = {})
  data, _status_code, _headers = get_statuses_history_with_http_info(tid, opts)
  return data
end

#get_statuses_history_with_http_info(tid, opts = {}) ⇒ Array<(TaskStatusesHistoryEnvelope, Fixnum, Hash)>

Returns the history of the status changes for a specific task id, or for a specific device id in that task. Returns the history of the status changes for a specific task id, or for a specific device id in that task.

Parameters:

  • tid

    Task ID.

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

    the optional parameters

Options Hash (opts):

  • :did (String)

    Device ID. Optional.

Returns:



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
456
457
458
459
460
461
# File 'lib/artikcloud/api/devices_management_api.rb', line 426

def get_statuses_history_with_http_info(tid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DevicesManagementApi.get_statuses_history ..."
  end
  # verify the required parameter 'tid' is set
  fail ArgumentError, "Missing the required parameter 'tid' when calling DevicesManagementApi.get_statuses_history" if tid.nil?
  # resource path
  local_var_path = "/devicemgmt/tasks/{tid}/statuses/history".sub('{format}','json').sub('{' + 'tid' + '}', tid.to_s)

  # query parameters
  query_params = {}
  query_params[:'did'] = opts[:'did'] if !opts[:'did'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'TaskStatusesHistoryEnvelope')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DevicesManagementApi#get_statuses_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_statuses_with_http_info(tid, opts = {}) ⇒ Array<(TaskStatusesEnvelope, Fixnum, Hash)>

Returns the details and status of a task id and the individual statuses of each device id in the list. Returns the details and status of a task id and the individual statuses of each device id in the list.

Parameters:

  • tid

    Task ID.

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

    the optional parameters

Options Hash (opts):

  • :count (Integer)

    Max results count.

  • :offset (Integer)

    Result starting offset.

  • :status (String)

    Status filter. Comma-separated statuses.

  • :dids (String)

    Devices filter. Comma-separated device IDs.

Returns:

  • (Array<(TaskStatusesEnvelope, Fixnum, Hash)>)

    TaskStatusesEnvelope data, response status code and response headers



369
370
371
372
373
374
375
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
# File 'lib/artikcloud/api/devices_management_api.rb', line 369

def get_statuses_with_http_info(tid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DevicesManagementApi.get_statuses ..."
  end
  # verify the required parameter 'tid' is set
  fail ArgumentError, "Missing the required parameter 'tid' when calling DevicesManagementApi.get_statuses" if tid.nil?
  # resource path
  local_var_path = "/devicemgmt/tasks/{tid}/statuses".sub('{format}','json').sub('{' + 'tid' + '}', tid.to_s)

  # query parameters
  query_params = {}
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'dids'] = opts[:'dids'] if !opts[:'dids'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'TaskStatusesEnvelope')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DevicesManagementApi#get_statuses\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_task_by_id(tid, opts = {}) ⇒ TaskEnvelope

Returns the details and global status of a specific task id. Returns the details and global status of a specific task id.

Parameters:

  • tid

    Task ID.

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

    the optional parameters

Returns:



468
469
470
471
# File 'lib/artikcloud/api/devices_management_api.rb', line 468

def get_task_by_id(tid, opts = {})
  data, _status_code, _headers = get_task_by_id_with_http_info(tid, opts)
  return data
end

#get_task_by_id_with_http_info(tid, opts = {}) ⇒ Array<(TaskEnvelope, Fixnum, Hash)>

Returns the details and global status of a specific task id. Returns the details and global status of a specific task id.

Parameters:

  • tid

    Task ID.

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

    the optional parameters

Returns:

  • (Array<(TaskEnvelope, Fixnum, Hash)>)

    TaskEnvelope data, response status code and response headers



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
# File 'lib/artikcloud/api/devices_management_api.rb', line 478

def get_task_by_id_with_http_info(tid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DevicesManagementApi.get_task_by_id ..."
  end
  # verify the required parameter 'tid' is set
  fail ArgumentError, "Missing the required parameter 'tid' when calling DevicesManagementApi.get_task_by_id" if tid.nil?
  # resource path
  local_var_path = "/devicemgmt/tasks/{tid}".sub('{format}','json').sub('{' + 'tid' + '}', tid.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'TaskEnvelope')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DevicesManagementApi#get_task_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_tasks(dtid, opts = {}) ⇒ TaskListEnvelope

Returns the all the tasks for a device type. Returns the all the tasks for a device type.

Parameters:

  • dtid

    Device Type ID.

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

    the optional parameters

Options Hash (opts):

  • :count (Integer)

    Max results count.

  • :offset (Integer)

    Result starting offset.

  • :status (String)

    Status filter. Comma-separated statuses.

  • :order (String)

    Sort results by a field. Valid fields: createdOn.

  • :sort (String)

    Sort order. Valid values: asc or desc.

Returns:



524
525
526
527
# File 'lib/artikcloud/api/devices_management_api.rb', line 524

def get_tasks(dtid, opts = {})
  data, _status_code, _headers = get_tasks_with_http_info(dtid, opts)
  return data
end

#get_tasks_with_http_info(dtid, opts = {}) ⇒ Array<(TaskListEnvelope, Fixnum, Hash)>

Returns the all the tasks for a device type. Returns the all the tasks for a device type.

Parameters:

  • dtid

    Device Type ID.

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

    the optional parameters

Options Hash (opts):

  • :count (Integer)

    Max results count.

  • :offset (Integer)

    Result starting offset.

  • :status (String)

    Status filter. Comma-separated statuses.

  • :order (String)

    Sort results by a field. Valid fields: createdOn.

  • :sort (String)

    Sort order. Valid values: asc or desc.

Returns:

  • (Array<(TaskListEnvelope, Fixnum, Hash)>)

    TaskListEnvelope data, response status code and response headers



539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
# File 'lib/artikcloud/api/devices_management_api.rb', line 539

def get_tasks_with_http_info(dtid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DevicesManagementApi.get_tasks ..."
  end
  # verify the required parameter 'dtid' is set
  fail ArgumentError, "Missing the required parameter 'dtid' when calling DevicesManagementApi.get_tasks" if dtid.nil?
  # resource path
  local_var_path = "/devicemgmt/tasks".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'dtid'] = dtid
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'TaskListEnvelope')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DevicesManagementApi#get_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#query_properties(dtid, opts = {}) ⇒ MetadataQueryEnvelope

Query device properties across devices. Query device properties across devices.

Parameters:

  • dtid

    Device Type ID.

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

    the optional parameters

Options Hash (opts):

  • :count (Integer)

    Max results count.

  • :offset (Integer)

    Result starting offset.

  • :filter (String)

    Query filter. Comma-separated key&#x3D;value pairs

  • :include_timestamp (BOOLEAN)

    Include timestamp.

Returns:



590
591
592
593
# File 'lib/artikcloud/api/devices_management_api.rb', line 590

def query_properties(dtid, opts = {})
  data, _status_code, _headers = query_properties_with_http_info(dtid, opts)
  return data
end

#query_properties_with_http_info(dtid, opts = {}) ⇒ Array<(MetadataQueryEnvelope, Fixnum, Hash)>

Query device properties across devices. Query device properties across devices.

Parameters:

  • dtid

    Device Type ID.

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

    the optional parameters

Options Hash (opts):

  • :count (Integer)

    Max results count.

  • :offset (Integer)

    Result starting offset.

  • :filter (String)

    Query filter. Comma-separated key&#x3D;value pairs

  • :include_timestamp (BOOLEAN)

    Include timestamp.

Returns:

  • (Array<(MetadataQueryEnvelope, Fixnum, Hash)>)

    MetadataQueryEnvelope data, response status code and response headers



604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
# File 'lib/artikcloud/api/devices_management_api.rb', line 604

def query_properties_with_http_info(dtid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DevicesManagementApi.query_properties ..."
  end
  # verify the required parameter 'dtid' is set
  fail ArgumentError, "Missing the required parameter 'dtid' when calling DevicesManagementApi.query_properties" if dtid.nil?
  # resource path
  local_var_path = "/devicemgmt/devices/properties".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'dtid'] = dtid
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'includeTimestamp'] = opts[:'include_timestamp'] if !opts[:'include_timestamp'].nil?

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'MetadataQueryEnvelope')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DevicesManagementApi#query_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_device_types_info(dtid, device_type_info, opts = {}) ⇒ DeviceTypesInfoEnvelope

Updates a device type information Updates a device type information

Parameters:

  • dtid

    Device type ID.

  • device_type_info

    Device type info object to be set

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

    the optional parameters

Returns:



651
652
653
654
# File 'lib/artikcloud/api/devices_management_api.rb', line 651

def update_device_types_info(dtid, device_type_info, opts = {})
  data, _status_code, _headers = update_device_types_info_with_http_info(dtid, device_type_info, opts)
  return data
end

#update_device_types_info_with_http_info(dtid, device_type_info, opts = {}) ⇒ Array<(DeviceTypesInfoEnvelope, Fixnum, Hash)>

Updates a device type information Updates a device type information

Parameters:

  • dtid

    Device type ID.

  • device_type_info

    Device type info object to be set

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

    the optional parameters

Returns:

  • (Array<(DeviceTypesInfoEnvelope, Fixnum, Hash)>)

    DeviceTypesInfoEnvelope data, response status code and response headers



662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
# File 'lib/artikcloud/api/devices_management_api.rb', line 662

def update_device_types_info_with_http_info(dtid, device_type_info, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DevicesManagementApi.update_device_types_info ..."
  end
  # verify the required parameter 'dtid' is set
  fail ArgumentError, "Missing the required parameter 'dtid' when calling DevicesManagementApi.update_device_types_info" if dtid.nil?
  # verify the required parameter 'device_type_info' is set
  fail ArgumentError, "Missing the required parameter 'device_type_info' when calling DevicesManagementApi.update_device_types_info" if device_type_info.nil?
  # resource path
  local_var_path = "/devicemgmt/devicetypes/{dtid}".sub('{format}','json').sub('{' + 'dtid' + '}', dtid.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(device_type_info)
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DeviceTypesInfoEnvelope')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DevicesManagementApi#update_device_types_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_server_properties(did, device_properties, opts = {}) ⇒ MetadataEnvelope

Updates a device’s server properties. Updates a device’s server properties.

Parameters:

  • did

    Device ID.

  • device_properties

    Device properties object to be set

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

    the optional parameters

Returns:



706
707
708
709
# File 'lib/artikcloud/api/devices_management_api.rb', line 706

def update_server_properties(did, device_properties, opts = {})
  data, _status_code, _headers = update_server_properties_with_http_info(did, device_properties, opts)
  return data
end

#update_server_properties_with_http_info(did, device_properties, opts = {}) ⇒ Array<(MetadataEnvelope, Fixnum, Hash)>

Updates a device&#39;s server properties. Updates a device&#39;s server properties.

Parameters:

  • did

    Device ID.

  • device_properties

    Device properties object to be set

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

    the optional parameters

Returns:

  • (Array<(MetadataEnvelope, Fixnum, Hash)>)

    MetadataEnvelope data, response status code and response headers



717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
# File 'lib/artikcloud/api/devices_management_api.rb', line 717

def update_server_properties_with_http_info(did, device_properties, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DevicesManagementApi.update_server_properties ..."
  end
  # verify the required parameter 'did' is set
  fail ArgumentError, "Missing the required parameter 'did' when calling DevicesManagementApi.update_server_properties" if did.nil?
  # verify the required parameter 'device_properties' is set
  fail ArgumentError, "Missing the required parameter 'device_properties' when calling DevicesManagementApi.update_server_properties" if device_properties.nil?
  # resource path
  local_var_path = "/devicemgmt/devices/{did}/serverproperties".sub('{format}','json').sub('{' + 'did' + '}', did.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(device_properties)
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'MetadataEnvelope')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DevicesManagementApi#update_server_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_task(tid, task_update_request, opts = {}) ⇒ TaskUpdateResponse

Updates a task for all devices - For now just allows changing the state to cancelled. Updates a task for all devices - For now just allows changing the state to cancelled.

Parameters:

  • tid

    Task ID.

  • task_update_request

    Task update request

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

    the optional parameters

Returns:



761
762
763
764
# File 'lib/artikcloud/api/devices_management_api.rb', line 761

def update_task(tid, task_update_request, opts = {})
  data, _status_code, _headers = update_task_with_http_info(tid, task_update_request, opts)
  return data
end

#update_task_for_device(tid, did, device_task_update_request, opts = {}) ⇒ DeviceTaskUpdateResponse

Updates a task for a specific device - For now just allows changing the state to cancelled. Updates a task for a specific device - For now just allows changing the state to cancelled.

Parameters:

  • tid

    Task ID.

  • did

    Device ID.

  • device_task_update_request

    Device task update request

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

    the optional parameters

Returns:



817
818
819
820
# File 'lib/artikcloud/api/devices_management_api.rb', line 817

def update_task_for_device(tid, did, device_task_update_request, opts = {})
  data, _status_code, _headers = update_task_for_device_with_http_info(tid, did, device_task_update_request, opts)
  return data
end

#update_task_for_device_with_http_info(tid, did, device_task_update_request, opts = {}) ⇒ Array<(DeviceTaskUpdateResponse, Fixnum, Hash)>

Updates a task for a specific device - For now just allows changing the state to cancelled. Updates a task for a specific device - For now just allows changing the state to cancelled.

Parameters:

  • tid

    Task ID.

  • did

    Device ID.

  • device_task_update_request

    Device task update request

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

    the optional parameters

Returns:

  • (Array<(DeviceTaskUpdateResponse, Fixnum, Hash)>)

    DeviceTaskUpdateResponse data, response status code and response headers



829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
# File 'lib/artikcloud/api/devices_management_api.rb', line 829

def update_task_for_device_with_http_info(tid, did, device_task_update_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DevicesManagementApi.update_task_for_device ..."
  end
  # verify the required parameter 'tid' is set
  fail ArgumentError, "Missing the required parameter 'tid' when calling DevicesManagementApi.update_task_for_device" if tid.nil?
  # verify the required parameter 'did' is set
  fail ArgumentError, "Missing the required parameter 'did' when calling DevicesManagementApi.update_task_for_device" if did.nil?
  # verify the required parameter 'device_task_update_request' is set
  fail ArgumentError, "Missing the required parameter 'device_task_update_request' when calling DevicesManagementApi.update_task_for_device" if device_task_update_request.nil?
  # resource path
  local_var_path = "/devicemgmt/tasks/{tid}/devices/{did}".sub('{format}','json').sub('{' + 'tid' + '}', tid.to_s).sub('{' + 'did' + '}', did.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(device_task_update_request)
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DeviceTaskUpdateResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DevicesManagementApi#update_task_for_device\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_task_with_http_info(tid, task_update_request, opts = {}) ⇒ Array<(TaskUpdateResponse, Fixnum, Hash)>

Updates a task for all devices - For now just allows changing the state to cancelled. Updates a task for all devices - For now just allows changing the state to cancelled.

Parameters:

  • tid

    Task ID.

  • task_update_request

    Task update request

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

    the optional parameters

Returns:

  • (Array<(TaskUpdateResponse, Fixnum, Hash)>)

    TaskUpdateResponse data, response status code and response headers



772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
# File 'lib/artikcloud/api/devices_management_api.rb', line 772

def update_task_with_http_info(tid, task_update_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: DevicesManagementApi.update_task ..."
  end
  # verify the required parameter 'tid' is set
  fail ArgumentError, "Missing the required parameter 'tid' when calling DevicesManagementApi.update_task" if tid.nil?
  # verify the required parameter 'task_update_request' is set
  fail ArgumentError, "Missing the required parameter 'task_update_request' when calling DevicesManagementApi.update_task" if task_update_request.nil?
  # resource path
  local_var_path = "/devicemgmt/tasks/{tid}".sub('{format}','json').sub('{' + 'tid' + '}', tid.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(task_update_request)
  auth_names = ['artikcloud_oauth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'TaskUpdateResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DevicesManagementApi#update_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end