1.0.0 • Published 5 years ago

iot_api v1.0.0

Weekly downloads
1
License
Unlicense
Repository
github
Last release
5 years ago

iot_api

IotApi - JavaScript client for iot_api 数蛙物理网平台API接口 This SDK is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

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

Then install it via:

npm install iot_api --save
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

Finally, switch to the directory you want to use your iot_api from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

You should now be able to require('iot_api') in javascript files from the directory you ran the last command above from.

git

If the library is hosted at a git repository, e.g. https://github.com/YOUR_USERNAME/iot_api then install it via:

    npm install YOUR_USERNAME/iot_api --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, that's to say your javascript file where you actually use this library):

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 IotApi = require('iot_api');

var defaultClient = IotApi.ApiClient.instance;

// Configure API key authorization: APIKeyHeader
var APIKeyHeader = defaultClient.authentications['APIKeyHeader'];
APIKeyHeader.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.apiKeyPrefix['sessionToken'] = "Token"

var api = new IotApi.ApiApi()

var opts = { 
  'order': "order_example", // {String} 排序方式, 负为降序, eg: score,-name
  'limit': 8.14, // {Number} limit, 显示多少条记录,显示100条记录 eg:100
  'skip': 8.14, // {Number} skip
  'keys': "keys_example", // {String} 需要显示的字段, eg: username,email
  'include': "include_example", // {String} include
  'where': "where_example" // {String} 过滤条件,eg: {\"objectId\":{\"$in\":[\"BGS3BFgcZN\"]}}
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.classesApiGet(opts, callback);

Documentation for API Endpoints

All URIs are relative to http://localhost/iotapi/

ClassMethodHTTP requestDescription
IotApi.ApiApiclassesApiGetGET /classes/Api查询Api数据
IotApi.ApiApiclassesApiIdDeleteDELETE /classes/Api/{id}通过ID删除Api
IotApi.ApiApiclassesApiIdGetGET /classes/Api/{id}通过ID获取Api
IotApi.ApiApiclassesApiIdPutPUT /classes/Api/{id}通过ID更新Api
IotApi.ApiApiclassesApiPostPOST /classes/Api新增Api记录
IotApi.AppApiclassesAppGetGET /classes/App查询App数据
IotApi.AppApiclassesAppIdDeleteDELETE /classes/App/{id}通过ID删除App
IotApi.AppApiclassesAppIdGetGET /classes/App/{id}通过ID获取App
IotApi.AppApiclassesAppIdPutPUT /classes/App/{id}通过ID更新App
IotApi.AppApiclassesAppPostPOST /classes/App新增App记录
IotApi.BatchApibatchPostPOST /batch批处理
IotApi.CloudFileApiclassesCloudFileGetGET /classes/CloudFile查询CloudFile数据
IotApi.CloudFileApiclassesCloudFileIdDeleteDELETE /classes/CloudFile/{id}通过ID删除CloudFile
IotApi.CloudFileApiclassesCloudFileIdGetGET /classes/CloudFile/{id}通过ID获取CloudFile
IotApi.CloudFileApiclassesCloudFileIdPutPUT /classes/CloudFile/{id}通过ID更新CloudFile
IotApi.CloudFileApiclassesCloudFilePostPOST /classes/CloudFile新增CloudFile记录
IotApi.DatasApiclassesDatasGetGET /classes/Datas查询Datas数据
IotApi.DatasApiclassesDatasIdDeleteDELETE /classes/Datas/{id}通过ID删除Datas
IotApi.DatasApiclassesDatasIdGetGET /classes/Datas/{id}通过ID获取Datas
IotApi.DatasApiclassesDatasIdPutPUT /classes/Datas/{id}通过ID更新Datas
IotApi.DatasApiclassesDatasPostPOST /classes/Datas新增Datas记录
IotApi.DevicesApiclassesDevicesGetGET /classes/Devices查询Devices数据
IotApi.DevicesApiclassesDevicesIdDeleteDELETE /classes/Devices/{id}通过ID删除Devices
IotApi.DevicesApiclassesDevicesIdGetGET /classes/Devices/{id}通过ID获取Devices
IotApi.DevicesApiclassesDevicesIdPutPUT /classes/Devices/{id}通过ID更新Devices
IotApi.DevicesApiclassesDevicesPostPOST /classes/Devices新增Devices记录
IotApi.DtuApiclassesDtuGetGET /classes/Dtu查询Dtu数据
IotApi.DtuApiclassesDtuGet_0GET /classes/dtu查询dtu数据
IotApi.DtuApiclassesDtuIdDeleteDELETE /classes/dtu/{id}通过ID删除dtu
IotApi.DtuApiclassesDtuIdDelete_0DELETE /classes/Dtu/{id}通过ID删除Dtu
IotApi.DtuApiclassesDtuIdGetGET /classes/dtu/{id}通过ID获取dtu
IotApi.DtuApiclassesDtuIdGet_0GET /classes/Dtu/{id}通过ID获取Dtu
IotApi.DtuApiclassesDtuIdPutPUT /classes/dtu/{id}通过ID更新dtu
IotApi.DtuApiclassesDtuIdPut_0PUT /classes/Dtu/{id}通过ID更新Dtu
IotApi.DtuApiclassesDtuPostPOST /classes/Dtu新增Dtu记录
IotApi.DtuApiclassesDtuPost_0POST /classes/dtu新增dtu记录
IotApi.FilesApifilesFilenamePostPOST /files/{filename}文件上传
IotApi.LogApiclassesLogGetGET /classes/Log查询Log数据
IotApi.LogApiclassesLogIdDeleteDELETE /classes/Log/{id}通过ID删除Log
IotApi.LogApiclassesLogIdGetGET /classes/Log/{id}通过ID获取Log
IotApi.LogApiclassesLogIdPutPUT /classes/Log/{id}通过ID更新Log
IotApi.LogApiclassesLogPostPOST /classes/Log新增Log记录
IotApi.MenuApiclassesMenuGetGET /classes/Menu查询Menu数据
IotApi.MenuApiclassesMenuIdDeleteDELETE /classes/Menu/{id}通过ID删除Menu
IotApi.MenuApiclassesMenuIdGetGET /classes/Menu/{id}通过ID获取Menu
IotApi.MenuApiclassesMenuIdPutPUT /classes/Menu/{id}通过ID更新Menu
IotApi.MenuApiclassesMenuPostPOST /classes/Menu新增Menu记录
IotApi.NotificationApiclassesNotificationGetGET /classes/Notification查询Notification数据
IotApi.NotificationApiclassesNotificationIdDeleteDELETE /classes/Notification/{id}通过ID删除Notification
IotApi.NotificationApiclassesNotificationIdGetGET /classes/Notification/{id}通过ID获取Notification
IotApi.NotificationApiclassesNotificationIdPutPUT /classes/Notification/{id}通过ID更新Notification
IotApi.NotificationApiclassesNotificationPostPOST /classes/Notification新增Notification记录
IotApi.PumpDataApiclassesPumpDataGetGET /classes/PumpData查询PumpData数据
IotApi.PumpDataApiclassesPumpDataIdDeleteDELETE /classes/PumpData/{id}通过ID删除PumpData
IotApi.PumpDataApiclassesPumpDataIdGetGET /classes/PumpData/{id}通过ID获取PumpData
IotApi.PumpDataApiclassesPumpDataIdPutPUT /classes/PumpData/{id}通过ID更新PumpData
IotApi.PumpDataApiclassesPumpDataPostPOST /classes/PumpData新增PumpData记录
IotApi.ReportApiclassesReportGetGET /classes/Report查询Report数据
IotApi.ReportApiclassesReportIdDeleteDELETE /classes/Report/{id}通过ID删除Report
IotApi.ReportApiclassesReportIdGetGET /classes/Report/{id}通过ID获取Report
IotApi.ReportApiclassesReportIdPutPUT /classes/Report/{id}通过ID更新Report
IotApi.ReportApiclassesReportPostPOST /classes/Report新增Report记录
IotApi.RoleApiclassesRoleGetGET /classes/_Role查询_Role数据
IotApi.RoleApiclassesRoleIdDeleteDELETE /classes/_Role/{id}通过ID删除_Role
IotApi.RoleApiclassesRoleIdGetGET /classes/_Role/{id}通过ID获取_Role
IotApi.RoleApiclassesRoleIdPutPUT /classes/_Role/{id}通过ID更新_Role
IotApi.RoleApiclassesRolePostPOST /classes/_Role新增_Role记录
IotApi.SessionApiclassesSessionGetGET /classes/_Session查询_Session数据
IotApi.SessionApiclassesSessionIdDeleteDELETE /classes/_Session/{id}通过ID删除_Session
IotApi.SessionApiclassesSessionIdGetGET /classes/_Session/{id}通过ID获取_Session
IotApi.SessionApiclassesSessionIdPutPUT /classes/_Session/{id}通过ID更新_Session
IotApi.SessionApiclassesSessionPostPOST /classes/_Session新增_Session记录
IotApi.SmartdevhistoryApiclassesSmartdevhistoryGetGET /classes/smartdevhistory查询smartdevhistory数据
IotApi.SmartdevhistoryApiclassesSmartdevhistoryIdDeleteDELETE /classes/smartdevhistory/{id}通过ID删除smartdevhistory
IotApi.SmartdevhistoryApiclassesSmartdevhistoryIdGetGET /classes/smartdevhistory/{id}通过ID获取smartdevhistory
IotApi.SmartdevhistoryApiclassesSmartdevhistoryIdPutPUT /classes/smartdevhistory/{id}通过ID更新smartdevhistory
IotApi.SmartdevhistoryApiclassesSmartdevhistoryPostPOST /classes/smartdevhistory新增smartdevhistory记录
IotApi.SmartmeterApiclassesSmartmeterGetGET /classes/smartmeter查询smartmeter数据
IotApi.SmartmeterApiclassesSmartmeterIdDeleteDELETE /classes/smartmeter/{id}通过ID删除smartmeter
IotApi.SmartmeterApiclassesSmartmeterIdGetGET /classes/smartmeter/{id}通过ID获取smartmeter
IotApi.SmartmeterApiclassesSmartmeterIdPutPUT /classes/smartmeter/{id}通过ID更新smartmeter
IotApi.SmartmeterApiclassesSmartmeterPostPOST /classes/smartmeter新增smartmeter记录
IotApi.TestbedApiclassesTestbedGetGET /classes/Testbed查询Testbed数据
IotApi.TestbedApiclassesTestbedIdDeleteDELETE /classes/Testbed/{id}通过ID删除Testbed
IotApi.TestbedApiclassesTestbedIdGetGET /classes/Testbed/{id}通过ID获取Testbed
IotApi.TestbedApiclassesTestbedIdPutPUT /classes/Testbed/{id}通过ID更新Testbed
IotApi.TestbedApiclassesTestbedPostPOST /classes/Testbed新增Testbed记录
IotApi.TokenApigetTokenGetGET /get_token刷新token
IotApi.UserApiclassesUserGetGET /classes/_User查询_User数据
IotApi.UserApiclassesUserIdDeleteDELETE /classes/_User/{id}通过ID删除_User
IotApi.UserApiclassesUserIdGetGET /classes/_User/{id}通过ID获取_User
IotApi.UserApiclassesUserIdPutPUT /classes/_User/{id}通过ID更新_User
IotApi.UserApiclassesUserPostPOST /classes/_User新增_User记录

Documentation for Models

Documentation for Authorization

APIKeyHeader

  • Type: API key
  • API key parameter name: sessionToken
  • Location: HTTP header

APIKeyQueryParam

  • Type: API key
  • API key parameter name: sessionToken
  • Location: URL query string