Skip to content

Latest commit

 

History

History
1323 lines (920 loc) · 45.5 KB

DeviceApi.md

File metadata and controls

1323 lines (920 loc) · 45.5 KB

OmniCoreClient::DeviceApi

All URIs are relative to https://api.korewireless.com

Method HTTP request Description
bind_device POST /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/bindDeviceToGateway
bind_devices POST /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/bindDevicesToGateway
block_device_communcation PUT /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/devices/{deviceId}/communication
create_device POST /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/devices
delete_device DELETE /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/devices/{deviceId}
get_config GET /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/devices/{deviceId}/configVersions
get_device GET /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/devices/{deviceId}
get_devices GET /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/devices
get_states GET /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/devices/{deviceId}/states
get_subscription_devices GET /omnicore/subscriptions/{subscriptionId}/devices
send_command_to_device POST /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/devices/{deviceId}/sendCommandToDevice
un_bind_device POST /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/unbindDeviceFromGateway
un_bind_devices POST /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/unbindDevicesFromGateway
update_configuration_to_device POST /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/devices/{deviceId}/updateConfigurationToDevice
update_custom_onboard_request POST /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/devices/{deviceId}/updateCustomOnboardRequest
update_device PATCH /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/devices/{deviceId}

bind_device

bind_device(subscription_id, registry_id, bind)

Bind a device to a gateway under a registry

Examples

require 'time'
require 'omnicore_client'
# setup authorization
OmniCoreClient.configure do |config|
  # Configure API key authorization: apiKey
  config.api_key['apiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKey'] = 'Bearer'

  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OmniCoreClient::DeviceApi.new
subscription_id = 'subscription_id_example' # String | Subscription ID
registry_id = 'registry_id_example' # String | Registry ID
bind = OmniCoreClient::BindRequest.new({device_id: 'device_id_example', gateway_id: 'gateway_id_example'}) # BindRequest | application/json

begin
  
  result = api_instance.bind_device(subscription_id, registry_id, bind)
  p result
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->bind_device: #{e}"
end

Using the bind_device_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> bind_device_with_http_info(subscription_id, registry_id, bind)

begin
  
  data, status_code, headers = api_instance.bind_device_with_http_info(subscription_id, registry_id, bind)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Info>
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->bind_device_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
subscription_id String Subscription ID
registry_id String Registry ID
bind BindRequest application/json

Return type

Info

Authorization

apiKey, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

bind_devices

bind_devices(subscription_id, registry_id, bind)

Bind devices to a gateway under a registry

Examples

require 'time'
require 'omnicore_client'
# setup authorization
OmniCoreClient.configure do |config|
  # Configure API key authorization: apiKey
  config.api_key['apiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKey'] = 'Bearer'

  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OmniCoreClient::DeviceApi.new
subscription_id = 'subscription_id_example' # String | Subscription ID
registry_id = 'registry_id_example' # String | Registry ID
bind = OmniCoreClient::BindRequestIdsGateway.new({device_ids: ['device_ids_example'], gateway_id: 'gateway_id_example'}) # BindRequestIdsGateway | application/json

begin
  
  result = api_instance.bind_devices(subscription_id, registry_id, bind)
  p result
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->bind_devices: #{e}"
end

Using the bind_devices_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> bind_devices_with_http_info(subscription_id, registry_id, bind)

begin
  
  data, status_code, headers = api_instance.bind_devices_with_http_info(subscription_id, registry_id, bind)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Info>
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->bind_devices_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
subscription_id String Subscription ID
registry_id String Registry ID
bind BindRequestIdsGateway application/json

Return type

Info

Authorization

apiKey, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

block_device_communcation

Object block_device_communcation(subscriptionid, registry_id, device_id, block)

Blocks All Communication From A Device

Examples

require 'time'
require 'omnicore_client'
# setup authorization
OmniCoreClient.configure do |config|
  # Configure API key authorization: apiKey
  config.api_key['apiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKey'] = 'Bearer'

  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OmniCoreClient::DeviceApi.new
subscriptionid = 'subscriptionid_example' # String | Subscription ID
registry_id = 'registry_id_example' # String | Registry ID
device_id = 'device_id_example' # String | Device ID
block = OmniCoreClient::BlockCommunicationBody.new # BlockCommunicationBody | application/json

begin
  
  result = api_instance.block_device_communcation(subscriptionid, registry_id, device_id, block)
  p result
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->block_device_communcation: #{e}"
end

Using the block_device_communcation_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(Object, Integer, Hash)> block_device_communcation_with_http_info(subscriptionid, registry_id, device_id, block)

begin
  
  data, status_code, headers = api_instance.block_device_communcation_with_http_info(subscriptionid, registry_id, device_id, block)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => Object
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->block_device_communcation_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
subscriptionid String Subscription ID
registry_id String Registry ID
device_id String Device ID
block BlockCommunicationBody application/json

Return type

Object

Authorization

apiKey, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

create_device

create_device(subscription_id, registry_id, device)

Create a device under a registry

Examples

require 'time'
require 'omnicore_client'
# setup authorization
OmniCoreClient.configure do |config|
  # Configure API key authorization: apiKey
  config.api_key['apiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKey'] = 'Bearer'

  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OmniCoreClient::DeviceApi.new
subscription_id = 'subscription_id_example' # String | Subscription ID
registry_id = 'registry_id_example' # String | Registry ID
device = OmniCoreClient::Device.new({id: 'id_example'}) # Device | application/json

begin
  
  result = api_instance.create_device(subscription_id, registry_id, device)
  p result
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->create_device: #{e}"
end

Using the create_device_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> create_device_with_http_info(subscription_id, registry_id, device)

begin
  
  data, status_code, headers = api_instance.create_device_with_http_info(subscription_id, registry_id, device)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Device>
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->create_device_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
subscription_id String Subscription ID
registry_id String Registry ID
device Device application/json

Return type

Device

Authorization

apiKey, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

delete_device

Object delete_device(subscription_id, registry_id, device_id)

Delete a device under a registry

Examples

require 'time'
require 'omnicore_client'
# setup authorization
OmniCoreClient.configure do |config|
  # Configure API key authorization: apiKey
  config.api_key['apiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKey'] = 'Bearer'

  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OmniCoreClient::DeviceApi.new
subscription_id = 'subscription_id_example' # String | Subscription ID
registry_id = 'registry_id_example' # String | Registry ID
device_id = 'device_id_example' # String | Device ID

begin
  
  result = api_instance.delete_device(subscription_id, registry_id, device_id)
  p result
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->delete_device: #{e}"
end

Using the delete_device_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(Object, Integer, Hash)> delete_device_with_http_info(subscription_id, registry_id, device_id)

begin
  
  data, status_code, headers = api_instance.delete_device_with_http_info(subscription_id, registry_id, device_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => Object
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->delete_device_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
subscription_id String Subscription ID
registry_id String Registry ID
device_id String Device ID

Return type

Object

Authorization

apiKey, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_config

get_config(subscriptionid, registry_id, device_id, opts)

Get Configs Of Devices

Examples

require 'time'
require 'omnicore_client'
# setup authorization
OmniCoreClient.configure do |config|
  # Configure API key authorization: apiKey
  config.api_key['apiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKey'] = 'Bearer'

  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OmniCoreClient::DeviceApi.new
subscriptionid = 'subscriptionid_example' # String | Subscription ID
registry_id = 'registry_id_example' # String | Registry ID
device_id = 'device_id_example' # String | Device ID
opts = {
  num_versions: 56 # Integer | The number of versions to list. Versions are listed in decreasing order of the version number. The maximum number of versions retained is 10. If this value is zero, it will return all the versions available.
}

begin
  
  result = api_instance.get_config(subscriptionid, registry_id, device_id, opts)
  p result
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->get_config: #{e}"
end

Using the get_config_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_config_with_http_info(subscriptionid, registry_id, device_id, opts)

begin
  
  data, status_code, headers = api_instance.get_config_with_http_info(subscriptionid, registry_id, device_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ListDeviceConfigVersionsResponse>
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->get_config_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
subscriptionid String Subscription ID
registry_id String Registry ID
device_id String Device ID
num_versions Integer The number of versions to list. Versions are listed in decreasing order of the version number. The maximum number of versions retained is 10. If this value is zero, it will return all the versions available. [optional]

Return type

ListDeviceConfigVersionsResponse

Authorization

apiKey, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_device

get_device(subscription_id, registry_id, device_id)

Get a device under a registry

Examples

require 'time'
require 'omnicore_client'
# setup authorization
OmniCoreClient.configure do |config|
  # Configure API key authorization: apiKey
  config.api_key['apiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKey'] = 'Bearer'

  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OmniCoreClient::DeviceApi.new
subscription_id = 'subscription_id_example' # String | Subscription ID
registry_id = 'registry_id_example' # String | Registry ID
device_id = 'device_id_example' # String | Device ID

begin
  
  result = api_instance.get_device(subscription_id, registry_id, device_id)
  p result
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->get_device: #{e}"
end

Using the get_device_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_device_with_http_info(subscription_id, registry_id, device_id)

begin
  
  data, status_code, headers = api_instance.get_device_with_http_info(subscription_id, registry_id, device_id)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Device>
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->get_device_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
subscription_id String Subscription ID
registry_id String Registry ID
device_id String Device ID

Return type

Device

Authorization

apiKey, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_devices

get_devices(subscription_id, registry_id, opts)

Get all devices under a registry

Examples

require 'time'
require 'omnicore_client'
# setup authorization
OmniCoreClient.configure do |config|
  # Configure API key authorization: apiKey
  config.api_key['apiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKey'] = 'Bearer'

  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OmniCoreClient::DeviceApi.new
subscription_id = 'subscription_id_example' # String | Subscription ID
registry_id = 'registry_id_example' # String | Registry ID
opts = {
  page_number: 56, # Integer | Page Number
  page_size: 56, # Integer | The maximum number of devices to return in the response. If this value is zero, the service will select a default size. 
  field_mask: 'field_mask_example', # String | The fields of the Device resource to be returned to the response. The fields id and numId are always returned, along with any other fields specified. A comma-separated list of fully qualified names of fields. Example: 
  device_ids: ['inner_example'], # Array<String> | A list of device string IDs. For example, ['device0', 'device12']. If empty, this field is ignored. Maximum IDs: 10,000
  device_num_ids: ['inner_example'], # Array<String> | A list of device numeric IDs. If empty, this field is ignored. Maximum IDs: 10,000.
  gateway_list_options_associations_device_id: 'gateway_list_options_associations_device_id_example', # String | If set, returns only the gateways with which the specified device is associated. The device ID can be numeric (num_id) or the user-defined string (id). For example, if 456 is specified, returns only the gateways to which the device with num_id 456 is bound.
  gateway_list_options_associations_gateway_id: 'gateway_list_options_associations_gateway_id_example', # String | If set, only devices associated with the specified gateway are returned. The gateway ID can be numeric (num_id) or the user-defined string (id). For example, if 123 is specified, only devices bound to the gateway with num_id 123 are returned
  gateway_list_options_gateway_type: 'gateway_list_options_gateway_type_example' # String | If GATEWAY is specified, only gateways are returned. If NON_GATEWAY is specified, only non-gateway devices are returned. If GATEWAY_TYPE_UNSPECIFIED is specified, all devices are returned.
}

begin
  
  result = api_instance.get_devices(subscription_id, registry_id, opts)
  p result
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->get_devices: #{e}"
end

Using the get_devices_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_devices_with_http_info(subscription_id, registry_id, opts)

begin
  
  data, status_code, headers = api_instance.get_devices_with_http_info(subscription_id, registry_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ListDevicesResponse>
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->get_devices_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
subscription_id String Subscription ID
registry_id String Registry ID
page_number Integer Page Number [optional]
page_size Integer The maximum number of devices to return in the response. If this value is zero, the service will select a default size. [optional]
field_mask String The fields of the Device resource to be returned to the response. The fields id and numId are always returned, along with any other fields specified. A comma-separated list of fully qualified names of fields. Example: [optional]
device_ids Array<String> A list of device string IDs. For example, ['device0', 'device12']. If empty, this field is ignored. Maximum IDs: 10,000 [optional]
device_num_ids Array<String> A list of device numeric IDs. If empty, this field is ignored. Maximum IDs: 10,000. [optional]
gateway_list_options_associations_device_id String If set, returns only the gateways with which the specified device is associated. The device ID can be numeric (num_id) or the user-defined string (id). For example, if 456 is specified, returns only the gateways to which the device with num_id 456 is bound. [optional]
gateway_list_options_associations_gateway_id String If set, only devices associated with the specified gateway are returned. The gateway ID can be numeric (num_id) or the user-defined string (id). For example, if 123 is specified, only devices bound to the gateway with num_id 123 are returned [optional]
gateway_list_options_gateway_type String If GATEWAY is specified, only gateways are returned. If NON_GATEWAY is specified, only non-gateway devices are returned. If GATEWAY_TYPE_UNSPECIFIED is specified, all devices are returned. [optional]

Return type

ListDevicesResponse

Authorization

apiKey, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_states

get_states(subscriptionid, registry_id, device_id, opts)

Get States Of Devices

Examples

require 'time'
require 'omnicore_client'
# setup authorization
OmniCoreClient.configure do |config|
  # Configure API key authorization: apiKey
  config.api_key['apiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKey'] = 'Bearer'

  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OmniCoreClient::DeviceApi.new
subscriptionid = 'subscriptionid_example' # String | Subscription ID
registry_id = 'registry_id_example' # String | Registry ID
device_id = 'device_id_example' # String | Device ID
opts = {
  num_states: 56 # Integer | The number of states to list. States are listed in descending order of update time. The maximum number of states retained is 10. If this value is zero, it will return all the states available.
}

begin
  
  result = api_instance.get_states(subscriptionid, registry_id, device_id, opts)
  p result
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->get_states: #{e}"
end

Using the get_states_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_states_with_http_info(subscriptionid, registry_id, device_id, opts)

begin
  
  data, status_code, headers = api_instance.get_states_with_http_info(subscriptionid, registry_id, device_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ListDeviceStatesResponse>
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->get_states_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
subscriptionid String Subscription ID
registry_id String Registry ID
device_id String Device ID
num_states Integer The number of states to list. States are listed in descending order of update time. The maximum number of states retained is 10. If this value is zero, it will return all the states available. [optional]

Return type

ListDeviceStatesResponse

Authorization

apiKey, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

get_subscription_devices

get_subscription_devices(subscription_id, opts)

Get all devices under a subscription

Examples

require 'time'
require 'omnicore_client'
# setup authorization
OmniCoreClient.configure do |config|
  # Configure API key authorization: apiKey
  config.api_key['apiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKey'] = 'Bearer'

  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OmniCoreClient::DeviceApi.new
subscription_id = 'subscription_id_example' # String | Subscription ID
opts = {
  page_number: 56, # Integer | Page Number
  page_size: 56, # Integer | The maximum number of devices to return in the response. If this value is zero, the service will select a default size. 
  field_mask: 'field_mask_example', # String | The fields of the Device resource to be returned to the response. The fields id and numId are always returned, along with any other fields specified. A comma-separated list of fully qualified names of fields. Example: 
  sort_by_client_online: true, # Boolean | Set to true to return devices sorted by last heartbeat 
  device_ids: ['inner_example'], # Array<String> | A list of device string IDs. For example, ['device0', 'device12']. If empty, this field is ignored. Maximum IDs: 10,000
  device_num_ids: ['inner_example'], # Array<String> | A list of device numeric IDs. If empty, this field is ignored. Maximum IDs: 10,000.
  gateway_list_options_associations_device_id: 'gateway_list_options_associations_device_id_example', # String | If set, returns only the gateways with which the specified device is associated. The device ID can be numeric (num_id) or the user-defined string (id). For example, if 456 is specified, returns only the gateways to which the device with num_id 456 is bound.
  gateway_list_options_associations_gateway_id: 'gateway_list_options_associations_gateway_id_example', # String | If set, only devices associated with the specified gateway are returned. The gateway ID can be numeric (num_id) or the user-defined string (id). For example, if 123 is specified, only devices bound to the gateway with num_id 123 are returned
  gateway_list_options_gateway_type: 'gateway_list_options_gateway_type_example' # String | If GATEWAY is specified, only gateways are returned. If NON_GATEWAY is specified, only non-gateway devices are returned. If GATEWAY_TYPE_UNSPECIFIED is specified, all devices are returned.
}

begin
  
  result = api_instance.get_subscription_devices(subscription_id, opts)
  p result
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->get_subscription_devices: #{e}"
end

Using the get_subscription_devices_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_subscription_devices_with_http_info(subscription_id, opts)

begin
  
  data, status_code, headers = api_instance.get_subscription_devices_with_http_info(subscription_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <ListDevicesOnlineResponse>
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->get_subscription_devices_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
subscription_id String Subscription ID
page_number Integer Page Number [optional]
page_size Integer The maximum number of devices to return in the response. If this value is zero, the service will select a default size. [optional]
field_mask String The fields of the Device resource to be returned to the response. The fields id and numId are always returned, along with any other fields specified. A comma-separated list of fully qualified names of fields. Example: [optional]
sort_by_client_online Boolean Set to true to return devices sorted by last heartbeat [optional]
device_ids Array<String> A list of device string IDs. For example, ['device0', 'device12']. If empty, this field is ignored. Maximum IDs: 10,000 [optional]
device_num_ids Array<String> A list of device numeric IDs. If empty, this field is ignored. Maximum IDs: 10,000. [optional]
gateway_list_options_associations_device_id String If set, returns only the gateways with which the specified device is associated. The device ID can be numeric (num_id) or the user-defined string (id). For example, if 456 is specified, returns only the gateways to which the device with num_id 456 is bound. [optional]
gateway_list_options_associations_gateway_id String If set, only devices associated with the specified gateway are returned. The gateway ID can be numeric (num_id) or the user-defined string (id). For example, if 123 is specified, only devices bound to the gateway with num_id 123 are returned [optional]
gateway_list_options_gateway_type String If GATEWAY is specified, only gateways are returned. If NON_GATEWAY is specified, only non-gateway devices are returned. If GATEWAY_TYPE_UNSPECIFIED is specified, all devices are returned. [optional]

Return type

ListDevicesOnlineResponse

Authorization

apiKey, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

send_command_to_device

Object send_command_to_device(subscriptionid, registry_id, device_id, command)

Send A Command To A Device

Examples

require 'time'
require 'omnicore_client'
# setup authorization
OmniCoreClient.configure do |config|
  # Configure API key authorization: apiKey
  config.api_key['apiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKey'] = 'Bearer'

  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OmniCoreClient::DeviceApi.new
subscriptionid = 'subscriptionid_example' # String | Subscription ID
registry_id = 'registry_id_example' # String | Registry ID
device_id = 'device_id_example' # String | Device ID
command = OmniCoreClient::DeviceCommand.new({binary_data: 'binary_data_example'}) # DeviceCommand | application/json

begin
  
  result = api_instance.send_command_to_device(subscriptionid, registry_id, device_id, command)
  p result
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->send_command_to_device: #{e}"
end

Using the send_command_to_device_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(Object, Integer, Hash)> send_command_to_device_with_http_info(subscriptionid, registry_id, device_id, command)

begin
  
  data, status_code, headers = api_instance.send_command_to_device_with_http_info(subscriptionid, registry_id, device_id, command)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => Object
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->send_command_to_device_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
subscriptionid String Subscription ID
registry_id String Registry ID
device_id String Device ID
command DeviceCommand application/json

Return type

Object

Authorization

apiKey, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

un_bind_device

un_bind_device(subscription_id, registry_id, unbind)

UnBind a device from a gateway under a registry

Examples

require 'time'
require 'omnicore_client'
# setup authorization
OmniCoreClient.configure do |config|
  # Configure API key authorization: apiKey
  config.api_key['apiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKey'] = 'Bearer'

  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OmniCoreClient::DeviceApi.new
subscription_id = 'subscription_id_example' # String | Subscription ID
registry_id = 'registry_id_example' # String | Registry ID
unbind = OmniCoreClient::BindRequest.new({device_id: 'device_id_example', gateway_id: 'gateway_id_example'}) # BindRequest | application/json

begin
  
  result = api_instance.un_bind_device(subscription_id, registry_id, unbind)
  p result
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->un_bind_device: #{e}"
end

Using the un_bind_device_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> un_bind_device_with_http_info(subscription_id, registry_id, unbind)

begin
  
  data, status_code, headers = api_instance.un_bind_device_with_http_info(subscription_id, registry_id, unbind)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Info>
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->un_bind_device_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
subscription_id String Subscription ID
registry_id String Registry ID
unbind BindRequest application/json

Return type

Info

Authorization

apiKey, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

un_bind_devices

un_bind_devices(subscription_id, registry_id, unbind)

UnBind devices from a gateway under a registry

Examples

require 'time'
require 'omnicore_client'
# setup authorization
OmniCoreClient.configure do |config|
  # Configure API key authorization: apiKey
  config.api_key['apiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKey'] = 'Bearer'

  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OmniCoreClient::DeviceApi.new
subscription_id = 'subscription_id_example' # String | Subscription ID
registry_id = 'registry_id_example' # String | Registry ID
unbind = OmniCoreClient::BindRequestIdsGateway.new({device_ids: ['device_ids_example'], gateway_id: 'gateway_id_example'}) # BindRequestIdsGateway | application/json

begin
  
  result = api_instance.un_bind_devices(subscription_id, registry_id, unbind)
  p result
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->un_bind_devices: #{e}"
end

Using the un_bind_devices_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> un_bind_devices_with_http_info(subscription_id, registry_id, unbind)

begin
  
  data, status_code, headers = api_instance.un_bind_devices_with_http_info(subscription_id, registry_id, unbind)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Info>
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->un_bind_devices_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
subscription_id String Subscription ID
registry_id String Registry ID
unbind BindRequestIdsGateway application/json

Return type

Info

Authorization

apiKey, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

update_configuration_to_device

update_configuration_to_device(subscriptionid, registry_id, device_id, configuration)

Update A Configuration Of A Device

Examples

require 'time'
require 'omnicore_client'
# setup authorization
OmniCoreClient.configure do |config|
  # Configure API key authorization: apiKey
  config.api_key['apiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKey'] = 'Bearer'

  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OmniCoreClient::DeviceApi.new
subscriptionid = 'subscriptionid_example' # String | Subscription ID
registry_id = 'registry_id_example' # String | Registry ID
device_id = 'device_id_example' # String | Device ID
configuration = OmniCoreClient::DeviceConfiguration.new({binary_data: 'binary_data_example'}) # DeviceConfiguration | application/json

begin
  
  result = api_instance.update_configuration_to_device(subscriptionid, registry_id, device_id, configuration)
  p result
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->update_configuration_to_device: #{e}"
end

Using the update_configuration_to_device_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> update_configuration_to_device_with_http_info(subscriptionid, registry_id, device_id, configuration)

begin
  
  data, status_code, headers = api_instance.update_configuration_to_device_with_http_info(subscriptionid, registry_id, device_id, configuration)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <DeviceConfig>
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->update_configuration_to_device_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
subscriptionid String Subscription ID
registry_id String Registry ID
device_id String Device ID
configuration DeviceConfiguration application/json

Return type

DeviceConfig

Authorization

apiKey, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

update_custom_onboard_request

update_custom_onboard_request(subscriptionid, registry_id, device_id, custom_onboard)

Approve/Reject a Custom Onboard Request

Examples

require 'time'
require 'omnicore_client'
# setup authorization
OmniCoreClient.configure do |config|
  # Configure API key authorization: apiKey
  config.api_key['apiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKey'] = 'Bearer'

  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OmniCoreClient::DeviceApi.new
subscriptionid = 'subscriptionid_example' # String | Subscription ID
registry_id = 'registry_id_example' # String | Registry ID
device_id = 'device_id_example' # String | Device ID
custom_onboard = OmniCoreClient::CustomOnboard.new({id: 'id_example'}) # CustomOnboard | application/json

begin
  
  result = api_instance.update_custom_onboard_request(subscriptionid, registry_id, device_id, custom_onboard)
  p result
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->update_custom_onboard_request: #{e}"
end

Using the update_custom_onboard_request_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> update_custom_onboard_request_with_http_info(subscriptionid, registry_id, device_id, custom_onboard)

begin
  
  data, status_code, headers = api_instance.update_custom_onboard_request_with_http_info(subscriptionid, registry_id, device_id, custom_onboard)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Info>
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->update_custom_onboard_request_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
subscriptionid String Subscription ID
registry_id String Registry ID
device_id String Device ID
custom_onboard CustomOnboard application/json

Return type

Info

Authorization

apiKey, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

update_device

update_device(subscription_id, registry_id, device_id, update_mask, device)

Modify device under a registry

Examples

require 'time'
require 'omnicore_client'
# setup authorization
OmniCoreClient.configure do |config|
  # Configure API key authorization: apiKey
  config.api_key['apiKey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['apiKey'] = 'Bearer'

  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = OmniCoreClient::DeviceApi.new
subscription_id = 'subscription_id_example' # String | Subscription ID
registry_id = 'registry_id_example' # String | Registry ID
device_id = 'device_id_example' # String | Device ID
update_mask = 'logLevel' # String | Required. Only updates the device fields indicated by this mask. The field mask must not be empty, and it must not contain fields that are immutable or only set by the server. Mutable top-level fields: credentials,logLevel, blocked,policy and metadata
device = OmniCoreClient::Device.new({id: 'id_example'}) # Device | application/json

begin
  
  result = api_instance.update_device(subscription_id, registry_id, device_id, update_mask, device)
  p result
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->update_device: #{e}"
end

Using the update_device_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> update_device_with_http_info(subscription_id, registry_id, device_id, update_mask, device)

begin
  
  data, status_code, headers = api_instance.update_device_with_http_info(subscription_id, registry_id, device_id, update_mask, device)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <Device>
rescue OmniCoreClient::ApiError => e
  puts "Error when calling DeviceApi->update_device_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
subscription_id String Subscription ID
registry_id String Registry ID
device_id String Device ID
update_mask String Required. Only updates the device fields indicated by this mask. The field mask must not be empty, and it must not contain fields that are immutable or only set by the server. Mutable top-level fields: credentials,logLevel, blocked,policy and metadata
device Device application/json

Return type

Device

Authorization

apiKey, bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json