-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to create an engine? #327
Comments
Hello, we are currently working on a new documentation that will be much more precise on how to initialise the device manager plugin. But you should be able to create an engine using this piece of code. this.app.sdk
.query({
action: 'create',
controller: `device-manager/engine`,
group,
index,
})
.catch((error) => {
this.app.log.error(`[${index}] Cannot ${action} ${plugin} engine: ${error}`);
throw error;
}); The device manager is an open source plugin, there is no need to have a paid plugin to setup engine |
Thank you @rolljee . |
I tried successfully creating the engine, then I created the POST http://localhost:7512/_/device-manager/models/assets
Authorization: Bearer xxxx
{
"engineGroup":"esp",
"model":"Distiller",
"measures": [
{
"name": "temperature",
"type": "float"
},
{
"name": "humidity",
"type": "float"
}
]
} But the server responded back error, I know {
"action": "writeAsset",
"controller": "device-manager/models",
"error": {
"code": 33619971,
"id": "api.assert.missing_argument",
"message": "Missing argument \"index, collection or targets\".",
"props": [
"index, collection or targets"
],
"stack": "BadRequestError: Missing argument \"index, collection or targets\".\n [...Kuzzle internal calls deleted...]\n at DocumentController.search (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle/lib/api/controllers/documentController.js:92:20)\n at doAction (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle/lib/api/funnel.js:1079:47)\n at Funnel.executePluginRequest (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle/lib/api/funnel.js:756:20)\n at FunnelProtocol.query (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle/lib/core/shared/sdk/funnelProtocol.js:95:51)\n at Proxy._timeoutRequest (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle-sdk/src/Kuzzle.js:763:34)\n at Proxy.query (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle-sdk/src/Kuzzle.js:591:21)\n at Proxy.query (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle/lib/core/shared/sdk/embeddedSdk.js:132:22)\n at AssetService.refreshModel (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle-device-manager/lib/modules/asset/AssetService.ts:333:35)\n at async Kuzzle.ask (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle/lib/kuzzle/event/kuzzleEventEmitter.js:229:22)\n at async ModelService.writeAsset (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle-device-manager/lib/modules/model/ModelService.ts:106:5)\n at async ModelsController.writeAsset (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle-device-manager/lib/modules/model/ModelsController.ts:115:24)\n at async Funnel.processRequest (/home/xdien/workspace/next-iot/backend/node_modules/kuzzle/lib/api/funnel.js:668:28)",
"status": 400
},
"headers": {},
"node": "knode-bored-maugrim-14974",
"requestId": "7afe4c19-d9d2-417e-907c-90908ff3e827",
"result": null,
"status": 400,
"volatile": null
} |
I was able to create the asset but the error was because I filled in the wrong engineGroup "engineGroup":"esp", |
Hello kuzzle
:engineId
but in the documentation there is no mention of creating an engine? Is it a paid plugin?Thank you
The text was updated successfully, but these errors were encountered: