Skip to content

Latest commit

 

History

History
269 lines (216 loc) · 17.3 KB

README.md

File metadata and controls

269 lines (216 loc) · 17.3 KB

omni_core_model_and_state_management_api

OmniCoreModelAndStateManagementApi - JavaScript client for omni_core_model_and_state_management_api This is an OmniCore Model and State Management server.

  • API version: 1.8.21
  • Package version: 1.8.21
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen For more information, please visit http://www.korewireless.com

Installation

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install omni_core_model_and_state_management_api --save

Finally, you need to build the module:

npm run build
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your omni_core_model_and_state_management_api from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

git

If the library is hosted at a git repository, e.g.https://github.com/korewireless/OmniCore-JavaScript-SDK then install it via:

    npm install korewireless/OmniCore-JavaScript-SDK --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var OmniCoreModelAndStateManagementApi = require('omni_core_model_and_state_management_api');

var defaultClient = OmniCoreModelAndStateManagementApi.ApiClient.instance;
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix['x-api-key'] = "Token"
// Configure Bearer (JWT) access token for authorization: bearerAuth
var bearerAuth = defaultClient.authentications['bearerAuth'];
bearerAuth.accessToken = "YOUR ACCESS TOKEN"

var api = new OmniCoreModelAndStateManagementApi.DeviceApi()
var subscriptionId = "subscriptionId_example"; // {String} Subscription ID
var registryId = "registryId_example"; // {String} Registry ID
var bind = new OmniCoreModelAndStateManagementApi.BindRequest(); // {BindRequest} application/json
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.bindDevice(subscriptionId, registryId, bind, callback);

Documentation for API Endpoints

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

Class Method HTTP request Description
OmniCoreModelAndStateManagementApi.DeviceApi bindDevice POST /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/bindDeviceToGateway
OmniCoreModelAndStateManagementApi.DeviceApi bindDevices POST /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/bindDevicesToGateway
OmniCoreModelAndStateManagementApi.DeviceApi blockDeviceCommuncation PUT /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/devices/{deviceId}/communication
OmniCoreModelAndStateManagementApi.DeviceApi createDevice POST /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/devices
OmniCoreModelAndStateManagementApi.DeviceApi deleteDevice DELETE /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/devices/{deviceId}
OmniCoreModelAndStateManagementApi.DeviceApi getConfig GET /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/devices/{deviceId}/configVersions
OmniCoreModelAndStateManagementApi.DeviceApi getDevice GET /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/devices/{deviceId}
OmniCoreModelAndStateManagementApi.DeviceApi getDevices GET /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/devices
OmniCoreModelAndStateManagementApi.DeviceApi getDevicesLastSeen GET /omnicore/subscriptions/{subscriptionId}/devices
OmniCoreModelAndStateManagementApi.DeviceApi getStates GET /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/devices/{deviceId}/states
OmniCoreModelAndStateManagementApi.DeviceApi sendCommandToDevice POST /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/devices/{deviceId}/sendCommandToDevice
OmniCoreModelAndStateManagementApi.DeviceApi unBindDevice POST /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/unbindDeviceFromGateway
OmniCoreModelAndStateManagementApi.DeviceApi unBindDevices POST /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/unbindDevicesFromGateway
OmniCoreModelAndStateManagementApi.DeviceApi updateConfigurationToDevice POST /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/devices/{deviceId}/updateConfigurationToDevice
OmniCoreModelAndStateManagementApi.DeviceApi updateCustomOnboardRequest POST /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/devices/{deviceId}/updateCustomOnboardRequest
OmniCoreModelAndStateManagementApi.DeviceApi updateDevice PATCH /omnicore/subscriptions/{subscriptionId}/registries/{registryId}/devices/{deviceId}
OmniCoreModelAndStateManagementApi.MetricsApi getMetrics GET /omnicore/subscriptions/{subscriptionId}/metrics
OmniCoreModelAndStateManagementApi.RegistryApi createRegistry POST /omnicore/subscriptions/{subscriptionId}/registries
OmniCoreModelAndStateManagementApi.RegistryApi deleteRegistry DELETE /omnicore/subscriptions/{subscriptionId}/registries/{registryId}
OmniCoreModelAndStateManagementApi.RegistryApi getRegistries GET /omnicore/subscriptions/{subscriptionId}/registries
OmniCoreModelAndStateManagementApi.RegistryApi getRegistry GET /omnicore/subscriptions/{subscriptionId}/registries/{registryId}
OmniCoreModelAndStateManagementApi.RegistryApi sendBroadcastToDevices POST /omnicore/subscriptions/{subscriptionid}/registries/{registryId}/sendBroadcastToDevice
OmniCoreModelAndStateManagementApi.RegistryApi updateRegistry PATCH /omnicore/subscriptions/{subscriptionId}/registries/{registryId}
OmniCoreModelAndStateManagementApi.SinkApi createSink POST /omnicore/subscriptions/{subscriptionId}/sinks
OmniCoreModelAndStateManagementApi.SinkApi deleteSink DELETE /omnicore/subscriptions/{subscriptionId}/sinks/{sinkId}
OmniCoreModelAndStateManagementApi.SinkApi getSink GET /omnicore/subscriptions/{subscriptionId}/sinks/{sinkId}
OmniCoreModelAndStateManagementApi.SinkApi getSinks GET /omnicore/subscriptions/{subscriptionId}/sinks Get All Sinks
OmniCoreModelAndStateManagementApi.VaultApi createVaultConfiguration POST /vault/subscriptions/{subscriptionid}/configurations
OmniCoreModelAndStateManagementApi.VaultApi createVaultKey POST /vault/subscriptions/{subscriptionid}/encryptionkeys
OmniCoreModelAndStateManagementApi.VaultApi deleteConfiguration DELETE /vault/subscriptions/{subscriptionid}/configurations/{configid}
OmniCoreModelAndStateManagementApi.VaultApi deleteVaultKey DELETE /vault/subscriptions/{subscriptionid}/encryptionkeys/{keyid}
OmniCoreModelAndStateManagementApi.VaultApi enableEncryption POST /vault/subscriptions/{subscriptionid}/encryption
OmniCoreModelAndStateManagementApi.VaultApi getExports GET /vault/subscriptions/{subscriptionid}/exports
OmniCoreModelAndStateManagementApi.VaultApi getRegistryData GET /vault/subscriptions/{subscriptionid}/folders
OmniCoreModelAndStateManagementApi.VaultApi getReplays GET /vault/subscriptions/{subscriptionid}/replays
OmniCoreModelAndStateManagementApi.VaultApi getVaultAudit GET /vault/subscriptions/{subscriptionid}/audit
OmniCoreModelAndStateManagementApi.VaultApi getVaultConfigurations GET /vault/subscriptions/{subscriptionid}/configurations
OmniCoreModelAndStateManagementApi.VaultApi getVaultFiles GET /vault/subscriptions/{subscriptionid}/registry/{registryid}/files
OmniCoreModelAndStateManagementApi.VaultApi getVaultKeys GET /vault/subscriptions/{subscriptionid}/encryptionkeys
OmniCoreModelAndStateManagementApi.VaultApi getVaultMetrics GET /vault/subscriptions/{subscriptionid}/metrics
OmniCoreModelAndStateManagementApi.VaultApi getVaultStatus GET /vault/subscriptions/{subscriptionid}/status
OmniCoreModelAndStateManagementApi.VaultApi setRetention POST /vault/subscriptions/{subscriptionid}/retention
OmniCoreModelAndStateManagementApi.VaultApi startExport POST /vault/subscriptions/{subscriptionid}/exports
OmniCoreModelAndStateManagementApi.VaultApi startReplay POST /vault/subscriptions/{subscriptionid}/replays

Documentation for Models

Documentation for Authorization

bearerAuth

  • Type: Bearer authentication (JWT)

apiKey

  • Type: API key
  • API key parameter name: x-api-key
  • Location: HTTP header