open-consul/website/content/commands/config/read.mdx

72 lines
2.2 KiB
Plaintext
Raw Normal View History

---
layout: commands
2020-04-07 18:55:19 +00:00
page_title: 'Commands: Config Read'
description: >-
The `consul config read` outputs the JSON representation of a configuration entry identified by kind or name.
---
# Consul Config Read
Command: `consul config read`
Corresponding HTTP API Endpoint: [\[GET\] /v1/config/:kind/:name](/consul/api-docs/config#get-configuration)
The `config read` command reads the config entry specified by the given
kind and name and outputs its JSON representation. See the
[configuration entries docs](/consul/docs/agent/config-entries) for more
details about configuration entries.
The table below shows this command's [required ACLs](/consul/api-docs/api-structure#authentication). Configuration of
[blocking queries](/consul/api-docs/features/blocking) and [agent caching](/consul/api-docs/features/caching)
are not supported from commands, but may be from the corresponding HTTP endpoint.
| ACL Required<sup>1</sup> |
| ------------------------------------- |
| `service:read`<br />`intentions:read` |
<sup>1</sup> The ACL required depends on the config entry kind being read:
| Config Entry Kind | Required ACL |
| ------------------- | ----------------- |
| ingress-gateway | `service:read` |
| proxy-defaults | `<none>` |
| service-defaults | `service:read` |
| service-intentions | `intentions:read` |
| service-resolver | `service:read` |
| service-router | `service:read` |
| service-splitter | `service:read` |
| terminating-gateway | `service:read` |
## Usage
Usage: `consul config read [options]`
#### Config Read Options
- `-kind` - Specifies the kind of the config entry to read.
- `-name` - Specifies the name of the config entry to read. The name of the
`proxy-defaults` config entry must be `global`, and the name of the `mesh`
config entry must be `mesh`.
#### Enterprise Options
@include 'http_api_partition_options.mdx'
@include 'http_api_namespace_options.mdx'
#### API Options
@include 'http_api_options_client.mdx'
## Examples
$ consul config read -kind service-defaults -name web
{
"Kind": "service-defaults",
"Name": "web",
"Protocol": "http",
"CreateIndex": 13,
"ModifyIndex": 13
}