mirror of https://github.com/status-im/consul.git
59 lines
1.8 KiB
Plaintext
59 lines
1.8 KiB
Plaintext
---
|
|
layout: api
|
|
page_title: Network Segments - Operator - HTTP API
|
|
description: |-
|
|
The /operator/segment endpoint exposes the network segment information via
|
|
Consul's HTTP API.
|
|
---
|
|
|
|
# Network Segments - Operator HTTP API
|
|
|
|
<EnterpriseAlert />
|
|
|
|
The `/operator/segment` endpoint provides tools to manage network segments via
|
|
Consul's HTTP API.
|
|
|
|
The network area functionality described here is available only in
|
|
[Consul Enterprise](https://www.hashicorp.com/products/consul/) version 0.9.3 and
|
|
later. Network segments are operator-defined sections of agents on the LAN, typically
|
|
isolated from other segments by network configuration.
|
|
|
|
Please check the [Network Segments tutorial](https://learn.hashicorp.com/tutorials/consul/network-partition-datacenters) for more details.
|
|
|
|
## List Network Segments
|
|
|
|
This endpoint lists all network areas.
|
|
|
|
| Method | Path | Produces |
|
|
| ------ | ------------------- | ------------------ |
|
|
| `GET` | `/operator/segment` | `application/json` |
|
|
|
|
The table below shows this endpoint's support for
|
|
[blocking queries](/api-docs/features/blocking),
|
|
[consistency modes](/api-docs/features/consistency),
|
|
[agent caching](/api-docs/features/caching), and
|
|
[required ACLs](/api#authentication).
|
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
| ---------------- | ----------------- | ------------- | --------------- |
|
|
| `NO` | `none` | `none` | `operator:read` |
|
|
|
|
### Parameters
|
|
|
|
- `dc` `(string: "")` - Specifies the datacenter to query. This will default to
|
|
the datacenter of the agent being queried. This is specified as a URL query
|
|
parameter.
|
|
|
|
### Sample Request
|
|
|
|
```shell-session
|
|
$ curl \
|
|
http://127.0.0.1:8500/v1/operator/segment
|
|
```
|
|
|
|
### Sample Response
|
|
|
|
```json
|
|
["", "alpha", "beta"]
|
|
```
|