2017-08-31 18:19:08 +00:00
|
|
|
---
|
|
|
|
layout: api
|
|
|
|
page_title: Network Segments - Operator - HTTP API
|
|
|
|
description: |-
|
2017-09-01 19:42:54 +00:00
|
|
|
The /operator/segment endpoint exposes the network segment information via
|
2017-08-31 18:19:08 +00:00
|
|
|
Consul's HTTP API.
|
|
|
|
---
|
|
|
|
|
2021-10-21 00:37:01 +00:00
|
|
|
# Network Segments - Operator HTTP API
|
2017-08-31 18:19:08 +00:00
|
|
|
|
2020-04-23 22:13:18 +00:00
|
|
|
<EnterpriseAlert />
|
|
|
|
|
2017-09-01 19:42:54 +00:00
|
|
|
The `/operator/segment` endpoint provides tools to manage network segments via
|
2017-08-31 18:19:08 +00:00
|
|
|
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.
|
|
|
|
|
2020-08-17 16:20:02 +00:00
|
|
|
Please check the [Network Segments tutorial](https://learn.hashicorp.com/tutorials/consul/network-partition-datacenters) for more details.
|
2017-08-31 18:19:08 +00:00
|
|
|
|
|
|
|
## List Network Segments
|
|
|
|
|
|
|
|
This endpoint lists all network areas.
|
|
|
|
|
2020-04-06 20:27:35 +00:00
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------ | ------------------- | ------------------ |
|
|
|
|
| `GET` | `/operator/segment` | `application/json` |
|
2017-08-31 18:19:08 +00:00
|
|
|
|
|
|
|
The table below shows this endpoint's support for
|
2022-03-30 21:16:26 +00:00
|
|
|
[blocking queries](/api-docs/features/blocking),
|
|
|
|
[consistency modes](/api-docs/features/consistency),
|
|
|
|
[agent caching](/api-docs/features/caching), and
|
2022-09-14 22:45:42 +00:00
|
|
|
[required ACLs](/api-docs#authentication).
|
2017-08-31 18:19:08 +00:00
|
|
|
|
2018-09-06 10:34:28 +00:00
|
|
|
| Blocking Queries | Consistency Modes | Agent Caching | ACL Required |
|
|
|
|
| ---------------- | ----------------- | ------------- | --------------- |
|
|
|
|
| `NO` | `none` | `none` | `operator:read` |
|
2017-08-31 18:19:08 +00:00
|
|
|
|
2022-05-10 15:51:11 +00:00
|
|
|
### Query Parameters
|
2017-08-31 18:19:08 +00:00
|
|
|
|
|
|
|
- `dc` `(string: "")` - Specifies the datacenter to query. This will default to
|
2022-05-10 15:51:11 +00:00
|
|
|
the datacenter of the agent being queried.
|
2017-08-31 18:19:08 +00:00
|
|
|
|
|
|
|
### Sample Request
|
|
|
|
|
2020-05-19 18:32:38 +00:00
|
|
|
```shell-session
|
2017-08-31 18:19:08 +00:00
|
|
|
$ curl \
|
2018-08-28 16:07:15 +00:00
|
|
|
http://127.0.0.1:8500/v1/operator/segment
|
2017-08-31 18:19:08 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
```json
|
2020-04-06 20:27:35 +00:00
|
|
|
["", "alpha", "beta"]
|
2019-04-01 20:01:00 +00:00
|
|
|
```
|