artikcloud 2.0.5 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +23 -1
- data/LICENSE +1 -2
- data/README.md +50 -4
- data/artikcloud.gemspec +29 -5
- data/docs/DeviceTask.md +13 -0
- data/docs/DeviceTaskUpdateRequest.md +8 -0
- data/docs/DeviceTaskUpdateResponse.md +8 -0
- data/docs/DeviceTypeInfo.md +14 -0
- data/docs/DeviceTypeInfoEnvelope.md +8 -0
- data/docs/DeviceTypesApi.md +61 -0
- data/docs/DeviceTypesInfo.md +14 -0
- data/docs/DeviceTypesInfoEnvelope.md +8 -0
- data/docs/DevicesManagementApi.md +870 -0
- data/docs/EventFeedData.md +10 -0
- data/docs/MetadataEnvelope.md +8 -0
- data/docs/MetadataPropertiesEnvelope.md +8 -0
- data/docs/MetadataQueryEnvelope.md +11 -0
- data/docs/MetadataRequest.md +7 -0
- data/docs/Task.md +18 -0
- data/docs/TaskByDid.md +19 -0
- data/docs/TaskByDidList.md +8 -0
- data/docs/TaskByDidListEnvelope.md +11 -0
- data/docs/TaskEnvelope.md +8 -0
- data/docs/TaskHistory.md +13 -0
- data/docs/TaskHistoryList.md +8 -0
- data/docs/TaskList.md +8 -0
- data/docs/TaskListEnvelope.md +12 -0
- data/docs/TaskParameters.md +9 -0
- data/docs/TaskRequest.md +13 -0
- data/docs/TaskStatus.md +13 -0
- data/docs/TaskStatusCounts.md +12 -0
- data/docs/TaskStatuses.md +19 -0
- data/docs/TaskStatusesEnvelope.md +11 -0
- data/docs/TaskStatusesHistoryEnvelope.md +8 -0
- data/docs/TaskUpdateRequest.md +8 -0
- data/docs/TaskUpdateResponse.md +8 -0
- data/docs/TasksStatusCounts.md +11 -0
- data/lib/artikcloud/api/device_types_api.rb +66 -0
- data/lib/artikcloud/api/devices_management_api.rb +971 -0
- data/lib/artikcloud/models/device_task.rb +250 -0
- data/lib/artikcloud/models/device_task_update_request.rb +200 -0
- data/lib/artikcloud/models/device_task_update_response.rb +200 -0
- data/lib/artikcloud/models/device_type_info.rb +260 -0
- data/lib/artikcloud/models/device_type_info_envelope.rb +199 -0
- data/lib/artikcloud/models/device_types_info.rb +260 -0
- data/lib/artikcloud/models/device_types_info_envelope.rb +199 -0
- data/lib/artikcloud/models/event_feed_data.rb +222 -0
- data/lib/artikcloud/models/metadata_envelope.rb +202 -0
- data/lib/artikcloud/models/metadata_properties_envelope.rb +201 -0
- data/lib/artikcloud/models/metadata_query_envelope.rb +232 -0
- data/lib/artikcloud/models/metadata_request.rb +190 -0
- data/lib/artikcloud/models/task.rb +302 -0
- data/lib/artikcloud/models/task_by_did.rb +314 -0
- data/lib/artikcloud/models/task_by_did_list.rb +202 -0
- data/lib/artikcloud/models/task_by_did_list_envelope.rb +230 -0
- data/lib/artikcloud/models/task_envelope.rb +200 -0
- data/lib/artikcloud/models/task_history.rb +250 -0
- data/lib/artikcloud/models/task_history_list.rb +202 -0
- data/lib/artikcloud/models/task_list.rb +202 -0
- data/lib/artikcloud/models/task_list_envelope.rb +240 -0
- data/lib/artikcloud/models/task_parameters.rb +210 -0
- data/lib/artikcloud/models/task_request.rb +252 -0
- data/lib/artikcloud/models/task_status.rb +250 -0
- data/lib/artikcloud/models/task_status_counts.rb +240 -0
- data/lib/artikcloud/models/task_statuses.rb +314 -0
- data/lib/artikcloud/models/task_statuses_envelope.rb +230 -0
- data/lib/artikcloud/models/task_statuses_history_envelope.rb +200 -0
- data/lib/artikcloud/models/task_update_request.rb +200 -0
- data/lib/artikcloud/models/task_update_response.rb +200 -0
- data/lib/artikcloud/models/tasks_status_counts.rb +230 -0
- data/lib/artikcloud/version.rb +1 -1
- data/lib/artikcloud.rb +31 -0
- data/pom.xml +1 -1
- data/spec/api/devices_api_spec.rb +7 -10
- data/spec/api/devices_management_api_spec.rb +251 -0
- data/spec/api/messages_api_spec.rb +67 -25
- data/spec/api/tokens_api_spec.rb +10 -33
- data/spec/api/users_api_spec.rb +65 -14
- data/spec/api_client_spec.rb +237 -0
- data/spec/configuration_spec.rb +53 -0
- data/spec/factories/devices.rb +32 -0
- data/spec/factories/users.rb +31 -0
- data/spec/fixtures/cassettes/DevicesApi/get_device_presence_test/should_work.yml +50 -0
- data/spec/fixtures/cassettes/MessagesApi/get_message_snapshots/should_work.yml +54 -0
- data/spec/fixtures/cassettes/MessagesApi/send_actions/should_work.yml +93 -0
- data/spec/fixtures/cassettes/MessagesApi/send_message_action_test/should_work.yml +99 -0
- data/spec/fixtures/cassettes/TokensApi/refresh_token_test/should_work.yml +43 -0
- data/spec/fixtures/cassettes/TokensApi/token_info_test/should_work.yml +38 -0
- data/spec/fixtures/cassettes/UsersApi/get_self_test/should_work.yml +53 -0
- data/spec/fixtures/cassettes/UsersApi/get_user_device_types_test/should_work.yml +55 -0
- data/spec/fixtures/cassettes/UsersApi/get_user_devices_test/should_work.yml +55 -0
- data/spec/fixtures/cassettes/UsersApi/get_user_properties_update_user_properties_and_delete_user_properties_test/should_work.yml +52 -0
- data/spec/fixtures/cassettes/UsersApi/get_user_rules_test/should_work.yml +58 -0
- data/spec/spec_helper.rb +20 -5
- metadata +142 -46
|
@@ -0,0 +1,971 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#ARTIK Cloud API
|
|
3
|
+
|
|
4
|
+
#No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 2.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
|
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
you may not use this file except in compliance with the License.
|
|
12
|
+
You may obtain a copy of the License at
|
|
13
|
+
|
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
|
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
See the License for the specific language governing permissions and
|
|
20
|
+
limitations under the License.
|
|
21
|
+
|
|
22
|
+
=end
|
|
23
|
+
|
|
24
|
+
require "uri"
|
|
25
|
+
|
|
26
|
+
module ArtikCloud
|
|
27
|
+
class DevicesManagementApi
|
|
28
|
+
attr_accessor :api_client
|
|
29
|
+
|
|
30
|
+
def initialize(api_client = ApiClient.default)
|
|
31
|
+
@api_client = api_client
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Create a new task for one or more devices
|
|
35
|
+
# Create a new task for one or more devices
|
|
36
|
+
# @param task_payload Task object to be created
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @return [TaskEnvelope]
|
|
39
|
+
def create_tasks(task_payload, opts = {})
|
|
40
|
+
data, _status_code, _headers = create_tasks_with_http_info(task_payload, opts)
|
|
41
|
+
return data
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Create a new task for one or more devices
|
|
45
|
+
# Create a new task for one or more devices
|
|
46
|
+
# @param task_payload Task object to be created
|
|
47
|
+
# @param [Hash] opts the optional parameters
|
|
48
|
+
# @return [Array<(TaskEnvelope, Fixnum, Hash)>] TaskEnvelope data, response status code and response headers
|
|
49
|
+
def create_tasks_with_http_info(task_payload, opts = {})
|
|
50
|
+
if @api_client.config.debugging
|
|
51
|
+
@api_client.config.logger.debug "Calling API: DevicesManagementApi.create_tasks ..."
|
|
52
|
+
end
|
|
53
|
+
# verify the required parameter 'task_payload' is set
|
|
54
|
+
fail ArgumentError, "Missing the required parameter 'task_payload' when calling DevicesManagementApi.create_tasks" if task_payload.nil?
|
|
55
|
+
# resource path
|
|
56
|
+
local_var_path = "/devicemgmt/tasks".sub('{format}','json')
|
|
57
|
+
|
|
58
|
+
# query parameters
|
|
59
|
+
query_params = {}
|
|
60
|
+
|
|
61
|
+
# header parameters
|
|
62
|
+
header_params = {}
|
|
63
|
+
|
|
64
|
+
# HTTP header 'Accept' (if needed)
|
|
65
|
+
local_header_accept = ['application/json']
|
|
66
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
|
67
|
+
|
|
68
|
+
# HTTP header 'Content-Type'
|
|
69
|
+
local_header_content_type = []
|
|
70
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
|
71
|
+
|
|
72
|
+
# form parameters
|
|
73
|
+
form_params = {}
|
|
74
|
+
|
|
75
|
+
# http body (model)
|
|
76
|
+
post_body = @api_client.object_to_http_body(task_payload)
|
|
77
|
+
auth_names = ['artikcloud_oauth']
|
|
78
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
79
|
+
:header_params => header_params,
|
|
80
|
+
:query_params => query_params,
|
|
81
|
+
:form_params => form_params,
|
|
82
|
+
:body => post_body,
|
|
83
|
+
:auth_names => auth_names,
|
|
84
|
+
:return_type => 'TaskEnvelope')
|
|
85
|
+
if @api_client.config.debugging
|
|
86
|
+
@api_client.config.logger.debug "API called: DevicesManagementApi#create_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
87
|
+
end
|
|
88
|
+
return data, status_code, headers
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Deletes a device's properties.
|
|
92
|
+
# Deletes a device's properties.
|
|
93
|
+
# @param did Device ID.
|
|
94
|
+
# @param [Hash] opts the optional parameters
|
|
95
|
+
# @return [MetadataEnvelope]
|
|
96
|
+
def delete_server_properties(did, opts = {})
|
|
97
|
+
data, _status_code, _headers = delete_server_properties_with_http_info(did, opts)
|
|
98
|
+
return data
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Deletes a device's properties.
|
|
102
|
+
# Deletes a device's properties.
|
|
103
|
+
# @param did Device ID.
|
|
104
|
+
# @param [Hash] opts the optional parameters
|
|
105
|
+
# @return [Array<(MetadataEnvelope, Fixnum, Hash)>] MetadataEnvelope data, response status code and response headers
|
|
106
|
+
def delete_server_properties_with_http_info(did, opts = {})
|
|
107
|
+
if @api_client.config.debugging
|
|
108
|
+
@api_client.config.logger.debug "Calling API: DevicesManagementApi.delete_server_properties ..."
|
|
109
|
+
end
|
|
110
|
+
# verify the required parameter 'did' is set
|
|
111
|
+
fail ArgumentError, "Missing the required parameter 'did' when calling DevicesManagementApi.delete_server_properties" if did.nil?
|
|
112
|
+
# resource path
|
|
113
|
+
local_var_path = "/devicemgmt/devices/{did}/serverproperties".sub('{format}','json').sub('{' + 'did' + '}', did.to_s)
|
|
114
|
+
|
|
115
|
+
# query parameters
|
|
116
|
+
query_params = {}
|
|
117
|
+
|
|
118
|
+
# header parameters
|
|
119
|
+
header_params = {}
|
|
120
|
+
|
|
121
|
+
# HTTP header 'Accept' (if needed)
|
|
122
|
+
local_header_accept = ['application/json']
|
|
123
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
|
124
|
+
|
|
125
|
+
# HTTP header 'Content-Type'
|
|
126
|
+
local_header_content_type = []
|
|
127
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
|
128
|
+
|
|
129
|
+
# form parameters
|
|
130
|
+
form_params = {}
|
|
131
|
+
|
|
132
|
+
# http body (model)
|
|
133
|
+
post_body = nil
|
|
134
|
+
auth_names = ['artikcloud_oauth']
|
|
135
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
|
136
|
+
:header_params => header_params,
|
|
137
|
+
:query_params => query_params,
|
|
138
|
+
:form_params => form_params,
|
|
139
|
+
:body => post_body,
|
|
140
|
+
:auth_names => auth_names,
|
|
141
|
+
:return_type => 'MetadataEnvelope')
|
|
142
|
+
if @api_client.config.debugging
|
|
143
|
+
@api_client.config.logger.debug "API called: DevicesManagementApi#delete_server_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
144
|
+
end
|
|
145
|
+
return data, status_code, headers
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Returns the list of tasks for a particular device id with optional status filter.
|
|
149
|
+
# Returns the list of tasks for a particular device id with optional status filter.
|
|
150
|
+
# @param did Device ID.
|
|
151
|
+
# @param [Hash] opts the optional parameters
|
|
152
|
+
# @option opts [Integer] :count Max results count.
|
|
153
|
+
# @option opts [Integer] :offset Result starting offset.
|
|
154
|
+
# @option opts [String] :status Status filter. Comma-separated statuses.
|
|
155
|
+
# @option opts [String] :order Sort results by a field. Valid fields: createdOn.
|
|
156
|
+
# @option opts [String] :sort Sort order. Valid values: asc or desc.
|
|
157
|
+
# @return [TaskByDidListEnvelope]
|
|
158
|
+
def get_all_by_did(did, opts = {})
|
|
159
|
+
data, _status_code, _headers = get_all_by_did_with_http_info(did, opts)
|
|
160
|
+
return data
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Returns the list of tasks for a particular device id with optional status filter.
|
|
164
|
+
# Returns the list of tasks for a particular device id with optional status filter.
|
|
165
|
+
# @param did Device ID.
|
|
166
|
+
# @param [Hash] opts the optional parameters
|
|
167
|
+
# @option opts [Integer] :count Max results count.
|
|
168
|
+
# @option opts [Integer] :offset Result starting offset.
|
|
169
|
+
# @option opts [String] :status Status filter. Comma-separated statuses.
|
|
170
|
+
# @option opts [String] :order Sort results by a field. Valid fields: createdOn.
|
|
171
|
+
# @option opts [String] :sort Sort order. Valid values: asc or desc.
|
|
172
|
+
# @return [Array<(TaskByDidListEnvelope, Fixnum, Hash)>] TaskByDidListEnvelope data, response status code and response headers
|
|
173
|
+
def get_all_by_did_with_http_info(did, opts = {})
|
|
174
|
+
if @api_client.config.debugging
|
|
175
|
+
@api_client.config.logger.debug "Calling API: DevicesManagementApi.get_all_by_did ..."
|
|
176
|
+
end
|
|
177
|
+
# verify the required parameter 'did' is set
|
|
178
|
+
fail ArgumentError, "Missing the required parameter 'did' when calling DevicesManagementApi.get_all_by_did" if did.nil?
|
|
179
|
+
# resource path
|
|
180
|
+
local_var_path = "/devicemgmt/devices/{did}/tasks".sub('{format}','json').sub('{' + 'did' + '}', did.to_s)
|
|
181
|
+
|
|
182
|
+
# query parameters
|
|
183
|
+
query_params = {}
|
|
184
|
+
query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
|
|
185
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
186
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
|
187
|
+
query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
|
|
188
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
189
|
+
|
|
190
|
+
# header parameters
|
|
191
|
+
header_params = {}
|
|
192
|
+
|
|
193
|
+
# HTTP header 'Accept' (if needed)
|
|
194
|
+
local_header_accept = ['application/json']
|
|
195
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
|
196
|
+
|
|
197
|
+
# HTTP header 'Content-Type'
|
|
198
|
+
local_header_content_type = []
|
|
199
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
|
200
|
+
|
|
201
|
+
# form parameters
|
|
202
|
+
form_params = {}
|
|
203
|
+
|
|
204
|
+
# http body (model)
|
|
205
|
+
post_body = nil
|
|
206
|
+
auth_names = ['artikcloud_oauth']
|
|
207
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
208
|
+
:header_params => header_params,
|
|
209
|
+
:query_params => query_params,
|
|
210
|
+
:form_params => form_params,
|
|
211
|
+
:body => post_body,
|
|
212
|
+
:auth_names => auth_names,
|
|
213
|
+
:return_type => 'TaskByDidListEnvelope')
|
|
214
|
+
if @api_client.config.debugging
|
|
215
|
+
@api_client.config.logger.debug "API called: DevicesManagementApi#get_all_by_did\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
216
|
+
end
|
|
217
|
+
return data, status_code, headers
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Read a device type device management information.
|
|
221
|
+
# Read a device type device management information.
|
|
222
|
+
# @param dtid Device type ID.
|
|
223
|
+
# @param [Hash] opts the optional parameters
|
|
224
|
+
# @return [DeviceTypesInfoEnvelope]
|
|
225
|
+
def get_device_types_info(dtid, opts = {})
|
|
226
|
+
data, _status_code, _headers = get_device_types_info_with_http_info(dtid, opts)
|
|
227
|
+
return data
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# Read a device type device management information.
|
|
231
|
+
# Read a device type device management information.
|
|
232
|
+
# @param dtid Device type ID.
|
|
233
|
+
# @param [Hash] opts the optional parameters
|
|
234
|
+
# @return [Array<(DeviceTypesInfoEnvelope, Fixnum, Hash)>] DeviceTypesInfoEnvelope data, response status code and response headers
|
|
235
|
+
def get_device_types_info_with_http_info(dtid, opts = {})
|
|
236
|
+
if @api_client.config.debugging
|
|
237
|
+
@api_client.config.logger.debug "Calling API: DevicesManagementApi.get_device_types_info ..."
|
|
238
|
+
end
|
|
239
|
+
# verify the required parameter 'dtid' is set
|
|
240
|
+
fail ArgumentError, "Missing the required parameter 'dtid' when calling DevicesManagementApi.get_device_types_info" if dtid.nil?
|
|
241
|
+
# resource path
|
|
242
|
+
local_var_path = "/devicemgmt/devicetypes/{dtid}".sub('{format}','json').sub('{' + 'dtid' + '}', dtid.to_s)
|
|
243
|
+
|
|
244
|
+
# query parameters
|
|
245
|
+
query_params = {}
|
|
246
|
+
|
|
247
|
+
# header parameters
|
|
248
|
+
header_params = {}
|
|
249
|
+
|
|
250
|
+
# HTTP header 'Accept' (if needed)
|
|
251
|
+
local_header_accept = ['application/json']
|
|
252
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
|
253
|
+
|
|
254
|
+
# HTTP header 'Content-Type'
|
|
255
|
+
local_header_content_type = []
|
|
256
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
|
257
|
+
|
|
258
|
+
# form parameters
|
|
259
|
+
form_params = {}
|
|
260
|
+
|
|
261
|
+
# http body (model)
|
|
262
|
+
post_body = nil
|
|
263
|
+
auth_names = ['artikcloud_oauth']
|
|
264
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
265
|
+
:header_params => header_params,
|
|
266
|
+
:query_params => query_params,
|
|
267
|
+
:form_params => form_params,
|
|
268
|
+
:body => post_body,
|
|
269
|
+
:auth_names => auth_names,
|
|
270
|
+
:return_type => 'DeviceTypesInfoEnvelope')
|
|
271
|
+
if @api_client.config.debugging
|
|
272
|
+
@api_client.config.logger.debug "API called: DevicesManagementApi#get_device_types_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
273
|
+
end
|
|
274
|
+
return data, status_code, headers
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# Get a device type's device management manifest properties
|
|
278
|
+
# Get a device type's device management manifest properties
|
|
279
|
+
# @param dtid Device Type ID.
|
|
280
|
+
# @param [Hash] opts the optional parameters
|
|
281
|
+
# @return [MetadataPropertiesEnvelope]
|
|
282
|
+
def get_manifest_properties(dtid, opts = {})
|
|
283
|
+
data, _status_code, _headers = get_manifest_properties_with_http_info(dtid, opts)
|
|
284
|
+
return data
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
# Get a device type's device management manifest properties
|
|
288
|
+
# Get a device type's device management manifest properties
|
|
289
|
+
# @param dtid Device Type ID.
|
|
290
|
+
# @param [Hash] opts the optional parameters
|
|
291
|
+
# @return [Array<(MetadataPropertiesEnvelope, Fixnum, Hash)>] MetadataPropertiesEnvelope data, response status code and response headers
|
|
292
|
+
def get_manifest_properties_with_http_info(dtid, opts = {})
|
|
293
|
+
if @api_client.config.debugging
|
|
294
|
+
@api_client.config.logger.debug "Calling API: DevicesManagementApi.get_manifest_properties ..."
|
|
295
|
+
end
|
|
296
|
+
# verify the required parameter 'dtid' is set
|
|
297
|
+
fail ArgumentError, "Missing the required parameter 'dtid' when calling DevicesManagementApi.get_manifest_properties" if dtid.nil?
|
|
298
|
+
# resource path
|
|
299
|
+
local_var_path = "/devicemgmt/devicetypes/{dtid}/manifest/properties".sub('{format}','json').sub('{' + 'dtid' + '}', dtid.to_s)
|
|
300
|
+
|
|
301
|
+
# query parameters
|
|
302
|
+
query_params = {}
|
|
303
|
+
|
|
304
|
+
# header parameters
|
|
305
|
+
header_params = {}
|
|
306
|
+
|
|
307
|
+
# HTTP header 'Accept' (if needed)
|
|
308
|
+
local_header_accept = ['application/json']
|
|
309
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
|
310
|
+
|
|
311
|
+
# HTTP header 'Content-Type'
|
|
312
|
+
local_header_content_type = []
|
|
313
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
|
314
|
+
|
|
315
|
+
# form parameters
|
|
316
|
+
form_params = {}
|
|
317
|
+
|
|
318
|
+
# http body (model)
|
|
319
|
+
post_body = nil
|
|
320
|
+
auth_names = ['artikcloud_oauth']
|
|
321
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
322
|
+
:header_params => header_params,
|
|
323
|
+
:query_params => query_params,
|
|
324
|
+
:form_params => form_params,
|
|
325
|
+
:body => post_body,
|
|
326
|
+
:auth_names => auth_names,
|
|
327
|
+
:return_type => 'MetadataPropertiesEnvelope')
|
|
328
|
+
if @api_client.config.debugging
|
|
329
|
+
@api_client.config.logger.debug "API called: DevicesManagementApi#get_manifest_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
330
|
+
end
|
|
331
|
+
return data, status_code, headers
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
# Read a device's properties.
|
|
335
|
+
# Read a device's properties.
|
|
336
|
+
# @param did Device ID.
|
|
337
|
+
# @param [Hash] opts the optional parameters
|
|
338
|
+
# @option opts [BOOLEAN] :include_timestamp Include timestamp.
|
|
339
|
+
# @return [MetadataEnvelope]
|
|
340
|
+
def get_properties(did, opts = {})
|
|
341
|
+
data, _status_code, _headers = get_properties_with_http_info(did, opts)
|
|
342
|
+
return data
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
# Read a device's properties.
|
|
346
|
+
# Read a device's properties.
|
|
347
|
+
# @param did Device ID.
|
|
348
|
+
# @param [Hash] opts the optional parameters
|
|
349
|
+
# @option opts [BOOLEAN] :include_timestamp Include timestamp.
|
|
350
|
+
# @return [Array<(MetadataEnvelope, Fixnum, Hash)>] MetadataEnvelope data, response status code and response headers
|
|
351
|
+
def get_properties_with_http_info(did, opts = {})
|
|
352
|
+
if @api_client.config.debugging
|
|
353
|
+
@api_client.config.logger.debug "Calling API: DevicesManagementApi.get_properties ..."
|
|
354
|
+
end
|
|
355
|
+
# verify the required parameter 'did' is set
|
|
356
|
+
fail ArgumentError, "Missing the required parameter 'did' when calling DevicesManagementApi.get_properties" if did.nil?
|
|
357
|
+
# resource path
|
|
358
|
+
local_var_path = "/devicemgmt/devices/{did}/properties".sub('{format}','json').sub('{' + 'did' + '}', did.to_s)
|
|
359
|
+
|
|
360
|
+
# query parameters
|
|
361
|
+
query_params = {}
|
|
362
|
+
query_params[:'includeTimestamp'] = opts[:'include_timestamp'] if !opts[:'include_timestamp'].nil?
|
|
363
|
+
|
|
364
|
+
# header parameters
|
|
365
|
+
header_params = {}
|
|
366
|
+
|
|
367
|
+
# HTTP header 'Accept' (if needed)
|
|
368
|
+
local_header_accept = ['application/json']
|
|
369
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
|
370
|
+
|
|
371
|
+
# HTTP header 'Content-Type'
|
|
372
|
+
local_header_content_type = []
|
|
373
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
|
374
|
+
|
|
375
|
+
# form parameters
|
|
376
|
+
form_params = {}
|
|
377
|
+
|
|
378
|
+
# http body (model)
|
|
379
|
+
post_body = nil
|
|
380
|
+
auth_names = ['artikcloud_oauth']
|
|
381
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
382
|
+
:header_params => header_params,
|
|
383
|
+
:query_params => query_params,
|
|
384
|
+
:form_params => form_params,
|
|
385
|
+
:body => post_body,
|
|
386
|
+
:auth_names => auth_names,
|
|
387
|
+
:return_type => 'MetadataEnvelope')
|
|
388
|
+
if @api_client.config.debugging
|
|
389
|
+
@api_client.config.logger.debug "API called: DevicesManagementApi#get_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
390
|
+
end
|
|
391
|
+
return data, status_code, headers
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
# Returns the details and status of a task id and the individual statuses of each device id in the list.
|
|
395
|
+
# Returns the details and status of a task id and the individual statuses of each device id in the list.
|
|
396
|
+
# @param tid Task ID.
|
|
397
|
+
# @param [Hash] opts the optional parameters
|
|
398
|
+
# @option opts [Integer] :count Max results count.
|
|
399
|
+
# @option opts [Integer] :offset Result starting offset.
|
|
400
|
+
# @option opts [String] :status Status filter. Comma-separated statuses.
|
|
401
|
+
# @option opts [String] :dids Devices filter. Comma-separated device IDs.
|
|
402
|
+
# @return [TaskStatusesEnvelope]
|
|
403
|
+
def get_statuses(tid, opts = {})
|
|
404
|
+
data, _status_code, _headers = get_statuses_with_http_info(tid, opts)
|
|
405
|
+
return data
|
|
406
|
+
end
|
|
407
|
+
|
|
408
|
+
# Returns the details and status of a task id and the individual statuses of each device id in the list.
|
|
409
|
+
# Returns the details and status of a task id and the individual statuses of each device id in the list.
|
|
410
|
+
# @param tid Task ID.
|
|
411
|
+
# @param [Hash] opts the optional parameters
|
|
412
|
+
# @option opts [Integer] :count Max results count.
|
|
413
|
+
# @option opts [Integer] :offset Result starting offset.
|
|
414
|
+
# @option opts [String] :status Status filter. Comma-separated statuses.
|
|
415
|
+
# @option opts [String] :dids Devices filter. Comma-separated device IDs.
|
|
416
|
+
# @return [Array<(TaskStatusesEnvelope, Fixnum, Hash)>] TaskStatusesEnvelope data, response status code and response headers
|
|
417
|
+
def get_statuses_with_http_info(tid, opts = {})
|
|
418
|
+
if @api_client.config.debugging
|
|
419
|
+
@api_client.config.logger.debug "Calling API: DevicesManagementApi.get_statuses ..."
|
|
420
|
+
end
|
|
421
|
+
# verify the required parameter 'tid' is set
|
|
422
|
+
fail ArgumentError, "Missing the required parameter 'tid' when calling DevicesManagementApi.get_statuses" if tid.nil?
|
|
423
|
+
# resource path
|
|
424
|
+
local_var_path = "/devicemgmt/tasks/{tid}/statuses".sub('{format}','json').sub('{' + 'tid' + '}', tid.to_s)
|
|
425
|
+
|
|
426
|
+
# query parameters
|
|
427
|
+
query_params = {}
|
|
428
|
+
query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
|
|
429
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
430
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
|
431
|
+
query_params[:'dids'] = opts[:'dids'] if !opts[:'dids'].nil?
|
|
432
|
+
|
|
433
|
+
# header parameters
|
|
434
|
+
header_params = {}
|
|
435
|
+
|
|
436
|
+
# HTTP header 'Accept' (if needed)
|
|
437
|
+
local_header_accept = ['application/json']
|
|
438
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
|
439
|
+
|
|
440
|
+
# HTTP header 'Content-Type'
|
|
441
|
+
local_header_content_type = []
|
|
442
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
|
443
|
+
|
|
444
|
+
# form parameters
|
|
445
|
+
form_params = {}
|
|
446
|
+
|
|
447
|
+
# http body (model)
|
|
448
|
+
post_body = nil
|
|
449
|
+
auth_names = ['artikcloud_oauth']
|
|
450
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
451
|
+
:header_params => header_params,
|
|
452
|
+
:query_params => query_params,
|
|
453
|
+
:form_params => form_params,
|
|
454
|
+
:body => post_body,
|
|
455
|
+
:auth_names => auth_names,
|
|
456
|
+
:return_type => 'TaskStatusesEnvelope')
|
|
457
|
+
if @api_client.config.debugging
|
|
458
|
+
@api_client.config.logger.debug "API called: DevicesManagementApi#get_statuses\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
459
|
+
end
|
|
460
|
+
return data, status_code, headers
|
|
461
|
+
end
|
|
462
|
+
|
|
463
|
+
# Returns the history of the status changes for a specific task id, or for a specific device id in that task.
|
|
464
|
+
# Returns the history of the status changes for a specific task id, or for a specific device id in that task.
|
|
465
|
+
# @param tid Task ID.
|
|
466
|
+
# @param [Hash] opts the optional parameters
|
|
467
|
+
# @option opts [String] :did Device ID. Optional.
|
|
468
|
+
# @return [TaskStatusesHistoryEnvelope]
|
|
469
|
+
def get_statuses_history(tid, opts = {})
|
|
470
|
+
data, _status_code, _headers = get_statuses_history_with_http_info(tid, opts)
|
|
471
|
+
return data
|
|
472
|
+
end
|
|
473
|
+
|
|
474
|
+
# Returns the history of the status changes for a specific task id, or for a specific device id in that task.
|
|
475
|
+
# Returns the history of the status changes for a specific task id, or for a specific device id in that task.
|
|
476
|
+
# @param tid Task ID.
|
|
477
|
+
# @param [Hash] opts the optional parameters
|
|
478
|
+
# @option opts [String] :did Device ID. Optional.
|
|
479
|
+
# @return [Array<(TaskStatusesHistoryEnvelope, Fixnum, Hash)>] TaskStatusesHistoryEnvelope data, response status code and response headers
|
|
480
|
+
def get_statuses_history_with_http_info(tid, opts = {})
|
|
481
|
+
if @api_client.config.debugging
|
|
482
|
+
@api_client.config.logger.debug "Calling API: DevicesManagementApi.get_statuses_history ..."
|
|
483
|
+
end
|
|
484
|
+
# verify the required parameter 'tid' is set
|
|
485
|
+
fail ArgumentError, "Missing the required parameter 'tid' when calling DevicesManagementApi.get_statuses_history" if tid.nil?
|
|
486
|
+
# resource path
|
|
487
|
+
local_var_path = "/devicemgmt/tasks/{tid}/statuses/history".sub('{format}','json').sub('{' + 'tid' + '}', tid.to_s)
|
|
488
|
+
|
|
489
|
+
# query parameters
|
|
490
|
+
query_params = {}
|
|
491
|
+
query_params[:'did'] = opts[:'did'] if !opts[:'did'].nil?
|
|
492
|
+
|
|
493
|
+
# header parameters
|
|
494
|
+
header_params = {}
|
|
495
|
+
|
|
496
|
+
# HTTP header 'Accept' (if needed)
|
|
497
|
+
local_header_accept = ['application/json']
|
|
498
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
|
499
|
+
|
|
500
|
+
# HTTP header 'Content-Type'
|
|
501
|
+
local_header_content_type = []
|
|
502
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
|
503
|
+
|
|
504
|
+
# form parameters
|
|
505
|
+
form_params = {}
|
|
506
|
+
|
|
507
|
+
# http body (model)
|
|
508
|
+
post_body = nil
|
|
509
|
+
auth_names = ['artikcloud_oauth']
|
|
510
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
511
|
+
:header_params => header_params,
|
|
512
|
+
:query_params => query_params,
|
|
513
|
+
:form_params => form_params,
|
|
514
|
+
:body => post_body,
|
|
515
|
+
:auth_names => auth_names,
|
|
516
|
+
:return_type => 'TaskStatusesHistoryEnvelope')
|
|
517
|
+
if @api_client.config.debugging
|
|
518
|
+
@api_client.config.logger.debug "API called: DevicesManagementApi#get_statuses_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
519
|
+
end
|
|
520
|
+
return data, status_code, headers
|
|
521
|
+
end
|
|
522
|
+
|
|
523
|
+
# Returns the details and global status of a specific task id.
|
|
524
|
+
# Returns the details and global status of a specific task id.
|
|
525
|
+
# @param tid Task ID.
|
|
526
|
+
# @param [Hash] opts the optional parameters
|
|
527
|
+
# @return [TaskEnvelope]
|
|
528
|
+
def get_task_by_id(tid, opts = {})
|
|
529
|
+
data, _status_code, _headers = get_task_by_id_with_http_info(tid, opts)
|
|
530
|
+
return data
|
|
531
|
+
end
|
|
532
|
+
|
|
533
|
+
# Returns the details and global status of a specific task id.
|
|
534
|
+
# Returns the details and global status of a specific task id.
|
|
535
|
+
# @param tid Task ID.
|
|
536
|
+
# @param [Hash] opts the optional parameters
|
|
537
|
+
# @return [Array<(TaskEnvelope, Fixnum, Hash)>] TaskEnvelope data, response status code and response headers
|
|
538
|
+
def get_task_by_id_with_http_info(tid, opts = {})
|
|
539
|
+
if @api_client.config.debugging
|
|
540
|
+
@api_client.config.logger.debug "Calling API: DevicesManagementApi.get_task_by_id ..."
|
|
541
|
+
end
|
|
542
|
+
# verify the required parameter 'tid' is set
|
|
543
|
+
fail ArgumentError, "Missing the required parameter 'tid' when calling DevicesManagementApi.get_task_by_id" if tid.nil?
|
|
544
|
+
# resource path
|
|
545
|
+
local_var_path = "/devicemgmt/tasks/{tid}".sub('{format}','json').sub('{' + 'tid' + '}', tid.to_s)
|
|
546
|
+
|
|
547
|
+
# query parameters
|
|
548
|
+
query_params = {}
|
|
549
|
+
|
|
550
|
+
# header parameters
|
|
551
|
+
header_params = {}
|
|
552
|
+
|
|
553
|
+
# HTTP header 'Accept' (if needed)
|
|
554
|
+
local_header_accept = ['application/json']
|
|
555
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
|
556
|
+
|
|
557
|
+
# HTTP header 'Content-Type'
|
|
558
|
+
local_header_content_type = []
|
|
559
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
|
560
|
+
|
|
561
|
+
# form parameters
|
|
562
|
+
form_params = {}
|
|
563
|
+
|
|
564
|
+
# http body (model)
|
|
565
|
+
post_body = nil
|
|
566
|
+
auth_names = ['artikcloud_oauth']
|
|
567
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
568
|
+
:header_params => header_params,
|
|
569
|
+
:query_params => query_params,
|
|
570
|
+
:form_params => form_params,
|
|
571
|
+
:body => post_body,
|
|
572
|
+
:auth_names => auth_names,
|
|
573
|
+
:return_type => 'TaskEnvelope')
|
|
574
|
+
if @api_client.config.debugging
|
|
575
|
+
@api_client.config.logger.debug "API called: DevicesManagementApi#get_task_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
576
|
+
end
|
|
577
|
+
return data, status_code, headers
|
|
578
|
+
end
|
|
579
|
+
|
|
580
|
+
# Returns the all the tasks for a device type.
|
|
581
|
+
# Returns the all the tasks for a device type.
|
|
582
|
+
# @param dtid Device Type ID.
|
|
583
|
+
# @param [Hash] opts the optional parameters
|
|
584
|
+
# @option opts [Integer] :count Max results count.
|
|
585
|
+
# @option opts [Integer] :offset Result starting offset.
|
|
586
|
+
# @option opts [String] :status Status filter. Comma-separated statuses.
|
|
587
|
+
# @option opts [String] :order Sort results by a field. Valid fields: createdOn.
|
|
588
|
+
# @option opts [String] :sort Sort order. Valid values: asc or desc.
|
|
589
|
+
# @return [TaskListEnvelope]
|
|
590
|
+
def get_tasks(dtid, opts = {})
|
|
591
|
+
data, _status_code, _headers = get_tasks_with_http_info(dtid, opts)
|
|
592
|
+
return data
|
|
593
|
+
end
|
|
594
|
+
|
|
595
|
+
# Returns the all the tasks for a device type.
|
|
596
|
+
# Returns the all the tasks for a device type.
|
|
597
|
+
# @param dtid Device Type ID.
|
|
598
|
+
# @param [Hash] opts the optional parameters
|
|
599
|
+
# @option opts [Integer] :count Max results count.
|
|
600
|
+
# @option opts [Integer] :offset Result starting offset.
|
|
601
|
+
# @option opts [String] :status Status filter. Comma-separated statuses.
|
|
602
|
+
# @option opts [String] :order Sort results by a field. Valid fields: createdOn.
|
|
603
|
+
# @option opts [String] :sort Sort order. Valid values: asc or desc.
|
|
604
|
+
# @return [Array<(TaskListEnvelope, Fixnum, Hash)>] TaskListEnvelope data, response status code and response headers
|
|
605
|
+
def get_tasks_with_http_info(dtid, opts = {})
|
|
606
|
+
if @api_client.config.debugging
|
|
607
|
+
@api_client.config.logger.debug "Calling API: DevicesManagementApi.get_tasks ..."
|
|
608
|
+
end
|
|
609
|
+
# verify the required parameter 'dtid' is set
|
|
610
|
+
fail ArgumentError, "Missing the required parameter 'dtid' when calling DevicesManagementApi.get_tasks" if dtid.nil?
|
|
611
|
+
# resource path
|
|
612
|
+
local_var_path = "/devicemgmt/tasks".sub('{format}','json')
|
|
613
|
+
|
|
614
|
+
# query parameters
|
|
615
|
+
query_params = {}
|
|
616
|
+
query_params[:'dtid'] = dtid
|
|
617
|
+
query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
|
|
618
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
619
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
|
620
|
+
query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
|
|
621
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
622
|
+
|
|
623
|
+
# header parameters
|
|
624
|
+
header_params = {}
|
|
625
|
+
|
|
626
|
+
# HTTP header 'Accept' (if needed)
|
|
627
|
+
local_header_accept = ['application/json']
|
|
628
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
|
629
|
+
|
|
630
|
+
# HTTP header 'Content-Type'
|
|
631
|
+
local_header_content_type = []
|
|
632
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
|
633
|
+
|
|
634
|
+
# form parameters
|
|
635
|
+
form_params = {}
|
|
636
|
+
|
|
637
|
+
# http body (model)
|
|
638
|
+
post_body = nil
|
|
639
|
+
auth_names = ['artikcloud_oauth']
|
|
640
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
641
|
+
:header_params => header_params,
|
|
642
|
+
:query_params => query_params,
|
|
643
|
+
:form_params => form_params,
|
|
644
|
+
:body => post_body,
|
|
645
|
+
:auth_names => auth_names,
|
|
646
|
+
:return_type => 'TaskListEnvelope')
|
|
647
|
+
if @api_client.config.debugging
|
|
648
|
+
@api_client.config.logger.debug "API called: DevicesManagementApi#get_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
649
|
+
end
|
|
650
|
+
return data, status_code, headers
|
|
651
|
+
end
|
|
652
|
+
|
|
653
|
+
# Query device properties across devices.
|
|
654
|
+
# Query device properties across devices.
|
|
655
|
+
# @param dtid Device Type ID.
|
|
656
|
+
# @param [Hash] opts the optional parameters
|
|
657
|
+
# @option opts [Integer] :count Max results count.
|
|
658
|
+
# @option opts [Integer] :offset Result starting offset.
|
|
659
|
+
# @option opts [String] :filter Query filter. Comma-separated key=value pairs
|
|
660
|
+
# @option opts [BOOLEAN] :include_timestamp Include timestamp.
|
|
661
|
+
# @return [MetadataQueryEnvelope]
|
|
662
|
+
def query_properties(dtid, opts = {})
|
|
663
|
+
data, _status_code, _headers = query_properties_with_http_info(dtid, opts)
|
|
664
|
+
return data
|
|
665
|
+
end
|
|
666
|
+
|
|
667
|
+
# Query device properties across devices.
|
|
668
|
+
# Query device properties across devices.
|
|
669
|
+
# @param dtid Device Type ID.
|
|
670
|
+
# @param [Hash] opts the optional parameters
|
|
671
|
+
# @option opts [Integer] :count Max results count.
|
|
672
|
+
# @option opts [Integer] :offset Result starting offset.
|
|
673
|
+
# @option opts [String] :filter Query filter. Comma-separated key=value pairs
|
|
674
|
+
# @option opts [BOOLEAN] :include_timestamp Include timestamp.
|
|
675
|
+
# @return [Array<(MetadataQueryEnvelope, Fixnum, Hash)>] MetadataQueryEnvelope data, response status code and response headers
|
|
676
|
+
def query_properties_with_http_info(dtid, opts = {})
|
|
677
|
+
if @api_client.config.debugging
|
|
678
|
+
@api_client.config.logger.debug "Calling API: DevicesManagementApi.query_properties ..."
|
|
679
|
+
end
|
|
680
|
+
# verify the required parameter 'dtid' is set
|
|
681
|
+
fail ArgumentError, "Missing the required parameter 'dtid' when calling DevicesManagementApi.query_properties" if dtid.nil?
|
|
682
|
+
# resource path
|
|
683
|
+
local_var_path = "/devicemgmt/devices/properties".sub('{format}','json')
|
|
684
|
+
|
|
685
|
+
# query parameters
|
|
686
|
+
query_params = {}
|
|
687
|
+
query_params[:'dtid'] = dtid
|
|
688
|
+
query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
|
|
689
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
690
|
+
query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
|
|
691
|
+
query_params[:'includeTimestamp'] = opts[:'include_timestamp'] if !opts[:'include_timestamp'].nil?
|
|
692
|
+
|
|
693
|
+
# header parameters
|
|
694
|
+
header_params = {}
|
|
695
|
+
|
|
696
|
+
# HTTP header 'Accept' (if needed)
|
|
697
|
+
local_header_accept = ['application/json']
|
|
698
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
|
699
|
+
|
|
700
|
+
# HTTP header 'Content-Type'
|
|
701
|
+
local_header_content_type = []
|
|
702
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
|
703
|
+
|
|
704
|
+
# form parameters
|
|
705
|
+
form_params = {}
|
|
706
|
+
|
|
707
|
+
# http body (model)
|
|
708
|
+
post_body = nil
|
|
709
|
+
auth_names = ['artikcloud_oauth']
|
|
710
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
711
|
+
:header_params => header_params,
|
|
712
|
+
:query_params => query_params,
|
|
713
|
+
:form_params => form_params,
|
|
714
|
+
:body => post_body,
|
|
715
|
+
:auth_names => auth_names,
|
|
716
|
+
:return_type => 'MetadataQueryEnvelope')
|
|
717
|
+
if @api_client.config.debugging
|
|
718
|
+
@api_client.config.logger.debug "API called: DevicesManagementApi#query_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
719
|
+
end
|
|
720
|
+
return data, status_code, headers
|
|
721
|
+
end
|
|
722
|
+
|
|
723
|
+
# Updates a device type information
|
|
724
|
+
# Updates a device type information
|
|
725
|
+
# @param dtid Device type ID.
|
|
726
|
+
# @param device_type_info Device type info object to be set
|
|
727
|
+
# @param [Hash] opts the optional parameters
|
|
728
|
+
# @return [DeviceTypesInfoEnvelope]
|
|
729
|
+
def update_device_types_info(dtid, device_type_info, opts = {})
|
|
730
|
+
data, _status_code, _headers = update_device_types_info_with_http_info(dtid, device_type_info, opts)
|
|
731
|
+
return data
|
|
732
|
+
end
|
|
733
|
+
|
|
734
|
+
# Updates a device type information
|
|
735
|
+
# Updates a device type information
|
|
736
|
+
# @param dtid Device type ID.
|
|
737
|
+
# @param device_type_info Device type info object to be set
|
|
738
|
+
# @param [Hash] opts the optional parameters
|
|
739
|
+
# @return [Array<(DeviceTypesInfoEnvelope, Fixnum, Hash)>] DeviceTypesInfoEnvelope data, response status code and response headers
|
|
740
|
+
def update_device_types_info_with_http_info(dtid, device_type_info, opts = {})
|
|
741
|
+
if @api_client.config.debugging
|
|
742
|
+
@api_client.config.logger.debug "Calling API: DevicesManagementApi.update_device_types_info ..."
|
|
743
|
+
end
|
|
744
|
+
# verify the required parameter 'dtid' is set
|
|
745
|
+
fail ArgumentError, "Missing the required parameter 'dtid' when calling DevicesManagementApi.update_device_types_info" if dtid.nil?
|
|
746
|
+
# verify the required parameter 'device_type_info' is set
|
|
747
|
+
fail ArgumentError, "Missing the required parameter 'device_type_info' when calling DevicesManagementApi.update_device_types_info" if device_type_info.nil?
|
|
748
|
+
# resource path
|
|
749
|
+
local_var_path = "/devicemgmt/devicetypes/{dtid}".sub('{format}','json').sub('{' + 'dtid' + '}', dtid.to_s)
|
|
750
|
+
|
|
751
|
+
# query parameters
|
|
752
|
+
query_params = {}
|
|
753
|
+
|
|
754
|
+
# header parameters
|
|
755
|
+
header_params = {}
|
|
756
|
+
|
|
757
|
+
# HTTP header 'Accept' (if needed)
|
|
758
|
+
local_header_accept = ['application/json']
|
|
759
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
|
760
|
+
|
|
761
|
+
# HTTP header 'Content-Type'
|
|
762
|
+
local_header_content_type = []
|
|
763
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
|
764
|
+
|
|
765
|
+
# form parameters
|
|
766
|
+
form_params = {}
|
|
767
|
+
|
|
768
|
+
# http body (model)
|
|
769
|
+
post_body = @api_client.object_to_http_body(device_type_info)
|
|
770
|
+
auth_names = ['artikcloud_oauth']
|
|
771
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
|
772
|
+
:header_params => header_params,
|
|
773
|
+
:query_params => query_params,
|
|
774
|
+
:form_params => form_params,
|
|
775
|
+
:body => post_body,
|
|
776
|
+
:auth_names => auth_names,
|
|
777
|
+
:return_type => 'DeviceTypesInfoEnvelope')
|
|
778
|
+
if @api_client.config.debugging
|
|
779
|
+
@api_client.config.logger.debug "API called: DevicesManagementApi#update_device_types_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
780
|
+
end
|
|
781
|
+
return data, status_code, headers
|
|
782
|
+
end
|
|
783
|
+
|
|
784
|
+
# Updates a device's server properties.
|
|
785
|
+
# Updates a device's server properties.
|
|
786
|
+
# @param did Device ID.
|
|
787
|
+
# @param device_properties Device properties object to be set
|
|
788
|
+
# @param [Hash] opts the optional parameters
|
|
789
|
+
# @return [MetadataEnvelope]
|
|
790
|
+
def update_server_properties(did, device_properties, opts = {})
|
|
791
|
+
data, _status_code, _headers = update_server_properties_with_http_info(did, device_properties, opts)
|
|
792
|
+
return data
|
|
793
|
+
end
|
|
794
|
+
|
|
795
|
+
# Updates a device's server properties.
|
|
796
|
+
# Updates a device's server properties.
|
|
797
|
+
# @param did Device ID.
|
|
798
|
+
# @param device_properties Device properties object to be set
|
|
799
|
+
# @param [Hash] opts the optional parameters
|
|
800
|
+
# @return [Array<(MetadataEnvelope, Fixnum, Hash)>] MetadataEnvelope data, response status code and response headers
|
|
801
|
+
def update_server_properties_with_http_info(did, device_properties, opts = {})
|
|
802
|
+
if @api_client.config.debugging
|
|
803
|
+
@api_client.config.logger.debug "Calling API: DevicesManagementApi.update_server_properties ..."
|
|
804
|
+
end
|
|
805
|
+
# verify the required parameter 'did' is set
|
|
806
|
+
fail ArgumentError, "Missing the required parameter 'did' when calling DevicesManagementApi.update_server_properties" if did.nil?
|
|
807
|
+
# verify the required parameter 'device_properties' is set
|
|
808
|
+
fail ArgumentError, "Missing the required parameter 'device_properties' when calling DevicesManagementApi.update_server_properties" if device_properties.nil?
|
|
809
|
+
# resource path
|
|
810
|
+
local_var_path = "/devicemgmt/devices/{did}/serverproperties".sub('{format}','json').sub('{' + 'did' + '}', did.to_s)
|
|
811
|
+
|
|
812
|
+
# query parameters
|
|
813
|
+
query_params = {}
|
|
814
|
+
|
|
815
|
+
# header parameters
|
|
816
|
+
header_params = {}
|
|
817
|
+
|
|
818
|
+
# HTTP header 'Accept' (if needed)
|
|
819
|
+
local_header_accept = ['application/json']
|
|
820
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
|
821
|
+
|
|
822
|
+
# HTTP header 'Content-Type'
|
|
823
|
+
local_header_content_type = []
|
|
824
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
|
825
|
+
|
|
826
|
+
# form parameters
|
|
827
|
+
form_params = {}
|
|
828
|
+
|
|
829
|
+
# http body (model)
|
|
830
|
+
post_body = @api_client.object_to_http_body(device_properties)
|
|
831
|
+
auth_names = ['artikcloud_oauth']
|
|
832
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
833
|
+
:header_params => header_params,
|
|
834
|
+
:query_params => query_params,
|
|
835
|
+
:form_params => form_params,
|
|
836
|
+
:body => post_body,
|
|
837
|
+
:auth_names => auth_names,
|
|
838
|
+
:return_type => 'MetadataEnvelope')
|
|
839
|
+
if @api_client.config.debugging
|
|
840
|
+
@api_client.config.logger.debug "API called: DevicesManagementApi#update_server_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
841
|
+
end
|
|
842
|
+
return data, status_code, headers
|
|
843
|
+
end
|
|
844
|
+
|
|
845
|
+
# Updates a task for all devices - For now just allows changing the state to cancelled.
|
|
846
|
+
# Updates a task for all devices - For now just allows changing the state to cancelled.
|
|
847
|
+
# @param tid Task ID.
|
|
848
|
+
# @param task_update_request Task update request
|
|
849
|
+
# @param [Hash] opts the optional parameters
|
|
850
|
+
# @return [TaskUpdateResponse]
|
|
851
|
+
def update_task(tid, task_update_request, opts = {})
|
|
852
|
+
data, _status_code, _headers = update_task_with_http_info(tid, task_update_request, opts)
|
|
853
|
+
return data
|
|
854
|
+
end
|
|
855
|
+
|
|
856
|
+
# Updates a task for all devices - For now just allows changing the state to cancelled.
|
|
857
|
+
# Updates a task for all devices - For now just allows changing the state to cancelled.
|
|
858
|
+
# @param tid Task ID.
|
|
859
|
+
# @param task_update_request Task update request
|
|
860
|
+
# @param [Hash] opts the optional parameters
|
|
861
|
+
# @return [Array<(TaskUpdateResponse, Fixnum, Hash)>] TaskUpdateResponse data, response status code and response headers
|
|
862
|
+
def update_task_with_http_info(tid, task_update_request, opts = {})
|
|
863
|
+
if @api_client.config.debugging
|
|
864
|
+
@api_client.config.logger.debug "Calling API: DevicesManagementApi.update_task ..."
|
|
865
|
+
end
|
|
866
|
+
# verify the required parameter 'tid' is set
|
|
867
|
+
fail ArgumentError, "Missing the required parameter 'tid' when calling DevicesManagementApi.update_task" if tid.nil?
|
|
868
|
+
# verify the required parameter 'task_update_request' is set
|
|
869
|
+
fail ArgumentError, "Missing the required parameter 'task_update_request' when calling DevicesManagementApi.update_task" if task_update_request.nil?
|
|
870
|
+
# resource path
|
|
871
|
+
local_var_path = "/devicemgmt/tasks/{tid}".sub('{format}','json').sub('{' + 'tid' + '}', tid.to_s)
|
|
872
|
+
|
|
873
|
+
# query parameters
|
|
874
|
+
query_params = {}
|
|
875
|
+
|
|
876
|
+
# header parameters
|
|
877
|
+
header_params = {}
|
|
878
|
+
|
|
879
|
+
# HTTP header 'Accept' (if needed)
|
|
880
|
+
local_header_accept = ['application/json']
|
|
881
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
|
882
|
+
|
|
883
|
+
# HTTP header 'Content-Type'
|
|
884
|
+
local_header_content_type = []
|
|
885
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
|
886
|
+
|
|
887
|
+
# form parameters
|
|
888
|
+
form_params = {}
|
|
889
|
+
|
|
890
|
+
# http body (model)
|
|
891
|
+
post_body = @api_client.object_to_http_body(task_update_request)
|
|
892
|
+
auth_names = ['artikcloud_oauth']
|
|
893
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
|
894
|
+
:header_params => header_params,
|
|
895
|
+
:query_params => query_params,
|
|
896
|
+
:form_params => form_params,
|
|
897
|
+
:body => post_body,
|
|
898
|
+
:auth_names => auth_names,
|
|
899
|
+
:return_type => 'TaskUpdateResponse')
|
|
900
|
+
if @api_client.config.debugging
|
|
901
|
+
@api_client.config.logger.debug "API called: DevicesManagementApi#update_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
902
|
+
end
|
|
903
|
+
return data, status_code, headers
|
|
904
|
+
end
|
|
905
|
+
|
|
906
|
+
# Updates a task for a specific device - For now just allows changing the state to cancelled.
|
|
907
|
+
# Updates a task for a specific device - For now just allows changing the state to cancelled.
|
|
908
|
+
# @param tid Task ID.
|
|
909
|
+
# @param did Device ID.
|
|
910
|
+
# @param device_task_update_request Device task update request
|
|
911
|
+
# @param [Hash] opts the optional parameters
|
|
912
|
+
# @return [DeviceTaskUpdateResponse]
|
|
913
|
+
def update_task_for_device(tid, did, device_task_update_request, opts = {})
|
|
914
|
+
data, _status_code, _headers = update_task_for_device_with_http_info(tid, did, device_task_update_request, opts)
|
|
915
|
+
return data
|
|
916
|
+
end
|
|
917
|
+
|
|
918
|
+
# Updates a task for a specific device - For now just allows changing the state to cancelled.
|
|
919
|
+
# Updates a task for a specific device - For now just allows changing the state to cancelled.
|
|
920
|
+
# @param tid Task ID.
|
|
921
|
+
# @param did Device ID.
|
|
922
|
+
# @param device_task_update_request Device task update request
|
|
923
|
+
# @param [Hash] opts the optional parameters
|
|
924
|
+
# @return [Array<(DeviceTaskUpdateResponse, Fixnum, Hash)>] DeviceTaskUpdateResponse data, response status code and response headers
|
|
925
|
+
def update_task_for_device_with_http_info(tid, did, device_task_update_request, opts = {})
|
|
926
|
+
if @api_client.config.debugging
|
|
927
|
+
@api_client.config.logger.debug "Calling API: DevicesManagementApi.update_task_for_device ..."
|
|
928
|
+
end
|
|
929
|
+
# verify the required parameter 'tid' is set
|
|
930
|
+
fail ArgumentError, "Missing the required parameter 'tid' when calling DevicesManagementApi.update_task_for_device" if tid.nil?
|
|
931
|
+
# verify the required parameter 'did' is set
|
|
932
|
+
fail ArgumentError, "Missing the required parameter 'did' when calling DevicesManagementApi.update_task_for_device" if did.nil?
|
|
933
|
+
# verify the required parameter 'device_task_update_request' is set
|
|
934
|
+
fail ArgumentError, "Missing the required parameter 'device_task_update_request' when calling DevicesManagementApi.update_task_for_device" if device_task_update_request.nil?
|
|
935
|
+
# resource path
|
|
936
|
+
local_var_path = "/devicemgmt/tasks/{tid}/devices/{did}".sub('{format}','json').sub('{' + 'tid' + '}', tid.to_s).sub('{' + 'did' + '}', did.to_s)
|
|
937
|
+
|
|
938
|
+
# query parameters
|
|
939
|
+
query_params = {}
|
|
940
|
+
|
|
941
|
+
# header parameters
|
|
942
|
+
header_params = {}
|
|
943
|
+
|
|
944
|
+
# HTTP header 'Accept' (if needed)
|
|
945
|
+
local_header_accept = ['application/json']
|
|
946
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
|
947
|
+
|
|
948
|
+
# HTTP header 'Content-Type'
|
|
949
|
+
local_header_content_type = []
|
|
950
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
|
951
|
+
|
|
952
|
+
# form parameters
|
|
953
|
+
form_params = {}
|
|
954
|
+
|
|
955
|
+
# http body (model)
|
|
956
|
+
post_body = @api_client.object_to_http_body(device_task_update_request)
|
|
957
|
+
auth_names = ['artikcloud_oauth']
|
|
958
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
|
959
|
+
:header_params => header_params,
|
|
960
|
+
:query_params => query_params,
|
|
961
|
+
:form_params => form_params,
|
|
962
|
+
:body => post_body,
|
|
963
|
+
:auth_names => auth_names,
|
|
964
|
+
:return_type => 'DeviceTaskUpdateResponse')
|
|
965
|
+
if @api_client.config.debugging
|
|
966
|
+
@api_client.config.logger.debug "API called: DevicesManagementApi#update_task_for_device\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
967
|
+
end
|
|
968
|
+
return data, status_code, headers
|
|
969
|
+
end
|
|
970
|
+
end
|
|
971
|
+
end
|