Returns one overlay network by id, scoped to the caller's org.
Returns one overlay network by id, scoped to the caller's org.
GET /v1/network/{id}
| Address | https://api.hanzo.ai/v1/network/{id} |
| Method | GET |
| Operation | get_network_by_id |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Returns one overlay network by id, scoped to the caller's org.
The org has exactly one overlay network and its id is derived from the org, so any other id — another tenant's, or one that does not exist — is 404 rather than a peek across the tenant boundary. An org whose network exists but has no edge-routers is 404 too, for the same reason the list is empty: there is no overlay until something is on it.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | ID is the network id from the path. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | networkView | ok |
200 body — 4 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
id | body | string | — | ID is the org-derived id of the overlay network — the key GET /v1/network/{id} addresses. |
name | body | string | — | Name is the org the overlay belongs to. |
nodes | body | integer | — | Nodes is how many edge-routers the org has on the fabric. |
status | body | string | — | Status is "connected" once at least one of the org's edge-routers is online, else "provisioning" (routers exist but none has dialed home). |
Failure carries the platform error shape — see Errors.
Examples
hanzo networks get <id>import { Configuration, NetworkApi } from 'hanzoai';
const api = new NetworkApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getNetworkById({ id: 'id' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import NetworkApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = NetworkApi(client).get_network_by_id(id='id')cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.NetworkAPI.GetNetworkById(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, network_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = network_api::get_network_by_id(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.NetworkApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new NetworkApi(client).getNetworkById();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/network/<id> \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches network through the zt tool, which names its 4 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": "list_mesh_services"
}
}
}'How is this guide?