-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add search actions for the models (#362)
* feat: add search actions for the models * test: add Bluetooth model to the cleanup list * docs: remove extra commas
- Loading branch information
Showing
10 changed files
with
533 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
--- | ||
code: true | ||
type: page | ||
title: searchAssets | ||
description: Searches for asset models | ||
--- | ||
|
||
# searchAssets | ||
|
||
Searches for asset models. | ||
|
||
--- | ||
|
||
## Query Syntax | ||
|
||
### HTTP | ||
|
||
```http | ||
URL: http://kuzzle:7512/_/device-manager/models/assets/_search | ||
Method: POST | ||
``` | ||
|
||
### Other protocols | ||
|
||
```js | ||
{ | ||
"controller": "device-manager/models", | ||
"action": "searchAssets", | ||
"engineGroup": "<engineGroup>", | ||
"body": { | ||
"query": { | ||
// ... | ||
}, | ||
"sort": [ | ||
// ... | ||
] | ||
}, | ||
|
||
// optional: | ||
"from": "<starting offset>", | ||
"size": "<page size>" | ||
} | ||
``` | ||
|
||
--- | ||
|
||
## Arguments | ||
|
||
- `engineGroup`: name of the engine group | ||
- `from`: paginates search results by defining the offset from the first result you want to fetch. Usually used with the `size` argument | ||
- `size`: set the maximum number of documents returned per result page | ||
|
||
## Body properties | ||
|
||
- `query`: the search query itself, using the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/query-dsl.html). | ||
- `sort`: contains a list of fields, used to [sort search results](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/search-request-sort.html), in order of importance. | ||
|
||
--- | ||
|
||
## Response | ||
|
||
```js | ||
{ | ||
"status": 200, | ||
"error": null, | ||
"controller": "device-manager/models", | ||
"action": "searchAssets", | ||
"requestId": "<unique request identifier>", | ||
"result": { | ||
"hits": [ | ||
{ | ||
"_id": "<assetModelId>", | ||
"_source": { | ||
// Asset model content | ||
}, | ||
}, | ||
], | ||
"total": 42 | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
code: true | ||
type: page | ||
title: searchDevices | ||
description: Searches for device models | ||
--- | ||
|
||
# searchDevices | ||
|
||
Searches for device models. | ||
|
||
--- | ||
|
||
## Query Syntax | ||
|
||
### HTTP | ||
|
||
```http | ||
URL: http://kuzzle:7512/_/device-manager/models/devices/_search | ||
Method: POST | ||
``` | ||
|
||
### Other protocols | ||
|
||
```js | ||
{ | ||
"controller": "device-manager/models", | ||
"action": "searchDevices", | ||
"body": { | ||
"query": { | ||
// ... | ||
}, | ||
"sort": [ | ||
// ... | ||
] | ||
}, | ||
|
||
// optional: | ||
"from": "<starting offset>", | ||
"size": "<page size>" | ||
} | ||
``` | ||
|
||
--- | ||
|
||
## Arguments | ||
|
||
- `from`: paginates search results by defining the offset from the first result you want to fetch. Usually used with the `size` argument | ||
- `size`: set the maximum number of documents returned per result page | ||
|
||
## Body properties | ||
|
||
- `query`: the search query itself, using the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/query-dsl.html). | ||
- `sort`: contains a list of fields, used to [sort search results](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/search-request-sort.html), in order of importance. | ||
|
||
--- | ||
|
||
## Response | ||
|
||
```js | ||
{ | ||
"status": 200, | ||
"error": null, | ||
"controller": "device-manager/models", | ||
"action": "searchDevices", | ||
"requestId": "<unique request identifier>", | ||
"result": { | ||
"hits": [ | ||
{ | ||
"_id": "<deviceModelId>", | ||
"_source": { | ||
// Device model content | ||
}, | ||
}, | ||
], | ||
"total": 42 | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
code: true | ||
type: page | ||
title: searchMeasures | ||
description: Searches for measure models | ||
--- | ||
|
||
# searchMeasures | ||
|
||
Searches for measure models. | ||
|
||
--- | ||
|
||
## Query Syntax | ||
|
||
### HTTP | ||
|
||
```http | ||
URL: http://kuzzle:7512/_/device-manager/models/measures/_search | ||
Method: POST | ||
``` | ||
|
||
### Other protocols | ||
|
||
```js | ||
{ | ||
"controller": "device-manager/models", | ||
"action": "searchMeasures", | ||
"body": { | ||
"query": { | ||
// ... | ||
}, | ||
"sort": [ | ||
// ... | ||
] | ||
}, | ||
|
||
// optional: | ||
"from": "<starting offset>", | ||
"size": "<page size>" | ||
} | ||
``` | ||
|
||
--- | ||
|
||
## Arguments | ||
|
||
- `from`: paginates search results by defining the offset from the first result you want to fetch. Usually used with the `size` argument | ||
- `size`: set the maximum number of documents returned per result page | ||
|
||
## Body properties | ||
|
||
- `query`: the search query itself, using the [ElasticSearch Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/query-dsl.html). | ||
- `sort`: contains a list of fields, used to [sort search results](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/search-request-sort.html), in order of importance. | ||
|
||
--- | ||
|
||
## Response | ||
|
||
```js | ||
{ | ||
"status": 200, | ||
"error": null, | ||
"controller": "device-manager/models", | ||
"action": "searchMeasures", | ||
"requestId": "<unique request identifier>", | ||
"result": { | ||
"hits": [ | ||
{ | ||
"_id": "<measureModelId>", | ||
"_source": { | ||
// Measure model content | ||
}, | ||
}, | ||
], | ||
"total": 42 | ||
} | ||
} | ||
``` |
Oops, something went wrong.