QueryContextModel
Queries the content of a semantic model by using SPL.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
log:QueryContextModel |
list |
*ContextModel
|
None | None |
Request syntax
POST /context-models/{name}/query HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| name |
string |
No |
The identifier of the context model to be queried. It is obtained from the request path /context-models/{name}/query. Only uppercase and lowercase letters, digits, underscores (_), and hyphens (-) are supported. |
orders |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body. A JSON object that contains an SPL query for the element definitions of the model. |
|
| query |
string |
Yes |
The SPL query statement. This parameter is required and cannot be an empty string. Otherwise, a 400 error is returned. It uses .umodel as the data source to query the element definitions of the model. Pipeline operations such as where, project, and limit are supported. Example: .umodel | where kind = 'log_set' | limit 50. |
.umodel | where kind = 'log_set' | limit 50 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response body that contains the column names and data rows matched by the query. |
||
| data |
array |
The array of result rows. Each row is an array whose elements correspond one-to-one in order with the header. An empty array [] is returned if no matches are found. |
|
|
array |
A result row. The order of the elements corresponds one-to-one with the column names in the header. |
||
|
string |
The cell value, which is always a string. The values in the metadata, schema, and spec columns are JSON strings that the caller must parse. |
log_set |
|
| header |
array |
The array of column names. The columns vary based on the projection in the SPL query. If no explicit projection is specified, the default columns are kind, metadata, schema, and spec. |
|
|
string |
The column name. |
kind |
Examples
Success response
JSON format
{
"data": [
[
"log_set"
]
],
"header": [
"kind"
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.