2017-08-31 18:19:08 +00:00
|
|
|
---
|
|
|
|
layout: api
|
|
|
|
page_title: Network Segments - Operator - HTTP API
|
|
|
|
sidebar_current: api-operator-segment
|
|
|
|
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.
|
|
|
|
---
|
|
|
|
|
|
|
|
# Network Areas - Operator HTTP API
|
|
|
|
|
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.
|
|
|
|
|
2017-09-01 00:39:57 +00:00
|
|
|
~> **Enterprise-only!** This API endpoint and functionality only exists in
|
2017-08-31 18:19:08 +00:00
|
|
|
Consul Enterprise. This is not present in the open source version of Consul.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
2019-04-01 20:01:00 +00:00
|
|
|
Please see the [Network Segments Guide](/docs/guides/network-segments.html) for more details.
|
2017-08-31 18:19:08 +00:00
|
|
|
|
|
|
|
## List Network Segments
|
|
|
|
|
|
|
|
This endpoint lists all network areas.
|
|
|
|
|
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------ | ---------------------------- | -------------------------- |
|
2017-09-01 19:34:27 +00:00
|
|
|
| `GET` | `/operator/segment` | `application/json` |
|
2017-08-31 18:19:08 +00:00
|
|
|
|
|
|
|
The table below shows this endpoint's support for
|
|
|
|
[blocking queries](/api/index.html#blocking-queries),
|
2018-09-06 10:34:28 +00:00
|
|
|
[consistency modes](/api/index.html#consistency-modes),
|
|
|
|
[agent caching](/api/index.html#agent-caching), and
|
2017-08-31 18:19:08 +00:00
|
|
|
[required ACLs](/api/index.html#acls).
|
|
|
|
|
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
|
|
|
|
|
|
|
### 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
|
|
|
|
|
|
|
|
```text
|
|
|
|
$ 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
|
|
|
|
["","alpha","beta"]
|
2019-04-01 20:01:00 +00:00
|
|
|
```
|