OpenapiO11y
Saves a new explorer view for the caller's org and returns its id.
Saves a new explorer view for the caller's org and returns its id.
POST /v1/o11y/explorer/views
| Address | https://api.hanzo.ai/v1/o11y/explorer/views |
| Method | POST |
| Operation | post_o11y_explorer_views |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Saves a new explorer view for the caller's org and returns its id.
Callers need the editor role; the runtime's own gate enforces it.
Request
90 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
category | body | string | — | |
compositeQuery | body | o11y.CompositeQuery | — | |
compositeQuery.builderQueries | body | object | — | |
compositeQuery.builderQueries.* | body | o11y.BuilderQuery | — | |
compositeQuery.builderQueries.*.IsAnomaly | body | boolean | — | |
compositeQuery.builderQueries.*.QueriesUsedInFormula | body | string[] | — | |
compositeQuery.builderQueries.*.ShiftBy | body | integer | — | |
compositeQuery.builderQueries.*.aggregateAttribute | body | o11y.AttributeKey | — | |
compositeQuery.builderQueries.*.aggregateAttribute.dataType | body | string | — | |
compositeQuery.builderQueries.*.aggregateAttribute.isColumn | body | boolean | — | |
compositeQuery.builderQueries.*.aggregateAttribute.isJSON | body | boolean | — | |
compositeQuery.builderQueries.*.aggregateAttribute.key | body | string | — | |
compositeQuery.builderQueries.*.aggregateAttribute.type | body | string | — | |
compositeQuery.builderQueries.*.aggregateOperator | body | string | — | |
compositeQuery.builderQueries.*.dataSource | body | string | — | |
compositeQuery.builderQueries.*.disabled | body | boolean | — | |
compositeQuery.builderQueries.*.expression | body | string | — | |
compositeQuery.builderQueries.*.filters | body | o11y.FilterSet | — | |
compositeQuery.builderQueries.*.filters.items | body | o11y.FilterItem[] | — | |
compositeQuery.builderQueries.*.filters.items[].key | body | o11y.AttributeKey | — | |
compositeQuery.builderQueries.*.filters.items[].key.dataType | body | string | — | |
compositeQuery.builderQueries.*.filters.items[].key.isColumn | body | boolean | — | |
compositeQuery.builderQueries.*.filters.items[].key.isJSON | body | boolean | — | |
compositeQuery.builderQueries.*.filters.items[].key.key | body | string | — | |
compositeQuery.builderQueries.*.filters.items[].key.type | body | string | — | |
compositeQuery.builderQueries.*.filters.items[].op | body | string | — | |
compositeQuery.builderQueries.*.filters.items[].value | body | object | — | |
compositeQuery.builderQueries.*.filters.op | body | string | — | |
compositeQuery.builderQueries.*.functions | body | o11y.Function[] | — | |
compositeQuery.builderQueries.*.functions[].args | body | object[] | — | |
compositeQuery.builderQueries.*.functions[].name | body | string | — | |
compositeQuery.builderQueries.*.functions[].namedArgs | body | object | — | |
compositeQuery.builderQueries.*.functions[].namedArgs.* | body | object | — | |
compositeQuery.builderQueries.*.groupBy | body | o11y.AttributeKey[] | — | |
compositeQuery.builderQueries.*.groupBy[].dataType | body | string | — | |
compositeQuery.builderQueries.*.groupBy[].isColumn | body | boolean | — | |
compositeQuery.builderQueries.*.groupBy[].isJSON | body | boolean | — | |
compositeQuery.builderQueries.*.groupBy[].key | body | string | — | |
compositeQuery.builderQueries.*.groupBy[].type | body | string | — | |
compositeQuery.builderQueries.*.having | body | o11y.Having[] | — | |
compositeQuery.builderQueries.*.having[].columnName | body | string | — | |
compositeQuery.builderQueries.*.having[].op | body | string | — | |
compositeQuery.builderQueries.*.having[].value | body | object | — | |
compositeQuery.builderQueries.*.legend | body | string | — | |
compositeQuery.builderQueries.*.limit | body | integer | — | |
compositeQuery.builderQueries.*.offset | body | integer | — | |
compositeQuery.builderQueries.*.orderBy | body | o11y.OrderBy[] | — | |
compositeQuery.builderQueries.*.orderBy[].columnName | body | string | — | |
compositeQuery.builderQueries.*.orderBy[].order | body | string | — | |
compositeQuery.builderQueries.*.pageSize | body | integer | — | |
compositeQuery.builderQueries.*.queryName | body | string | — | |
compositeQuery.builderQueries.*.reduceTo | body | string | — | |
compositeQuery.builderQueries.*.selectColumns | body | o11y.AttributeKey[] | — | |
compositeQuery.builderQueries.*.selectColumns[].dataType | body | string | — | |
compositeQuery.builderQueries.*.selectColumns[].isColumn | body | boolean | — | |
compositeQuery.builderQueries.*.selectColumns[].isJSON | body | boolean | — | |
compositeQuery.builderQueries.*.selectColumns[].key | body | string | — | |
compositeQuery.builderQueries.*.selectColumns[].type | body | string | — | |
compositeQuery.builderQueries.*.seriesAggregation | body | string | — | |
compositeQuery.builderQueries.*.spaceAggregation | body | string | — | |
compositeQuery.builderQueries.*.stepInterval | body | integer | — | |
compositeQuery.builderQueries.*.temporality | body | string | — | |
compositeQuery.builderQueries.*.timeAggregation | body | string | — | |
compositeQuery.chQueries | body | object | — | |
compositeQuery.chQueries.* | body | o11y.DatastoreQuery | — | |
compositeQuery.chQueries.*.disabled | body | boolean | — | |
compositeQuery.chQueries.*.legend | body | string | — | |
compositeQuery.chQueries.*.query | body | string | — | |
compositeQuery.fillGaps | body | boolean | — | FillGaps is used to fill the gaps in the time series data |
compositeQuery.panelType | body | string | — | |
compositeQuery.promQueries | body | object | — | |
compositeQuery.promQueries.* | body | o11y.PromQuery | — | |
compositeQuery.promQueries.*.disabled | body | boolean | — | |
compositeQuery.promQueries.*.legend | body | string | — | |
compositeQuery.promQueries.*.query | body | string | — | |
compositeQuery.promQueries.*.stats | body | string | — | |
compositeQuery.queries | body | o11y.QueryEnvelope[] | — | |
compositeQuery.queries[].spec | body | object | — | Spec is the deferred decoding of the query if any. |
compositeQuery.queries[].type | body | any | — | Type is the type of the query. |
compositeQuery.queryType | body | string | — | |
compositeQuery.unit | body | string | — | Unit for the time series data shown in the graph This is used in alerts to format the value and threshold |
createdAt | body | string (date-time) | — | |
createdBy | body | string | — | |
extraData | body | string | — | ExtraData is JSON encoded data used by frontend to store additional data |
id | body | any | — | |
name | body | string | — | |
sourcePage | body | string | — | |
tags | body | string[] | — | |
updatedAt | body | string (date-time) | — | |
updatedBy | body | string | — |
Response
| Status | Body | Meaning |
|---|---|---|
200 | o11y.O11ySavedViewCreateOut | ok |
200 body — 2 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
data | body | any | — | Data is the new view's id. |
status | body | string | — | Status is "success". |
Failure carries the platform error shape — see Errors.
Examples
hanzo o11y explorer views createimport { Configuration, O11yApi } from 'hanzoai';
const api = new O11yApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postO11yExplorerViews({ category: "<category>", compositeQuery: {"builderQueries":{},"chQueries":{},"fillGaps":false,"panelType":"<panelType>"} });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import O11yApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = O11yApi(client).post_o11y_explorer_views(category="<category>", composite_query={"builderQueries":{},"chQueries":{},"fillGaps":false,"panelType":"<panelType>"})cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.O11yAPI.PostO11yExplorerViews(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, o11y_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = o11y_api::post_o11y_explorer_views(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.O11yApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new O11yApi(client).postO11yExplorerViews();curl -X POST https://api.hanzo.ai/v1/o11y/explorer/views \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"category": "<category>",
"compositeQuery": {
"builderQueries": {},
"chQueries": {},
"fillGaps": false,
"panelType": "<panelType>"
}
}'The door reaches o11y through the o11y tool, which names its 340 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "get_o11y_alert_last"
}
}
}'How is this guide?