Returns one stream's configuration and live state.
Returns one stream's configuration and live state.
GET /v1/mq/stream/{name}
| Address | https://api.hanzo.ai/v1/mq/stream/{name} |
| Method | GET |
| Operation | get_mq_stream_by_name |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Returns one stream's configuration and live state.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
name | path | string | yes | Name is the stream name, from the path. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | Stream | ok |
200 body — 22 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
config | body | Config | — | |
config.max_age | body | string | — | MaxAge caps message age, e.g. |
config.max_bytes | body | integer | — | MaxBytes caps the stream's total stored bytes; -1 (default) is unlimited. |
config.max_msg_size | body | integer | — | MaxMsgSize caps one message's size in bytes; -1 (default) is the broker's limit. |
config.max_msgs | body | integer | — | MaxMsgs caps the number of stored messages; -1 (default) is unlimited. |
config.name | body | string | — | Name is the stream name, unique within the org (alphanumeric, hyphens, underscores). |
config.num_replicas | body | integer | — | Replicas is the number of stream replicas (1–5); this plane runs 1. |
config.retention | body | string | — | Retention is the retention policy: limits (default), interest, or workqueue. |
config.storage | body | string | — | Storage is the storage backend: file (default) or memory. |
config.subjects | body | string[] | — | Subjects are the org-relative subjects bound to this stream (wildcards supported). |
created | body | string (date-time) | — | Created is when the stream was created. |
name | body | string | — | Name is the stream name within the org. |
state | body | State | — | |
state.bytes | body | integer | — | Bytes is the total stored size. |
state.consumer_count | body | integer | — | Consumers is the number of consumers attached to this stream. |
state.first_seq | body | integer | — | FirstSeq is the sequence of the first stored message. |
state.first_ts | body | string (date-time) | — | FirstTS is the timestamp of the first stored message. |
state.last_seq | body | integer | — | LastSeq is the sequence of the last stored message. |
state.last_ts | body | string (date-time) | — | LastTS is the timestamp of the last stored message. |
state.messages | body | integer | — | Messages is the number of messages currently stored. |
state.num_deleted | body | integer | — | Deleted is the number of deleted messages (sequence gaps). |
state.num_subjects | body | integer | — | Subjects is the number of distinct subjects stored. |
Failure carries the platform error shape — see Errors.
Examples
hanzo has no subcommand for this operation — the CLI serves only what cloud's live route table confirms. Use HTTP or an SDK.
import { Configuration, MqApi } from 'hanzoai';
const api = new MqApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getMqStreamByName({ name: 'name' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import MqApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = MqApi(client).get_mq_stream_by_name(name='name')cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.MqAPI.GetMqStreamByName(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, mq_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = mq_api::get_mq_stream_by_name(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.MqApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new MqApi(client).getMqStreamByName();The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
curl https://api.hanzo.ai/v1/mq/stream/<name> \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches mq through the mq tool, which names its 15 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_mq_health"
}
}
}'How is this guide?