update dependencies

pull/7945/head
Jeff Escalante 2020-05-19 14:32:38 -04:00
parent b14696e32a
commit 326ec30d68
175 changed files with 1696 additions and 3660 deletions

View File

@ -1,22 +0,0 @@
// If there is a hash in the url, this script will check whether the hash matches
// the anchor link IDs for any element on the page and log it to our analytics.
export default function anchorLinkAnalytics() {
if (
typeof window === 'undefined' ||
!window.requestIdleCallback ||
!window.analytics
)
return
window.requestIdleCallback(() => {
const hash = window.location.hash
if (hash.length < 1) return
const targets = [].slice.call(
document.querySelectorAll('.__target-lic, .__target-h')
)
const targetMatch = targets.find((t) => t.id === hash.replace(/^#/, ''))
window.analytics.track('Anchor Link', { hash, hit: !!targetMatch })
})
}

View File

@ -1,18 +0,0 @@
import React from 'react'
import Bugsnag from '@bugsnag/js'
import BugsnagReact from '@bugsnag/plugin-react'
const apiKey =
typeof window === 'undefined'
? 'be8ed0d0fc887d547284cce9e98e60e5' // server key
: '01625078d856ef022c88f0c78d2364f1' // client key
if (!Bugsnag._client) {
Bugsnag.start({
apiKey,
plugins: [new BugsnagReact(React)],
otherOptions: { releaseStage: process.env.NODE_ENV || 'development' },
})
}
export default Bugsnag

View File

@ -1,76 +0,0 @@
const isProd = process.env.NODE_ENV === 'production'
const segmentWriteKey = isProd
? 'IyzLrqXkox5KJ8XL4fo8vTYNGfiKlTCm'
: '0EXTgkNx0Ydje2PGXVbRhpKKoe5wtzcE'
// TODO: refactor into web components
let utilityServerRoot = isProd
? 'https://util.hashicorp.com'
: 'https://hashicorp-web-util-staging.herokuapp.com'
if (process.env.UTIL_SERVER) {
utilityServerRoot = process.env.UTIL_SERVER.replace(/\/$/, '')
}
// Consent manager configuration
export default {
version: 3,
container: '#consent-manager',
companyName: 'HashiCorp',
privacyPolicyLink: 'https://hashicorp.com/privacy',
segmentWriteKey: segmentWriteKey,
utilServerRoot: utilityServerRoot,
segmentServices: [
{
key: 'googleanalytics',
name: 'Google Analytics',
description:
'Google Analytics is a popular service for tracking web traffic. We use this data to determine what content our users find important so that we can dedicate more resources toward it.',
category: 'Analytics',
},
{
name: 'Hotjar',
description:
'Hotjar is a service that generates heatmaps of where users click on our sites. We use this information to ensure that our site is not confusing, and simple to use and navigate.',
category: 'Analytics',
},
{
name: 'LinkedIn Insight Tag',
description:
'This small script allows us to see how effective our linkedin campaigns are by showing which users have clicked through to our site.',
category: 'Analytics',
},
{
name: 'Marketo V2',
description:
'Marketo is a marketing automation tool that allows us to segment users into different categories based off of their behaviors. We use this information to provide tailored information to users in our email campaigns.',
},
],
categories: [
{
name: 'Functional',
description:
'Functional services provide a utility to the website, such as the ability to log in, or to get live support. Disabling any of these scripts will cause that utility to be missing from the site.',
},
{
name: 'Analytics',
description:
'Analytics services keep track of page traffic and user behavior while browsing the site. We use this data internally to improve the usability and performance of the site. Disabling any of these scripts makes it more difficult for us to understand how our site is being used, and slower to improve it.',
},
{
name: 'Email Marketing',
description:
'Email Marketing services track user behavior while browsing the site. We use this data internally in our marketing efforts to provide users contextually relevant information based off of their behaviors. Disabling any of these scripts makes it more difficult for us to provide you contextually relevant information.',
},
],
additionalServices: [
{
name: 'OptinMonster',
description:
"OptinMonster is a service that we use to show a prompt to sign up for our newsletter if it's perceived that you are interested in our content.",
category: 'Functional',
body: `var om598c8e3a6e43d,om598c8e3a6e43d_poll=function(){var r=0;return function(n,l){clearInterval(r),r=setInterval(n,l)}}();!function(e,t,n){if(e.getElementById(n)){om598c8e3a6e43d_poll(function(){if(window['om_loaded']){if(!om598c8e3a6e43d){om598c8e3a6e43d=new OptinMonsterApp();return om598c8e3a6e43d.init({"s":"35109.598c8e3a6e43d","staging":0,"dev":0,"beta":0});}}},25);return;}var d=false,o=e.createElement(t);o.id=n,o.src="https://a.optnmstr.com/app/js/api.min.js",o.async=true,o.onload=o.onreadystatechange=function(){if(!d){if(!this.readyState||this.readyState==="loaded"||this.readyState==="complete"){try{d=om_loaded=true;om598c8e3a6e43d=new OptinMonsterApp();om598c8e3a6e43d.init({"s":"35109.598c8e3a6e43d","staging":0,"dev":0,"beta":0});o.onload=o.onreadystatechange=null;}catch(t){}}}};(document.getElementsByTagName("head")[0]||document.documentElement).appendChild(o)}(document,"script","omapi-script");`,
},
],
}

View File

@ -16,6 +16,9 @@ module.exports = withHashicorp({
], ],
}, },
env: { env: {
HASHI_ENV: process.env.HASHI_ENV, HASHI_ENV: process.env.HASHI_ENV || 'development',
SEGMENT_WRITE_KEY: 'IyzLrqXkox5KJ8XL4fo8vTYNGfiKlTCm',
BUGSNAG_CLIENT_KEY: '01625078d856ef022c88f0c78d2364f1',
BUGSNAG_SERVER_KEY: 'be8ed0d0fc887d547284cce9e98e60e5',
}, },
}) })

3418
website/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@
"@bugsnag/js": "^7.0.1", "@bugsnag/js": "^7.0.1",
"@bugsnag/plugin-react": "^7.0.1", "@bugsnag/plugin-react": "^7.0.1",
"@hashicorp/mktg-assets": "^1.0.0-alpha.7", "@hashicorp/mktg-assets": "^1.0.0-alpha.7",
"@hashicorp/nextjs-scripts": "^6.1.0", "@hashicorp/nextjs-scripts": "^7.2.1",
"@hashicorp/react-alert": "^2.0.0", "@hashicorp/react-alert": "^2.0.0",
"@hashicorp/react-alert-banner": "^3.0.13", "@hashicorp/react-alert-banner": "^3.0.13",
"@hashicorp/react-button": "^2.1.9", "@hashicorp/react-button": "^2.1.9",

32
website/pages/404.jsx Normal file
View File

@ -0,0 +1,32 @@
import Link from 'next/link'
import { useEffect } from 'react'
export default function NotFound() {
useEffect(() => {
if (
typeof window !== 'undefined' &&
typeof window?.analytics?.track === 'function' &&
typeof window?.document?.referrer === 'string' &&
typeof window?.location?.href === 'string'
)
window.analytics.track(window.location.href, {
category: '404 Response',
label: window.document.referrer || 'No Referrer',
})
}, [])
return (
<div id="p-404">
<h1>Page Not Found</h1>
<p>
We&lsquo;re sorry but we can&lsquo;t find the page you&lsquo;re looking
for.
</p>
<p>
<Link href="/">
<a>Back to Home</a>
</Link>
</p>
</div>
)
}

View File

@ -1,58 +1,27 @@
import './style.css' import './style.css'
import App from 'next/app' import '@hashicorp/nextjs-scripts/lib/nprogress/style.css'
import NProgress from 'nprogress'
import Router from 'next/router' import Router from 'next/router'
import ProductSubnav from '../components/subnav' import Head from 'next/head'
import NProgress from '@hashicorp/nextjs-scripts/lib/nprogress'
import { ErrorBoundary } from '@hashicorp/nextjs-scripts/lib/bugsnag'
import createConsentManager from '@hashicorp/nextjs-scripts/lib/consent-manager'
import useAnchorLinkAnalytics from '@hashicorp/nextjs-scripts/lib/anchor-link-analytics'
import HashiHead from '@hashicorp/react-head'
import MegaNav from '@hashicorp/react-mega-nav' import MegaNav from '@hashicorp/react-mega-nav'
import Footer from '../components/footer'
import AlertBanner from '@hashicorp/react-alert-banner' import AlertBanner from '@hashicorp/react-alert-banner'
import { ConsentManager, open } from '@hashicorp/react-consent-manager' import Footer from '../components/footer'
import consentManagerConfig from '../lib/consent-manager-config' import ProductSubnav from '../components/subnav'
import bugsnagClient from '../lib/bugsnag'
import anchorLinkAnalytics from '../lib/anchor-link-analytics'
import alertBannerData, { ALERT_BANNER_ACTIVE } from '../data/alert-banner' import alertBannerData, { ALERT_BANNER_ACTIVE } from '../data/alert-banner'
import Error from './_error' import Error from './_error'
import Head from 'next/head'
import HashiHead from '@hashicorp/react-head'
Router.events.on('routeChangeStart', NProgress.start) NProgress({ Router })
Router.events.on('routeChangeError', NProgress.done) const { ConsentManager, openConsentManager } = createConsentManager({
Router.events.on('routeChangeComplete', (url) => { preset: 'oss',
setTimeout(() => window.analytics.page(url), 0)
NProgress.done()
}) })
// Bugsnag function App({ Component, pageProps }) {
const ErrorBoundary = bugsnagClient.getPlugin('react') useAnchorLinkAnalytics()
class NextApp extends App {
static async getInitialProps({ Component, ctx }) {
let pageProps = {}
if (Component.getInitialProps) {
pageProps = await Component.getInitialProps(ctx)
} else if (Component.isMDXComponent) {
// fix for https://github.com/mdx-js/mdx/issues/382
const mdxLayoutComponent = Component({}).props.originalType
if (mdxLayoutComponent.getInitialProps) {
pageProps = await mdxLayoutComponent.getInitialProps(ctx)
}
}
return { pageProps }
}
componentDidMount() {
anchorLinkAnalytics()
}
componentDidUpdate() {
anchorLinkAnalytics()
}
render() {
const { Component, pageProps } = this.props
return ( return (
<ErrorBoundary FallbackComponent={Error}> <ErrorBoundary FallbackComponent={Error}>
<HashiHead <HashiHead
@ -62,7 +31,6 @@ class NextApp extends App {
description="Consul is a service networking solution to automate network configurations, discover services, and enable secure connectivity across any cloud or runtime." description="Consul is a service networking solution to automate network configurations, discover services, and enable secure connectivity across any cloud or runtime."
image="https://www.consul.io/img/og-image.png" image="https://www.consul.io/img/og-image.png"
stylesheet={[ stylesheet={[
{ href: '/css/nprogress.css' },
{ {
href: href:
'https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&display=swap', 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&display=swap',
@ -96,11 +64,26 @@ class NextApp extends App {
<div className="content"> <div className="content">
<Component {...pageProps} /> <Component {...pageProps} />
</div> </div>
<Footer openConsentManager={open} /> <Footer openConsentManager={openConsentManager} />
<ConsentManager {...consentManagerConfig} /> <ConsentManager />
</ErrorBoundary> </ErrorBoundary>
) )
} }
App.getInitialProps = async function ({ Component, ctx }) {
let pageProps = {}
if (Component.getInitialProps) {
pageProps = await Component.getInitialProps(ctx)
} else if (Component.isMDXComponent) {
// fix for https://github.com/mdx-js/mdx/issues/382
const mdxLayoutComponent = Component({}).props.originalType
if (mdxLayoutComponent.getInitialProps) {
pageProps = await mdxLayoutComponent.getInitialProps(ctx)
}
} }
export default NextApp return { pageProps }
}
export default App

View File

@ -1,13 +1,15 @@
import React from 'react' import NotFound from './404'
import ErrorPage from 'next/error' import Bugsnag from '@hashicorp/nextjs-scripts/lib/bugsnag'
import bugsnagClient from '../lib/bugsnag'
export default class Page extends React.Component { function Error({ statusCode }) {
static async getInitialProps(ctx) { console.log('this is working')
if (ctx.err) bugsnagClient.notify(ctx.err) return <NotFound statusCode={statusCode} />
return ErrorPage.getInitialProps(ctx)
}
render() {
return <ErrorPage statusCode={this.props.statusCode || '¯\\_(ツ)_/¯'} />
} }
Error.getInitialProps = ({ res, err }) => {
if (err) Bugsnag.notify(err)
const statusCode = res ? res.statusCode : err ? err.statusCode : 404
return { statusCode }
} }
export default Error

View File

@ -42,7 +42,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
http://127.0.0.1:8500/v1/acl/bootstrap http://127.0.0.1:8500/v1/acl/bootstrap
@ -108,7 +108,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload.json \ --data @payload.json \
@ -160,7 +160,7 @@ required.
### Sample Request ### Sample Request
```shell ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload.json \ --data @payload.json \
@ -202,7 +202,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
http://127.0.0.1:8500/v1/acl/destroy/8f246b77-f3e1-ff88-5b48-8ec93abf3e05 http://127.0.0.1:8500/v1/acl/destroy/8f246b77-f3e1-ff88-5b48-8ec93abf3e05
@ -241,7 +241,7 @@ Note: No ACL is required because the ACL is specified in the URL path.
### Sample Request ### Sample Request
```shell ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/acl/info/8f246b77-f3e1-ff88-5b48-8ec93abf3e05 http://127.0.0.1:8500/v1/acl/info/8f246b77-f3e1-ff88-5b48-8ec93abf3e05
``` ```
@ -288,7 +288,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
http://127.0.0.1:8500/v1/acl/clone/8f246b77-f3e1-ff88-5b48-8ec93abf3e05 http://127.0.0.1:8500/v1/acl/clone/8f246b77-f3e1-ff88-5b48-8ec93abf3e05
@ -322,7 +322,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/acl/list http://127.0.0.1:8500/v1/acl/list
``` ```
@ -373,7 +373,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/acl/replication http://127.0.0.1:8500/v1/acl/replication
``` ```

View File

@ -114,7 +114,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X PUT \ $ curl -X PUT \
--data @payload.json \ --data @payload.json \
http://127.0.0.1:8500/v1/acl/auth-method http://127.0.0.1:8500/v1/acl/auth-method
@ -170,7 +170,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X GET http://127.0.0.1:8500/v1/acl/auth-method/minikube $ curl -X GET http://127.0.0.1:8500/v1/acl/auth-method/minikube
``` ```
@ -288,7 +288,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X PUT \ $ curl -X PUT \
--data @payload.json \ --data @payload.json \
http://127.0.0.1:8500/v1/acl/auth-method/minikube http://127.0.0.1:8500/v1/acl/auth-method/minikube
@ -349,7 +349,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X DELETE \ $ curl -X DELETE \
http://127.0.0.1:8500/v1/acl/auth-method/minikube http://127.0.0.1:8500/v1/acl/auth-method/minikube
``` ```
@ -389,7 +389,7 @@ The table below shows this endpoint's support for
## Sample Request ## Sample Request
```shell ```shell-session
$ curl -X GET http://127.0.0.1:8500/v1/acl/auth-methods $ curl -X GET http://127.0.0.1:8500/v1/acl/auth-methods
``` ```

View File

@ -107,7 +107,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X PUT \ $ curl -X PUT \
--data @payload.json \ --data @payload.json \
http://127.0.0.1:8500/v1/acl/binding-rule http://127.0.0.1:8500/v1/acl/binding-rule
@ -161,7 +161,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X GET http://127.0.0.1:8500/v1/acl/binding-rule/000ed53c-e2d3-e7e6-31a5-c19bc3518a3d $ curl -X GET http://127.0.0.1:8500/v1/acl/binding-rule/000ed53c-e2d3-e7e6-31a5-c19bc3518a3d
``` ```
@ -275,7 +275,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X PUT \ $ curl -X PUT \
--data @payload.json \ --data @payload.json \
http://127.0.0.1:8500/v1/acl/binding-rule/000ed53c-e2d3-e7e6-31a5-c19bc3518a3d http://127.0.0.1:8500/v1/acl/binding-rule/000ed53c-e2d3-e7e6-31a5-c19bc3518a3d
@ -330,7 +330,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X DELETE \ $ curl -X DELETE \
http://127.0.0.1:8500/v1/acl/binding-rule/000ed53c-e2d3-e7e6-31a5-c19bc3518a3d http://127.0.0.1:8500/v1/acl/binding-rule/000ed53c-e2d3-e7e6-31a5-c19bc3518a3d
``` ```
@ -373,7 +373,7 @@ The table below shows this endpoint's support for
## Sample Request ## Sample Request
```shell ```shell-session
$ curl -X GET http://127.0.0.1:8500/v1/acl/binding-rules $ curl -X GET http://127.0.0.1:8500/v1/acl/binding-rules
``` ```

View File

@ -41,7 +41,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
http://127.0.0.1:8500/v1/acl/bootstrap http://127.0.0.1:8500/v1/acl/bootstrap
@ -112,7 +112,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request GET \ --request GET \
http://127.0.0.1:8500/v1/acl/replication http://127.0.0.1:8500/v1/acl/replication
@ -213,7 +213,7 @@ agent "" {
### Sample Request ### Sample Request
```text ```shell-session
$ curl -X POST -d @rules.hcl http://127.0.0.1:8500/v1/acl/rules/translate $ curl -X POST -d @rules.hcl http://127.0.0.1:8500/v1/acl/rules/translate
``` ```
@ -252,7 +252,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl -X GET http://127.0.0.1:8500/v1/acl/rules/translate/4f48f7e6-9359-4890-8e67-6144a962b0a5 $ curl -X GET http://127.0.0.1:8500/v1/acl/rules/translate/4f48f7e6-9359-4890-8e67-6144a962b0a5
``` ```
@ -320,7 +320,7 @@ replication enabled.
### Sample Request ### Sample Request
```shell ```shell-session
$ curl \ $ curl \
--request POST \ --request POST \
--data @payload.json \ --data @payload.json \
@ -379,7 +379,7 @@ deleting a token for which you already must possess its secret.
### Sample Request ### Sample Request
```shell ```shell-session
$ curl \ $ curl \
-H "X-Consul-Token: b78d37c7-0ca7-5f4d-99ee-6d9975ce4586" \ -H "X-Consul-Token: b78d37c7-0ca7-5f4d-99ee-6d9975ce4586" \
--request POST \ --request POST \
@ -388,7 +388,10 @@ $ curl \
## OIDC Authorization URL Request ## OIDC Authorization URL Request
<EnterpriseAlert> This is an enterprise only endpoint. This feature is currently in beta. </EnterpriseAlert> <EnterpriseAlert>
{' '}
This is an enterprise only endpoint. This feature is currently in beta.{' '}
</EnterpriseAlert>
This endpoint was added in Consul 1.8.0 and is used to obtain an authorization This endpoint was added in Consul 1.8.0 and is used to obtain an authorization
URL from Consul to start an [OIDC login flow](/docs/acl/auth-methods/oidc). URL from Consul to start an [OIDC login flow](/docs/acl/auth-methods/oidc).
@ -447,7 +450,7 @@ replication enabled.
### Sample Request ### Sample Request
```shell ```shell-session
$ curl \ $ curl \
--request POST \ --request POST \
--data @payload.json \ --data @payload.json \
@ -464,7 +467,10 @@ $ curl \
## OIDC Callback ## OIDC Callback
<EnterpriseAlert> This is an enterprise only endpoint. This feature is currently in beta. </EnterpriseAlert> <EnterpriseAlert>
{' '}
This is an enterprise only endpoint. This feature is currently in beta.{' '}
</EnterpriseAlert>
This endpoint was added in Consul 1.8.0 and is used to exchange an OIDC This endpoint was added in Consul 1.8.0 and is used to exchange an OIDC
authorization code for an OIDC ID Token. The ID token will in turn be exchanged authorization code for an OIDC ID Token. The ID token will in turn be exchanged
@ -529,7 +535,7 @@ replication enabled.
### Sample Request ### Sample Request
```shell ```shell-session
$ curl \ $ curl \
--request POST \ --request POST \
--data @payload.json \ --data @payload.json \

View File

@ -60,7 +60,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload.json \ --data @payload.json \
@ -112,7 +112,7 @@ required.
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload.json \ --data @payload.json \
@ -155,7 +155,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
http://127.0.0.1:8500/v1/acl/destroy/8f246b77-f3e1-ff88-5b48-8ec93abf3e05 http://127.0.0.1:8500/v1/acl/destroy/8f246b77-f3e1-ff88-5b48-8ec93abf3e05
@ -194,7 +194,7 @@ Note: No ACL is required because the ACL is specified in the URL path.
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/acl/info/8f246b77-f3e1-ff88-5b48-8ec93abf3e05 http://127.0.0.1:8500/v1/acl/info/8f246b77-f3e1-ff88-5b48-8ec93abf3e05
``` ```
@ -241,7 +241,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
http://127.0.0.1:8500/v1/acl/clone/8f246b77-f3e1-ff88-5b48-8ec93abf3e05 http://127.0.0.1:8500/v1/acl/clone/8f246b77-f3e1-ff88-5b48-8ec93abf3e05
@ -275,7 +275,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/acl/list http://127.0.0.1:8500/v1/acl/list
``` ```

View File

@ -68,7 +68,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X PUT \ $ curl -X PUT \
--data @payload.json \ --data @payload.json \
http://127.0.0.1:8500/v1/acl/policy http://127.0.0.1:8500/v1/acl/policy
@ -120,7 +120,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X GET http://127.0.0.1:8500/v1/acl/policy/e359bd81-baca-903e-7e64-1ccd9fdc78f5 $ curl -X GET http://127.0.0.1:8500/v1/acl/policy/e359bd81-baca-903e-7e64-1ccd9fdc78f5
``` ```
@ -170,7 +170,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X GET http://127.0.0.1:8500/v1/acl/policy/name/node-read $ curl -X GET http://127.0.0.1:8500/v1/acl/policy/name/node-read
``` ```
@ -245,7 +245,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X PUT \ $ curl -X PUT \
--data @payload.json \ --data @payload.json \
http://127.0.0.1:8500/v1/acl/policy/c01a1f82-44be-41b0-a686-685fb6e0f485 http://127.0.0.1:8500/v1/acl/policy/c01a1f82-44be-41b0-a686-685fb6e0f485
@ -299,7 +299,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X DELETE \ $ curl -X DELETE \
http://127.0.0.1:8500/v1/acl/policy/8f246b77-f3e1-ff88-5b48-8ec93abf3e05 http://127.0.0.1:8500/v1/acl/policy/8f246b77-f3e1-ff88-5b48-8ec93abf3e05
``` ```
@ -339,7 +339,7 @@ The table below shows this endpoint's support for
## Sample Request ## Sample Request
```shell ```shell-session
$ curl -X GET http://127.0.0.1:8500/v1/acl/policies $ curl -X GET http://127.0.0.1:8500/v1/acl/policies
``` ```

View File

@ -96,7 +96,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X PUT \ $ curl -X PUT \
--data @payload.json \ --data @payload.json \
http://127.0.0.1:8500/v1/acl/role http://127.0.0.1:8500/v1/acl/role
@ -162,7 +162,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X GET http://127.0.0.1:8500/v1/acl/role/aa770e5b-8b0b-7fcf-e5a1-8535fcc388b4 $ curl -X GET http://127.0.0.1:8500/v1/acl/role/aa770e5b-8b0b-7fcf-e5a1-8535fcc388b4
``` ```
@ -226,7 +226,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X GET http://127.0.0.1:8500/v1/acl/role/name/example-role $ curl -X GET http://127.0.0.1:8500/v1/acl/role/name/example-role
``` ```
@ -326,7 +326,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X PUT \ $ curl -X PUT \
--data @payload.json \ --data @payload.json \
http://127.0.0.1:8500/v1/acl/role/8bec74a4-5ced-45ed-9c9d-bca6153490bb http://127.0.0.1:8500/v1/acl/role/8bec74a4-5ced-45ed-9c9d-bca6153490bb
@ -389,7 +389,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X DELETE \ $ curl -X DELETE \
http://127.0.0.1:8500/v1/acl/role/8f246b77-f3e1-ff88-5b48-8ec93abf3e05 http://127.0.0.1:8500/v1/acl/role/8f246b77-f3e1-ff88-5b48-8ec93abf3e05
``` ```
@ -434,7 +434,7 @@ The table below shows this endpoint's support for
## Sample Request ## Sample Request
```shell ```shell-session
$ curl -X GET http://127.0.0.1:8500/v1/acl/roles $ curl -X GET http://127.0.0.1:8500/v1/acl/roles
``` ```

View File

@ -113,7 +113,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X PUT \ $ curl -X PUT \
--data @payload.json \ --data @payload.json \
http://127.0.0.1:8500/v1/acl/token http://127.0.0.1:8500/v1/acl/token
@ -175,7 +175,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X GET http://127.0.0.1:8500/v1/acl/token/6a1253d2-1785-24fd-91c2-f8e78c745511 $ curl -X GET http://127.0.0.1:8500/v1/acl/token/6a1253d2-1785-24fd-91c2-f8e78c745511
``` ```
@ -234,7 +234,7 @@ retrieving the data for a token that you must already possess its secret.
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -H "X-Consul-Token: 6a1253d2-1785-24fd-91c2-f8e78c745511" \ $ curl -H "X-Consul-Token: 6a1253d2-1785-24fd-91c2-f8e78c745511" \
http://127.0.0.1:8500/v1/acl/token/self http://127.0.0.1:8500/v1/acl/token/self
``` ```
@ -365,7 +365,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X PUT \ $ curl -X PUT \
--data @payload.json \ --data @payload.json \
http://127.0.0.1:8500/v1/acl/token/6a1253d2-1785-24fd-91c2-f8e78c745511 http://127.0.0.1:8500/v1/acl/token/6a1253d2-1785-24fd-91c2-f8e78c745511
@ -441,7 +441,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X PUT \ $ curl -X PUT \
--data @payload.json \ --data @payload.json \
http://127.0.0.1:8500/v1/acl/token/6a1253d2-1785-24fd-91c2-f8e78c745511/clone http://127.0.0.1:8500/v1/acl/token/6a1253d2-1785-24fd-91c2-f8e78c745511/clone
@ -510,7 +510,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X DELETE \ $ curl -X DELETE \
http://127.0.0.1:8500/v1/acl/token/8f246b77-f3e1-ff88-5b48-8ec93abf3e05 http://127.0.0.1:8500/v1/acl/token/8f246b77-f3e1-ff88-5b48-8ec93abf3e05
``` ```
@ -565,7 +565,7 @@ The table below shows this endpoint's support for
## Sample Request ## Sample Request
```shell ```shell-session
$ curl -X GET http://127.0.0.1:8500/v1/acl/tokens $ curl -X GET http://127.0.0.1:8500/v1/acl/tokens
``` ```

View File

@ -43,7 +43,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/agent/checks http://127.0.0.1:8500/v1/agent/checks
``` ```
@ -231,7 +231,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload.json \ --data @payload.json \
@ -265,7 +265,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
http://127.0.0.1:8500/v1/agent/check/deregister/my-check-id http://127.0.0.1:8500/v1/agent/check/deregister/my-check-id
@ -300,7 +300,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/agent/check/pass/my-check-id http://127.0.0.1:8500/v1/agent/check/pass/my-check-id
``` ```
@ -334,7 +334,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/agent/check/warn/my-check-id http://127.0.0.1:8500/v1/agent/check/warn/my-check-id
``` ```
@ -368,7 +368,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/agent/check/fail/my-check-id http://127.0.0.1:8500/v1/agent/check/fail/my-check-id
``` ```
@ -414,7 +414,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload.json \ --data @payload.json \

View File

@ -76,7 +76,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request POST \ --request POST \
--data @payload.json \ --data @payload.json \
@ -120,7 +120,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/agent/connect/ca/roots http://127.0.0.1:8500/v1/agent/connect/ca/roots
``` ```
@ -190,7 +190,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/agent/connect/ca/leaf/web http://127.0.0.1:8500/v1/agent/connect/ca/leaf/web
``` ```

View File

@ -53,7 +53,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/agent/members http://127.0.0.1:8500/v1/agent/members
``` ```
@ -107,7 +107,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/agent/self http://127.0.0.1:8500/v1/agent/self
``` ```
@ -187,7 +187,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
http://127.0.0.1:8500/v1/agent/reload http://127.0.0.1:8500/v1/agent/reload
@ -230,7 +230,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
http://127.0.0.1:8500/v1/agent/maintenance?enable=true&reason=For+API+docs http://127.0.0.1:8500/v1/agent/maintenance?enable=true&reason=For+API+docs
@ -268,7 +268,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/agent/metrics http://127.0.0.1:8500/v1/agent/metrics
``` ```
@ -397,7 +397,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/agent/monitor http://127.0.0.1:8500/v1/agent/monitor
``` ```
@ -443,7 +443,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/agent/join/1.2.3.4 http://127.0.0.1:8500/v1/agent/join/1.2.3.4
``` ```
@ -474,7 +474,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
http://127.0.0.1:8500/v1/agent/leave http://127.0.0.1:8500/v1/agent/leave
@ -515,7 +515,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
http://127.0.0.1:8500/v1/agent/force-leave/agent-one http://127.0.0.1:8500/v1/agent/force-leave/agent-one
@ -580,7 +580,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload.json \ --data @payload.json \

View File

@ -45,7 +45,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/agent/services http://127.0.0.1:8500/v1/agent/services
``` ```
@ -155,7 +155,7 @@ only.
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/agent/service/web-sidecar-proxy http://127.0.0.1:8500/v1/agent/service/web-sidecar-proxy
``` ```
@ -614,7 +614,7 @@ For the `Connect` field, the parameters are:
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload.json \ --data @payload.json \
@ -650,7 +650,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
http://127.0.0.1:8500/v1/agent/service/deregister/my-service-id http://127.0.0.1:8500/v1/agent/service/deregister/my-service-id
@ -694,7 +694,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
http://127.0.0.1:8500/v1/agent/service/maintenance/my-service-id?enable=true&reason=For+the+docs http://127.0.0.1:8500/v1/agent/service/maintenance/my-service-id?enable=true&reason=For+the+docs

View File

@ -156,7 +156,7 @@ and vice versa. A catalog entry can have either, neither, or both.
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload.json \ --data @payload.json \
@ -236,7 +236,7 @@ The behavior of the endpoint depends on what keys are provided.
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload.json \ --data @payload.json \
@ -269,7 +269,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/catalog/datacenters http://127.0.0.1:8500/v1/catalog/datacenters
``` ```
@ -319,7 +319,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/catalog/nodes http://127.0.0.1:8500/v1/catalog/nodes
``` ```
@ -409,7 +409,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/catalog/services?ns=foo http://127.0.0.1:8500/v1/catalog/services?ns=foo
``` ```
@ -478,7 +478,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/catalog/service/my-service?ns=default http://127.0.0.1:8500/v1/catalog/service/my-service?ns=default
``` ```
@ -682,7 +682,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/catalog/node/my-node http://127.0.0.1:8500/v1/catalog/node/my-node
``` ```
@ -810,7 +810,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/catalog/node-services/my-node http://127.0.0.1:8500/v1/catalog/node-services/my-node
``` ```

View File

@ -72,7 +72,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload \ --data @payload \
@ -123,7 +123,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl \ $ curl \
--request GET \ --request GET \
http://127.0.0.1:8500/v1/config/service-defaults/web http://127.0.0.1:8500/v1/config/service-defaults/web
@ -182,7 +182,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl \ $ curl \
--request GET \ --request GET \
http://127.0.0.1:8500/v1/config/service-defaults http://127.0.0.1:8500/v1/config/service-defaults
@ -253,7 +253,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl \ $ curl \
--request DELETE \ --request DELETE \
http://127.0.0.1:8500/v1/config/service-defaults/web http://127.0.0.1:8500/v1/config/service-defaults/web

View File

@ -33,7 +33,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/connect/ca/roots http://127.0.0.1:8500/v1/connect/ca/roots
``` ```
@ -85,7 +85,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/connect/ca/configuration http://127.0.0.1:8500/v1/connect/ca/configuration
``` ```
@ -157,7 +157,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload.json \ --data @payload.json \

View File

@ -79,7 +79,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request POST \ --request POST \
--data @payload.json \ --data @payload.json \
@ -128,7 +128,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/connect/intentions/e9ebc19f-d481-42b1-4871-4d298d3acd5c http://127.0.0.1:8500/v1/connect/intentions/e9ebc19f-d481-42b1-4871-4d298d3acd5c
``` ```
@ -190,7 +190,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
'http://127.0.0.1:8500/v1/connect/intentions?filter=SourceName==web' 'http://127.0.0.1:8500/v1/connect/intentions?filter=SourceName==web'
``` ```
@ -288,7 +288,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload.json \ --data @payload.json \
@ -329,7 +329,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request DELETE \ --request DELETE \
http://127.0.0.1:8500/v1/connect/intentions/e9ebc19f-d481-42b1-4871-4d298d3acd5c http://127.0.0.1:8500/v1/connect/intentions/e9ebc19f-d481-42b1-4871-4d298d3acd5c
@ -378,7 +378,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/connect/intentions/check?source=web&destination=db http://127.0.0.1:8500/v1/connect/intentions/check?source=web&destination=db
``` ```
@ -431,7 +431,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/connect/intentions/match?by=source&name=web http://127.0.0.1:8500/v1/connect/intentions/match?by=source&name=web
``` ```

View File

@ -41,7 +41,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/coordinate/datacenters http://127.0.0.1:8500/v1/coordinate/datacenters
``` ```
@ -104,7 +104,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/coordinate/nodes http://127.0.0.1:8500/v1/coordinate/nodes
``` ```
@ -161,7 +161,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/coordinate/node/agent-one http://127.0.0.1:8500/v1/coordinate/node/agent-one
``` ```
@ -229,7 +229,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload.json \ --data @payload.json \

View File

@ -126,7 +126,7 @@ failover = {
Request: Request:
```text ```shell-session
$ curl http://127.0.0.1:8500/v1/discovery-chain/web $ curl http://127.0.0.1:8500/v1/discovery-chain/web
``` ```
@ -203,7 +203,7 @@ redirect {
Request: Request:
```text ```shell-session
$ curl -X POST \ $ curl -X POST \
-d' -d'
{ {
@ -292,7 +292,7 @@ splits = [
Request: Request:
```text ```shell-session
$ curl http://127.0.0.1:8500/v1/discovery-chain/web?compile-dc=dc2 $ curl http://127.0.0.1:8500/v1/discovery-chain/web?compile-dc=dc2
``` ```
@ -428,7 +428,7 @@ routes = [
Request: Request:
```text ```shell-session
$ curl http://127.0.0.1:8500/v1/discovery-chain/web $ curl http://127.0.0.1:8500/v1/discovery-chain/web
``` ```

View File

@ -60,7 +60,7 @@ Lorem ipsum dolor sit amet, consectetur adipisicing elit...
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload \ --data @payload \
@ -122,7 +122,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/event/list http://127.0.0.1:8500/v1/event/list
``` ```

View File

@ -53,7 +53,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
-H "X-Consul-Namespace: *" \ -H "X-Consul-Namespace: *" \
http://127.0.0.1:8500/v1/health/node/my-node http://127.0.0.1:8500/v1/health/node/my-node
@ -157,7 +157,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/health/checks/my-service?ns=default http://127.0.0.1:8500/v1/health/checks/my-service?ns=default
``` ```
@ -256,7 +256,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/health/service/my-service?ns=default http://127.0.0.1:8500/v1/health/service/my-service?ns=default
``` ```
@ -451,7 +451,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/health/state/passing?ns=default http://127.0.0.1:8500/v1/health/state/passing?ns=default
``` ```

View File

@ -23,7 +23,7 @@ clients should communicate via TLS. If you dont provide a token in the reques
Below is an example using `curl` with `X-Consul-Token`. Below is an example using `curl` with `X-Consul-Token`.
```shell ```shell-session
$ curl \ $ curl \
--header "X-Consul-Token: <consul token>" \ --header "X-Consul-Token: <consul token>" \
http://127.0.0.1:8500/v1/agent/members http://127.0.0.1:8500/v1/agent/members
@ -31,7 +31,7 @@ $ curl \
Below is an example using `curl` with Bearer scheme. Below is an example using `curl` with Bearer scheme.
```shell ```shell-session
$ curl \ $ curl \
--header "Authorization: Bearer <consul token>" \ --header "Authorization: Bearer <consul token>" \
http://127.0.0.1:8500/v1/agent/members http://127.0.0.1:8500/v1/agent/members
@ -69,7 +69,7 @@ the `GET` operation reads an existing key.
Here is the same example using `curl`: Here is the same example using `curl`:
```shell ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data 'hello consul' \ --data 'hello consul' \

View File

@ -76,7 +76,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/kv/my-key http://127.0.0.1:8500/v1/kv/my-key
``` ```
@ -215,7 +215,7 @@ The payload is arbitrary, and is loaded directly into Consul as supplied.
### Sample Requests ### Sample Requests
```bash ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @contents \ --data @contents \
@ -272,7 +272,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request DELETE \ --request DELETE \
http://127.0.0.1:8500/v1/kv/my-key http://127.0.0.1:8500/v1/kv/my-key

View File

@ -94,7 +94,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X PUT \ $ curl -X PUT \
-H "X-Consul-Token: 5cdcae6c-0cce-4210-86fe-5dff3b984a6e" \ -H "X-Consul-Token: 5cdcae6c-0cce-4210-86fe-5dff3b984a6e" \
--data @payload.json \ --data @payload.json \
@ -165,7 +165,7 @@ the request has been granted any access in the namespace (read, list or write).
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -H "X-Consul-Token: b23b3cad-5ea1-4413-919e-c76884b9ad60" \ $ curl -H "X-Consul-Token: b23b3cad-5ea1-4413-919e-c76884b9ad60" \
http://127.0.0.1:8500/v1/namespace/team-1 http://127.0.0.1:8500/v1/namespace/team-1
``` ```
@ -288,7 +288,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X PUT \ $ curl -X PUT \
-H "X-Consul-Token: 5cdcae6c-0cce-4210-86fe-5dff3b984a6e" \ -H "X-Consul-Token: 5cdcae6c-0cce-4210-86fe-5dff3b984a6e" \
--data @payload.json \ --data @payload.json \
@ -364,7 +364,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -X DELETE \ $ curl -X DELETE \
-H "X-Consul-Token: b23b3cad-5ea1-4413-919e-c76884b9ad60" \ -H "X-Consul-Token: b23b3cad-5ea1-4413-919e-c76884b9ad60" \
http://127.0.0.1:8500/v1/namespace/team-1 http://127.0.0.1:8500/v1/namespace/team-1
@ -431,7 +431,7 @@ the request has been granted any access in the namespace (read, list or write).
### Sample Request ### Sample Request
```shell ```shell-session
$ curl -H "X-Consul-Token: 0137db51-5895-4c25-b6cd-d9ed992f4a52" \ $ curl -H "X-Consul-Token: 0137db51-5895-4c25-b6cd-d9ed992f4a52" \
http://127.0.0.1:8500/v1/namespaces http://127.0.0.1:8500/v1/namespaces
``` ```

View File

@ -79,7 +79,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request POST \ --request POST \
--data @payload.json \ --data @payload.json \
@ -120,7 +120,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/operator/area http://127.0.0.1:8500/v1/operator/area
``` ```
@ -174,7 +174,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload.json \ --data @payload.json \
@ -210,7 +210,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/operator/area/8f246b77-f3e1-ff88-5b48-8ec93abf3e05 http://127.0.0.1:8500/v1/operator/area/8f246b77-f3e1-ff88-5b48-8ec93abf3e05
``` ```
@ -256,7 +256,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request DELETE \ --request DELETE \
http://127.0.0.1:8500/v1/operator/area/8f246b77-f3e1-ff88-5b48-8ec93abf3e05 http://127.0.0.1:8500/v1/operator/area/8f246b77-f3e1-ff88-5b48-8ec93abf3e05
@ -300,7 +300,7 @@ This can be provided as `IP`, `IP:port`, `hostname`, or `hostname:port`.
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload.json \ --data @payload.json \
@ -365,7 +365,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/operator/area/8f246b77-f3e1-ff88-5b48-8ec93abf3e05/members http://127.0.0.1:8500/v1/operator/area/8f246b77-f3e1-ff88-5b48-8ec93abf3e05/members
``` ```

View File

@ -46,7 +46,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/operator/autopilot/configuration http://127.0.0.1:8500/v1/operator/autopilot/configuration
``` ```
@ -173,7 +173,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/operator/autopilot/health http://127.0.0.1:8500/v1/operator/autopilot/health
``` ```

View File

@ -48,7 +48,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/operator/keyring http://127.0.0.1:8500/v1/operator/keyring
``` ```
@ -132,7 +132,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request POST \ --request POST \
--data @payload.json \ --data @payload.json \
@ -178,7 +178,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload.json \ --data @payload.json \
@ -223,7 +223,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request DELETE \ --request DELETE \
--data @payload.json \ --data @payload.json \

View File

@ -40,7 +40,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/operator/license http://127.0.0.1:8500/v1/operator/license
``` ```
@ -106,7 +106,7 @@ The payload is the raw license blob.
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @consul.license \ --data @consul.license \
@ -169,7 +169,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request DELETE \ --request DELETE \
http://127.0.0.1:8500/v1/operator/license http://127.0.0.1:8500/v1/operator/license

View File

@ -48,7 +48,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/operator/raft/configuration http://127.0.0.1:8500/v1/operator/raft/configuration
``` ```
@ -141,7 +141,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request DELETE \ --request DELETE \
http://127.0.0.1:8500/v1/operator/raft/peer?address=1.2.3.4:5678 http://127.0.0.1:8500/v1/operator/raft/peer?address=1.2.3.4:5678

View File

@ -47,7 +47,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/operator/segment http://127.0.0.1:8500/v1/operator/segment
``` ```

View File

@ -278,7 +278,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request POST \ --request POST \
--data @payload.json \ --data @payload.json \
@ -319,7 +319,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/query http://127.0.0.1:8500/v1/query
``` ```
@ -388,7 +388,7 @@ more information.
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload.json \ --data @payload.json \
@ -425,7 +425,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/query/8f246b77-f3e1-ff88-5b48-8ec93abf3e05 http://127.0.0.1:8500/v1/query/8f246b77-f3e1-ff88-5b48-8ec93abf3e05
``` ```
@ -465,7 +465,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request DELETE \ --request DELETE \
http://127.0.0.1:8500/v1/query/8f246b77-f3e1-ff88-5b48-8ec93abf3e05 http://127.0.0.1:8500/v1/query/8f246b77-f3e1-ff88-5b48-8ec93abf3e05
@ -523,7 +523,7 @@ be used.
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/query/8f246b77-f3e1-ff88-5b48-8ec93abf3e05/execute?near=_agent http://127.0.0.1:8500/v1/query/8f246b77-f3e1-ff88-5b48-8ec93abf3e05/execute?near=_agent
``` ```
@ -632,7 +632,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/query/8f246b77-f3e1-ff88-5b48-8ec93abf3e05/explain http://127.0.0.1:8500/v1/query/8f246b77-f3e1-ff88-5b48-8ec93abf3e05/explain
``` ```

View File

@ -80,7 +80,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload.json \ --data @payload.json \
@ -137,7 +137,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
http://127.0.0.1:8500/v1/session/destroy/adf4238a-882b-9ddc-4a9d-5b6758e4159e http://127.0.0.1:8500/v1/session/destroy/adf4238a-882b-9ddc-4a9d-5b6758e4159e
@ -183,7 +183,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/session/info/adf4238a-882b-9ddc-4a9d-5b6758e4159e http://127.0.0.1:8500/v1/session/info/adf4238a-882b-9ddc-4a9d-5b6758e4159e
``` ```
@ -244,7 +244,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/session/node/node-abcd1234 http://127.0.0.1:8500/v1/session/node/node-abcd1234
``` ```
@ -299,7 +299,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
http://127.0.0.1:8500/v1/session/list http://127.0.0.1:8500/v1/session/list
``` ```
@ -357,7 +357,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
http://127.0.0.1:8500/v1/session/renew/adf4238a-882b-9ddc-4a9d-5b6758e4159e http://127.0.0.1:8500/v1/session/renew/adf4238a-882b-9ddc-4a9d-5b6758e4159e

View File

@ -60,7 +60,7 @@ The table below shows this endpoint's support for
With a custom datacenter: With a custom datacenter:
```text ```shell-session
$ curl http://127.0.0.1:8500/v1/snapshot?dc=my-datacenter -o snapshot.tgz $ curl http://127.0.0.1:8500/v1/snapshot?dc=my-datacenter -o snapshot.tgz
``` ```
@ -103,7 +103,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data-binary @snapshot.tgz \ --data-binary @snapshot.tgz \

View File

@ -41,7 +41,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl http://127.0.0.1:8500/v1/status/leader $ curl http://127.0.0.1:8500/v1/status/leader
``` ```
@ -79,7 +79,7 @@ The table below shows this endpoint's support for
### Sample Request ### Sample Request
```text ```shell-session
$ curl http://127.0.0.1:8500/v1/status/peers $ curl http://127.0.0.1:8500/v1/status/peers
``` ```

View File

@ -172,7 +172,7 @@ atomic transaction. Up to 64 operations may be present in a single transaction.
### Sample Request ### Sample Request
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data @payload.json \ --data @payload.json \

View File

@ -306,7 +306,7 @@ In Consul 0.9.1 and later, you can use the [/v1/acl/bootstrap API](/api/acl/acl#
to make the initial master token, so a token never needs to be placed into a configuration to make the initial master token, so a token never needs to be placed into a configuration
file. To use this approach, omit `acl_master_token` from the above config and then call the API: file. To use this approach, omit `acl_master_token` from the above config and then call the API:
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
http://127.0.0.1:8500/v1/acl/bootstrap http://127.0.0.1:8500/v1/acl/bootstrap
@ -337,7 +337,7 @@ own internal operations like updating its node information in the catalog and pe
[anti-entropy](/docs/internals/anti-entropy) syncing. We can create a token using the [anti-entropy](/docs/internals/anti-entropy) syncing. We can create a token using the
ACL API, and the ACL master token we set in the previous step: ACL API, and the ACL master token we set in the previous step:
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--header "X-Consul-Token: b1gs33cr3t" \ --header "X-Consul-Token: b1gs33cr3t" \
@ -367,7 +367,7 @@ configuration and restart the servers once more to apply it:
In Consul 0.9.1 and later you can also introduce the agent token using an API, In Consul 0.9.1 and later you can also introduce the agent token using an API,
so it doesn't need to be set in the configuration file: so it doesn't need to be set in the configuration file:
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--header "X-Consul-Token: b1gs33cr3t" \ --header "X-Consul-Token: b1gs33cr3t" \
@ -402,7 +402,7 @@ with a configuration file that enables ACLs:
Similar to the previous example, in Consul 0.9.1 and later you can also introduce the Similar to the previous example, in Consul 0.9.1 and later you can also introduce the
agent token using an API, so it doesn't need to be set in the configuration file: agent token using an API, so it doesn't need to be set in the configuration file:
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--header "X-Consul-Token: b1gs33cr3t" \ --header "X-Consul-Token: b1gs33cr3t" \
@ -431,7 +431,7 @@ At this point ACLs are bootstrapped with ACL agent tokens configured, but there
other policies set up. Even basic operations like `consul members` will be restricted other policies set up. Even basic operations like `consul members` will be restricted
by the ACL default policy of "deny": by the ACL default policy of "deny":
``` ```shell-session
$ consul members $ consul members
``` ```
@ -441,7 +441,7 @@ see any nodes by default.
If we supply the token we created above we will be able to see a listing of nodes because If we supply the token we created above we will be able to see a listing of nodes because
it has write privileges to an empty `node` prefix, meaning it has access to all nodes: it has write privileges to an empty `node` prefix, meaning it has access to all nodes:
``` ```shell-session
$ CONSUL_HTTP_TOKEN=fe3b8d40-0ee0-8783-6cc2-ab1aa9bb16c1 consul members $ CONSUL_HTTP_TOKEN=fe3b8d40-0ee0-8783-6cc2-ab1aa9bb16c1 consul members
Node Address Status Type Build Protocol DC Node Address Status Type Build Protocol DC
node-1 127.0.0.1:8301 alive server 0.9.0dev 2 dc1 node-1 127.0.0.1:8301 alive server 0.9.0dev 2 dc1
@ -454,7 +454,7 @@ configure Consul's behavior when no token is supplied. The anonymous token is ma
like any other ACL token, except that `anonymous` is used for the ID. In this example like any other ACL token, except that `anonymous` is used for the ID. In this example
we will give the anonymous token read privileges for all nodes: we will give the anonymous token read privileges for all nodes:
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--header "X-Consul-Token: b1gs33cr3t" \ --header "X-Consul-Token: b1gs33cr3t" \
@ -471,7 +471,7 @@ $ curl \
The anonymous token is implicitly used if no token is supplied, so now we can run The anonymous token is implicitly used if no token is supplied, so now we can run
`consul members` without supplying a token and we will be able to see the nodes: `consul members` without supplying a token and we will be able to see the nodes:
``` ```shell-session
$ consul members $ consul members
Node Address Status Type Build Protocol DC Node Address Status Type Build Protocol DC
node-1 127.0.0.1:8301 alive server 0.9.0dev 2 dc1 node-1 127.0.0.1:8301 alive server 0.9.0dev 2 dc1
@ -481,7 +481,7 @@ node-2 127.0.0.2:8301 alive client 0.9.0dev 2 dc1
The anonymous token is also used for DNS lookups since there's no way to pass a The anonymous token is also used for DNS lookups since there's no way to pass a
token as part of a DNS request. Here's an example lookup for the "consul" service: token as part of a DNS request. Here's an example lookup for the "consul" service:
```shell ```shell-session
$ dig @127.0.0.1 -p 8600 consul.service.consul $ dig @127.0.0.1 -p 8600 consul.service.consul
; <<>> DiG 9.8.3-P1 <<>> @127.0.0.1 -p 8600 consul.service.consul ; <<>> DiG 9.8.3-P1 <<>> @127.0.0.1 -p 8600 consul.service.consul
@ -507,7 +507,7 @@ consul. 0 IN SOA ns.consul. postmaster.consul. 14
Now we get an `NXDOMAIN` error because the anonymous token doesn't have access to the Now we get an `NXDOMAIN` error because the anonymous token doesn't have access to the
"consul" service. Let's add that to the anonymous token's policy: "consul" service. Let's add that to the anonymous token's policy:
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--header "X-Consul-Token: b1gs33cr3t" \ --header "X-Consul-Token: b1gs33cr3t" \
@ -523,7 +523,7 @@ $ curl \
With that new policy in place, the DNS lookup will succeed: With that new policy in place, the DNS lookup will succeed:
```shell ```shell-session
$ dig @127.0.0.1 -p 8600 consul.service.consul $ dig @127.0.0.1 -p 8600 consul.service.consul
; <<>> DiG 9.8.3-P1 <<>> @127.0.0.1 -p 8600 consul.service.consul ; <<>> DiG 9.8.3-P1 <<>> @127.0.0.1 -p 8600 consul.service.consul
@ -573,7 +573,7 @@ not function fully using the anonymous ACL token. It is recommended
that a UI-specific ACL token is used, which can be set in the UI during the that a UI-specific ACL token is used, which can be set in the UI during the
web browser session to authenticate the interface. web browser session to authenticate the interface.
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--header "X-Consul-Token: b1gs33cr3t" \ --header "X-Consul-Token: b1gs33cr3t" \
@ -663,7 +663,7 @@ of the rules section.
Here's a sample request using the HCL form: Here's a sample request using the HCL form:
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data \ --data \
@ -676,7 +676,7 @@ $ curl \
Here's an equivalent request using the JSON form: Here's an equivalent request using the JSON form:
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data \ --data \

View File

@ -167,7 +167,7 @@ potentially identical policies to manage or clean up later.
You can get the AccessorID of every legacy token from the API. For example, You can get the AccessorID of every legacy token from the API. For example,
using `curl` and `jq` in bash: using `curl` and `jq` in bash:
```shell ```shell-session
$ LEGACY_IDS=$(curl -sH "X-Consul-Token: $CONSUL_HTTP_TOKEN" \ $ LEGACY_IDS=$(curl -sH "X-Consul-Token: $CONSUL_HTTP_TOKEN" \
'localhost:8500/v1/acl/tokens' | jq -r '.[] | select (.Legacy) | .AccessorID') 'localhost:8500/v1/acl/tokens' | jq -r '.[] | select (.Legacy) | .AccessorID')
$ echo "$LEGACY_IDS" $ echo "$LEGACY_IDS"
@ -188,7 +188,7 @@ done
Each policy now has an identical set of rules to the original token. You can Each policy now has an identical set of rules to the original token. You can
inspect these: inspect these:
```shell ```shell-session
$ consul acl policy read -name migrated-621cbd12-dde7-de06-9be0-e28d067b5b7f $ consul acl policy read -name migrated-621cbd12-dde7-de06-9be0-e28d067b5b7f
ID: 573d84bd-8b08-3061-e391-d2602e1b4947 ID: 573d84bd-8b08-3061-e391-d2602e1b4947
Name: migrated-621cbd12-dde7-de06-9be0-e28d067b5b7f Name: migrated-621cbd12-dde7-de06-9be0-e28d067b5b7f
@ -230,7 +230,7 @@ manipulate policies.
You can get the AccessorID of every legacy token from the API. For example, You can get the AccessorID of every legacy token from the API. For example,
using `curl` and `jq` in bash: using `curl` and `jq` in bash:
```shell ```shell-session
$ LEGACY_IDS=$(curl -sH "X-Consul-Token: $CONSUL_HTTP_TOKEN" \ $ LEGACY_IDS=$(curl -sH "X-Consul-Token: $CONSUL_HTTP_TOKEN" \
'localhost:8500/v1/acl/tokens' | jq -r '.[] | select (.Legacy) | .AccessorID') 'localhost:8500/v1/acl/tokens' | jq -r '.[] | select (.Legacy) | .AccessorID')
$ echo "$LEGACY_IDS" $ echo "$LEGACY_IDS"
@ -243,7 +243,7 @@ Now we want to read the actual policy for each legacy token and de-duplicate
them. We can use the `translate-rules` helper sub-command which will read the them. We can use the `translate-rules` helper sub-command which will read the
token's policy and return a new ACL policy that is exactly equivalent. token's policy and return a new ACL policy that is exactly equivalent.
```shell ```shell-session
$ for id in $LEGACY_IDS; do \ $ for id in $LEGACY_IDS; do \
echo "Policy for $id:" echo "Policy for $id:"
consul acl translate-rules -token-accessor "$id"; \ consul acl translate-rules -token-accessor "$id"; \
@ -268,7 +268,7 @@ We can change the loop above to take a hash of this policy definition to
de-duplicate the policies into a set of files locally. This example uses command de-duplicate the policies into a set of files locally. This example uses command
available on macOS but equivalents for other platforms should be easy to find. available on macOS but equivalents for other platforms should be easy to find.
```shell ```shell-session
$ mkdir policies $ mkdir policies
$ for id in $LEGACY_IDS; do \ $ for id in $LEGACY_IDS; do \
# Fetch the equivalent new policy rules based on the legacy token rules # Fetch the equivalent new policy rules based on the legacy token rules
@ -290,7 +290,7 @@ You can now manually inspect and potentially edit these policies. For example we
could rename them according to their intended use. In this case we maintain the could rename them according to their intended use. In this case we maintain the
hash as it will allow us to match tokens to policies later. hash as it will allow us to match tokens to policies later.
```shell ```shell-session
$ cat policies/024ce11f26f59436c518fb31f0999d1400485c17.hcl $ cat policies/024ce11f26f59436c518fb31f0999d1400485c17.hcl
service_prefix "bar" { service_prefix "bar" {
policy = "write" policy = "write"
@ -304,7 +304,7 @@ You might also choose to tighten up the rules, for example if you know you never
rely on prefix-matching the service name `foo` you might choose to modify the rely on prefix-matching the service name `foo` you might choose to modify the
policy to use exact match. policy to use exact match.
```shell ```shell-session
$ cat policies/501b787c9444fbd62f346ab257eeb27197be2444.hcl $ cat policies/501b787c9444fbd62f346ab257eeb27197be2444.hcl
service_prefix "foo" { service_prefix "foo" {
policy = "write" policy = "write"
@ -320,7 +320,7 @@ $ mv policies/501b787c9444fbd62f346ab257eeb27197be2444.hcl \
We now have a minimal set of policies to create, with human-readable names. We We now have a minimal set of policies to create, with human-readable names. We
can create each one with something like the following. can create each one with something like the following.
```shell ```shell-session
$ for p in $(ls policies | grep ".hcl"); do \ $ for p in $(ls policies | grep ".hcl"); do \
# Extract the hash part of the file name # Extract the hash part of the file name
HASH=$(echo "$p" | cut -d - -f 1); \ HASH=$(echo "$p" | cut -d - -f 1); \
@ -356,7 +356,7 @@ policy file names. The `-upgrade-legacy` flag removes the token's legacy
embedded rules at the same time as associating them with the new policies embedded rules at the same time as associating them with the new policies
created from those rules. created from those rules.
```shell ```shell-session
$ for id in $LEGACY_IDS; do \ $ for id in $LEGACY_IDS; do \
NEW_POLICY=$(consul acl translate-rules -token-accessor "$id"); \ NEW_POLICY=$(consul acl translate-rules -token-accessor "$id"); \
HASH=$(echo -n "$NEW_POLICY" | shasum | awk '{ print $1 }'); \ HASH=$(echo -n "$NEW_POLICY" | shasum | awk '{ print $1 }'); \

View File

@ -109,7 +109,7 @@ of the rules section of a policy.
Here's a sample request using the HCL form: Here's a sample request using the HCL form:
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data \ --data \
@ -121,7 +121,7 @@ $ curl \
Here's an equivalent request using the JSON form: Here's an equivalent request using the JSON form:
```text ```shell-session
$ curl \ $ curl \
--request PUT \ --request PUT \
--data \ --data \

View File

@ -140,8 +140,7 @@ The "host:port" must be correct for the Consul agent serving the Consul UI.
#### CLI #### CLI
If you plan to support authentication via `consul login -type=oidc If you plan to support authentication via `consul login -type=oidc -method=<name>`, a localhost redirect URI must be set (usually this is
-method=<name>`, a localhost redirect URI must be set (usually this is
`http://localhost:8550/oidc/callback`). Logins via the CLI may specify a `http://localhost:8550/oidc/callback`). Logins via the CLI may specify a
different host and/or listening port if needed, and a URI with this host/port different host and/or listening port if needed, and a URI with this host/port
must match one of the configured redirected URIs. These same "localhost" URIs must match one of the configured redirected URIs. These same "localhost" URIs
@ -157,7 +156,7 @@ must be added to the provider as well.
#### CLI #### CLI
``` ```shell-session
$ consul login -method=oidc -type=oidc -token-sink-file=consul.token $ consul login -method=oidc -type=oidc -token-sink-file=consul.token
Complete the login via your OIDC provider. Launching browser to: Complete the login via your OIDC provider. Launching browser to:

View File

@ -22,7 +22,7 @@ As of Consul 1.0 the values are taken literally and must not be URL
encoded. If the values contain spaces, equals, backslashes or double quotes then encoded. If the values contain spaces, equals, backslashes or double quotes then
they need to be double quoted and the usual escaping rules apply. they need to be double quoted and the usual escaping rules apply.
```shell ```shell-session
$ consul agent -retry-join 'provider=my-cloud config=val config2="some other val" ...' $ consul agent -retry-join 'provider=my-cloud config=val config2="some other val" ...'
``` ```
@ -50,7 +50,7 @@ provider.
This returns the first private IP address of all servers in the given This returns the first private IP address of all servers in the given
region which have the given `tag_key` and `tag_value`. region which have the given `tag_key` and `tag_value`.
```shell ```shell-session
$ consul agent -retry-join "provider=aws tag_key=... tag_value=..." $ consul agent -retry-join "provider=aws tag_key=... tag_value=..."
``` ```
@ -88,7 +88,7 @@ This returns the first private IP address of all servers in the given region
which have the given `tag_key` and `tag_value` in the tenant and subscription, or in which have the given `tag_key` and `tag_value` in the tenant and subscription, or in
the given `resource_group` of a `vm_scale_set` for Virtual Machine Scale Sets. the given `resource_group` of a `vm_scale_set` for Virtual Machine Scale Sets.
```shell ```shell-session
$ consul agent -retry-join "provider=azure tag_name=... tag_value=... tenant_id=... client_id=... subscription_id=... secret_access_key=..." $ consul agent -retry-join "provider=azure tag_name=... tag_value=... tenant_id=... client_id=... subscription_id=... secret_access_key=..."
``` ```
@ -133,7 +133,7 @@ When using Virtual Machine Scale Sets the only role action needed is `Microsoft.
This returns the first private IP address of all servers in the given This returns the first private IP address of all servers in the given
project which have the given `tag_value`. project which have the given `tag_value`.
```shell ```shell-session
$ consul agent -retry-join "provider=gce project_name=... tag_value=..." $ consul agent -retry-join "provider=gce project_name=... tag_value=..."
``` ```
@ -168,7 +168,7 @@ Credentials are searched using the following paths, in order of precedence.
This returns the first private IP address of all servers for the given This returns the first private IP address of all servers for the given
datacenter with the given `tag_value`. datacenter with the given `tag_value`.
```shell ```shell-session
$ consul agent -retry-join "provider=softlayer datacenter=... tag_value=... username=... api_key=..." $ consul agent -retry-join "provider=softlayer datacenter=... tag_value=... username=... api_key=..."
``` ```
@ -194,7 +194,7 @@ $ consul agent -retry-join "provider=softlayer datacenter=... tag_value=... user
This returns the first private IP address of all servers for the given This returns the first private IP address of all servers for the given
`region` with the given `tag_key` and `tag_value`. `region` with the given `tag_key` and `tag_value`.
```shell ```shell-session
$ consul agent -retry-join "provider=aliyun region=... tag_key=consul tag_value=... access_key_id=... access_key_secret=..." $ consul agent -retry-join "provider=aliyun region=... tag_key=consul tag_value=... access_key_id=... access_key_secret=..."
``` ```
@ -221,7 +221,7 @@ It is recommended you make a dedicated key used to auto-join.
This returns the first private IP address of all servers for the given This returns the first private IP address of all servers for the given
`region` with the given `tag_name`. `region` with the given `tag_name`.
```shell ```shell-session
$ consul agent -retry-join "provider=digitalocean region=... tag_name=... api_token=..." $ consul agent -retry-join "provider=digitalocean region=... tag_name=... api_token=..."
``` ```
@ -241,7 +241,7 @@ $ consul agent -retry-join "provider=digitalocean region=... tag_name=... api_to
This returns the first private IP address of all servers for the given This returns the first private IP address of all servers for the given
`region` with the given `tag_key` and `tag_value`. `region` with the given `tag_key` and `tag_value`.
```shell ```shell-session
$ consul agent -retry-join "provider=os tag_key=consul tag_value=server username=... password=... auth_url=..." $ consul agent -retry-join "provider=os tag_key=consul tag_value=server username=... password=... auth_url=..."
``` ```
@ -273,7 +273,7 @@ The configuration can also be provided by environment variables.
This returns the first private IP address of all servers for the given This returns the first private IP address of all servers for the given
`region` with the given `tag_name`. `region` with the given `tag_name`.
```shell ```shell-session
$ consul agent -retry-join "provider=scaleway organization=my-org tag_name=consul-server token=... region=..." $ consul agent -retry-join "provider=scaleway organization=my-org tag_name=consul-server token=... region=..."
``` ```
@ -295,7 +295,7 @@ $ consul agent -retry-join "provider=scaleway organization=my-org tag_name=consu
This returns the first IP address of all servers for the given `region` with the given `tag_key` and `tag_value`. This returns the first IP address of all servers for the given `region` with the given `tag_key` and `tag_value`.
```shell ```shell-session
$ consul agent -retry-join "provider=tencentcloud region=... tag_key=consul tag_value=... access_key_id=... access_key_secret=..." $ consul agent -retry-join "provider=tencentcloud region=... tag_key=consul tag_value=... access_key_id=... access_key_secret=..."
``` ```
@ -322,7 +322,7 @@ It is recommended you make a dedicated key used to auto-join the Consul datacent
This returns the first PrimaryIP addresses for all servers with the given `tag_key` and `tag_value`. This returns the first PrimaryIP addresses for all servers with the given `tag_key` and `tag_value`.
```shell ```shell-session
$ consul agent -retry-join "provider=triton account=testaccount url=https://us-sw-1.api.joyentcloud.com key_id=... tag_key=consul-role tag_value=server" $ consul agent -retry-join "provider=triton account=testaccount url=https://us-sw-1.api.joyentcloud.com key_id=... tag_key=consul-role tag_value=server"
``` ```
@ -345,7 +345,7 @@ $ consul agent -retry-join "provider=triton account=testaccount url=https://us-s
This returns the first private IP address of all servers for the given region with the given `tag_name` and `category_name`. This returns the first private IP address of all servers for the given region with the given `tag_name` and `category_name`.
```shell ```shell-session
$ consul agent -retry-join "provider=vsphere category_name=consul-role tag_name=consul-server host=... user=... password=... insecure_ssl=[true|false]" $ consul agent -retry-join "provider=vsphere category_name=consul-role tag_name=consul-server host=... user=... password=... insecure_ssl=[true|false]"
``` ```
@ -370,7 +370,7 @@ $ consul agent -retry-join "provider=vsphere category_name=consul-role tag_name=
This returns the first private IP address (or the IP address of `address type`) of all servers with the given `project` and `auth_token`. This returns the first private IP address (or the IP address of `address type`) of all servers with the given `project` and `auth_token`.
```shell ```shell-session
$ consul agent -retry-join "provider=packet auth_token=token project=uuid url=... address_type=..." $ consul agent -retry-join "provider=packet auth_token=token project=uuid url=... address_type=..."
``` ```
@ -392,7 +392,7 @@ $ consul agent -retry-join "provider=packet auth_token=token project=uuid url=..
This returns the first private IP address of all servers for the given `region` with the given `tag_name`. This returns the first private IP address of all servers for the given `region` with the given `tag_name`.
```shell ```shell-session
$ consul agent -retry-join "provider=linode region=us-east tag_name=consul-server" $ consul agent -retry-join "provider=linode region=us-east tag_name=consul-server"
``` ```
@ -429,7 +429,7 @@ gossip port (default behavior with all join requests). The pod may specify
the `consul.hashicorp.com/auto-join-port` annotation to set the port. The value the `consul.hashicorp.com/auto-join-port` annotation to set the port. The value
may be an integer or a named port. may be an integer or a named port.
```shell ```shell-session
$ consul agent -retry-join "provider=k8s label_selector=\"app=consul,component=server\"" $ consul agent -retry-join "provider=k8s label_selector=\"app=consul,component=server\""
``` ```

View File

@ -76,7 +76,7 @@ Config {
Then to apply this configuration, run: Then to apply this configuration, run:
```bash ```shell-session
$ consul config write proxy-defaults.hcl $ consul config write proxy-defaults.hcl
``` ```
@ -95,7 +95,7 @@ Consul's HTTP API.
Example: Example:
```bash ```shell-session
$ consul config read -kind service-defaults -name web $ consul config read -kind service-defaults -name web
{ {
"Kind": "service-defaults", "Kind": "service-defaults",
@ -111,7 +111,7 @@ list out all the configuration entries for a given kind.
Example: Example:
```bash ```shell-session
$ consul config list -kind service-defaults $ consul config list -kind service-defaults
web web
api api
@ -125,7 +125,7 @@ to delete an entry by specifying both its `kind` and `name`.
Example: Example:
```bash ```shell-session
$ consul config delete -kind service-defaults -name web $ consul config delete -kind service-defaults -name web
``` ```
@ -139,11 +139,11 @@ added in Consul 1.7.0.
Example: Example:
```bash ```shell-session
$ consul config write service-defaults.hcl -namespace foo $ consul config write service-defaults.hcl -namespace foo
``` ```
```bash ```shell-session
$ consul config list -kind service-defaults -namespace foo $ consul config list -kind service-defaults -namespace foo
web web
api api

View File

@ -40,7 +40,7 @@ domain to a Consul agent from the existing DNS server. Review the
You can experiment with Consul's DNS server on the command line using tools such as `dig`: You can experiment with Consul's DNS server on the command line using tools such as `dig`:
```shell ```shell-session
$ dig @127.0.0.1 -p 8600 redis.service.dc1.consul. ANY $ dig @127.0.0.1 -p 8600 redis.service.dc1.consul. ANY
``` ```
@ -68,7 +68,7 @@ For a node lookup, the only records returned are A and AAAA records
containing the IP address, and TXT records containing the containing the IP address, and TXT records containing the
`node_meta` values of the node. `node_meta` values of the node.
```text ```shell-session
$ dig @127.0.0.1 -p 8600 foo.node.consul ANY $ dig @127.0.0.1 -p 8600 foo.node.consul ANY
; <<>> DiG 9.8.3-P1 <<>> @127.0.0.1 -p 8600 foo.node.consul ANY ; <<>> DiG 9.8.3-P1 <<>> @127.0.0.1 -p 8600 foo.node.consul ANY
@ -146,7 +146,7 @@ provide the port that a service is registered on, enabling clients to avoid rely
on well-known ports. SRV records are only served if the client specifically requests on well-known ports. SRV records are only served if the client specifically requests
them, like so: them, like so:
```text ```shell-session
$ dig @127.0.0.1 -p 8600 consul.service.consul SRV $ dig @127.0.0.1 -p 8600 consul.service.consul SRV
; <<>> DiG 9.8.3-P1 <<>> @127.0.0.1 -p 8600 consul.service.consul ANY ; <<>> DiG 9.8.3-P1 <<>> @127.0.0.1 -p 8600 consul.service.consul ANY
@ -185,7 +185,7 @@ of the RFC style lookup is the same as the standard style of lookup.
If you registered the service `rabbitmq` on port 5672 and tagged it with `amqp`, If you registered the service `rabbitmq` on port 5672 and tagged it with `amqp`,
you could make an RFC 2782 query for its SRV record as `_rabbitmq._amqp.service.consul`: you could make an RFC 2782 query for its SRV record as `_rabbitmq._amqp.service.consul`:
```text ```shell-session
$ dig @127.0.0.1 -p 8600 _rabbitmq._amqp.service.consul SRV $ dig @127.0.0.1 -p 8600 _rabbitmq._amqp.service.consul SRV
; <<>> DiG 9.8.3-P1 <<>> @127.0.0.1 -p 8600 _rabbitmq._amqp.service.consul ANY ; <<>> DiG 9.8.3-P1 <<>> @127.0.0.1 -p 8600 _rabbitmq._amqp.service.consul ANY

View File

@ -29,7 +29,7 @@ The key must be 32-bytes, Base64 encoded. As a convenience, Consul provides the
[`consul keygen`](/docs/commands/keygen) command to generate a [`consul keygen`](/docs/commands/keygen) command to generate a
cryptographically suitable key: cryptographically suitable key:
```text ```shell-session
$ consul keygen $ consul keygen
pUqJrVyVRj5jsiYEkM/tFQYfWyJIv4s3XkvDwy7Cu5s= pUqJrVyVRj5jsiYEkM/tFQYfWyJIv4s3XkvDwy7Cu5s=
``` ```
@ -37,7 +37,7 @@ pUqJrVyVRj5jsiYEkM/tFQYfWyJIv4s3XkvDwy7Cu5s=
With that key, you can enable encryption on the agent. If encryption is enabled, With that key, you can enable encryption on the agent. If encryption is enabled,
the output of [`consul agent`](/docs/commands/agent) will include "Encrypt: true": the output of [`consul agent`](/docs/commands/agent) will include "Encrypt: true":
```text ```shell-session
$ cat encrypt.json $ cat encrypt.json
{"encrypt": "pUqJrVyVRj5jsiYEkM/tFQYfWyJIv4s3XkvDwy7Cu5s="} {"encrypt": "pUqJrVyVRj5jsiYEkM/tFQYfWyJIv4s3XkvDwy7Cu5s="}

View File

@ -33,7 +33,7 @@ of [`configuration options`](/docs/agent/options#command-line-options), but most
When running [`consul agent`](/docs/commands/agent), you should see output similar to this: When running [`consul agent`](/docs/commands/agent), you should see output similar to this:
```text ```shell-session
$ consul agent -data-dir=/tmp/consul $ consul agent -data-dir=/tmp/consul
==> Starting Consul agent... ==> Starting Consul agent...
==> Consul agent running! ==> Consul agent running!

View File

@ -137,7 +137,7 @@ Here is an example configuration:
Or, using the watch command: Or, using the watch command:
```shell ```shell-session
$ consul watch -type=key -key=foo/bar/baz /usr/bin/my-key-handler.sh $ consul watch -type=key -key=foo/bar/baz /usr/bin/my-key-handler.sh
``` ```
@ -176,7 +176,7 @@ Here is an example configuration:
Or, using the watch command: Or, using the watch command:
```shell ```shell-session
$ consul watch -type=keyprefix -prefix=foo/ /usr/bin/my-prefix-handler.sh $ consul watch -type=keyprefix -prefix=foo/ /usr/bin/my-prefix-handler.sh
``` ```
@ -307,13 +307,13 @@ Or, using the watch command:
Single tag: Single tag:
```shell ```shell-session
$ consul watch -type=service -service=redis -tag=bar /usr/bin/my-service-handler.sh $ consul watch -type=service -service=redis -tag=bar /usr/bin/my-service-handler.sh
``` ```
Multiple tag: Multiple tag:
```shell ```shell-session
$ consul watch -type=service -service=redis -tag=bar -tag=foo /usr/bin/my-service-handler.sh $ consul watch -type=service -service=redis -tag=bar -tag=foo /usr/bin/my-service-handler.sh
``` ```
@ -392,13 +392,13 @@ Or, using the watch command:
State: State:
```shell ```shell-session
$ consul watch -type=checks -state=passing /usr/bin/my-check-handler.sh -passing $ consul watch -type=checks -state=passing /usr/bin/my-check-handler.sh -passing
``` ```
Service: Service:
```shell ```shell-session
$ consul watch -type=checks -service=redis /usr/bin/my-check-handler.sh -redis $ consul watch -type=checks -service=redis /usr/bin/my-check-handler.sh -redis
``` ```
@ -440,7 +440,7 @@ Here is an example configuration:
Or, using the watch command: Or, using the watch command:
```shell ```shell-session
$ consul watch -type=event -name=web-deploy /usr/bin/my-event-handler.sh -web-deploy $ consul watch -type=event -name=web-deploy /usr/bin/my-event-handler.sh -web-deploy
``` ```
@ -464,6 +464,6 @@ An example of the output of this command:
To fire a new `web-deploy` event the following could be used: To fire a new `web-deploy` event the following could be used:
```shell ```shell-session
$ consul event -name=web-deploy 1609030 $ consul event -name=web-deploy 1609030
``` ```

View File

@ -71,7 +71,7 @@ Usage: `consul acl auth-method create [options] [args]`
Create a new Kubernetes auth method: Create a new Kubernetes auth method:
```shell ```shell-session
$ consul acl auth-method create -name minikube -type kubernetes \ $ consul acl auth-method create -name minikube -type kubernetes \
-description 'minikube auth method' \ -description 'minikube auth method' \
-kubernetes-host 'https://192.0.2.42:8443' \ -kubernetes-host 'https://192.0.2.42:8443' \

View File

@ -32,7 +32,7 @@ Usage: `consul acl auth-method delete [options]`
Delete an auth method: Delete an auth method:
```shell ```shell-session
$ consul acl auth-method delete -name minikube $ consul acl auth-method delete -name minikube
Auth-method "minikube" deleted successfully Auth-method "minikube" deleted successfully
``` ```

View File

@ -45,7 +45,7 @@ of the subcommand in the sidebar.
Create a new auth method: Create a new auth method:
```shell ```shell-session
$ consul acl auth-method create -type "kubernetes" \ $ consul acl auth-method create -type "kubernetes" \
-name "my-k8s" \ -name "my-k8s" \
-description "This is an example kube auth method" \ -description "This is an example kube auth method" \
@ -56,13 +56,13 @@ $ consul acl auth-method create -type "kubernetes" \
List all auth methods: List all auth methods:
```shell ```shell-session
$ consul acl auth-method list $ consul acl auth-method list
``` ```
Update all editable fields of the auth method: Update all editable fields of the auth method:
```shell ```shell-session
$ consul acl auth-method update -name "my-k8s" \ $ consul acl auth-method update -name "my-k8s" \
-description "new description" \ -description "new description" \
-kubernetes-host "https://new-apiserver.example.com:8443" \ -kubernetes-host "https://new-apiserver.example.com:8443" \
@ -72,12 +72,12 @@ $ consul acl auth-method update -name "my-k8s" \
Read an auth method: Read an auth method:
```shell ```shell-session
$ consul acl auth-method read -name my-k8s $ consul acl auth-method read -name my-k8s
``` ```
Delete an auth method: Delete an auth method:
```shell ```shell-session
$ consul acl auth-method delete -name my-k8s $ consul acl auth-method delete -name my-k8s
``` ```

View File

@ -35,7 +35,7 @@ Usage: `consul acl auth-method list`
Default listing. Default listing.
```shell ```shell-session
$ consul acl auth-method list $ consul acl auth-method list
minikube: minikube:
Type: kubernetes Type: kubernetes
@ -47,7 +47,7 @@ minikube-two:
Show Metadata. Show Metadata.
```shell ```shell-session
$ consul acl auth-method list -meta $ consul acl auth-method list -meta
minikube: minikube:
Type: kubernetes Type: kubernetes

View File

@ -37,7 +37,7 @@ Usage: `consul acl auth-method read [options] [args]`
Get auth method details: Get auth method details:
```shell ```shell-session
$ consul acl auth-method read -name minikube $ consul acl auth-method read -name minikube
Name: minikube Name: minikube
Type: kubernetes Type: kubernetes

View File

@ -76,7 +76,7 @@ Usage: `consul acl auth-method update [options] [args]`
Update an auth method: Update an auth method:
```shell ```shell-session
$ consul acl auth-method update -name minikube \ $ consul acl auth-method update -name minikube \
-description 'dev cluster' \ -description 'dev cluster' \
-kubernetes-host 'https://192.0.2.44:8443' -kubernetes-host 'https://192.0.2.44:8443'

View File

@ -48,7 +48,7 @@ Usage: `consul acl binding-rule create [options] [args]`
Create a new binding rule that binds to a service identity: Create a new binding rule that binds to a service identity:
```shell ```shell-session
$ consul acl binding-rule create -method 'minikube' \ $ consul acl binding-rule create -method 'minikube' \
-description 'wildcard service' \ -description 'wildcard service' \
-bind-type 'service' \ -bind-type 'service' \
@ -64,7 +64,7 @@ Selector: serviceaccount.namespace==default and serviceaccount.name!=vault
Create a new binding rule that binds to a role: Create a new binding rule that binds to a role:
```shell ```shell-session
$ consul acl binding-rule create -method 'minikube' \ $ consul acl binding-rule create -method 'minikube' \
-description 'just vault role' \ -description 'just vault role' \
-bind-type 'role' \ -bind-type 'role' \

View File

@ -33,7 +33,7 @@ Usage: `consul acl binding-rule delete [options]`
Delete a binding rule: Delete a binding rule:
```shell ```shell-session
$ consul acl binding-rule delete -id 0ec1bd $ consul acl binding-rule delete -id 0ec1bd
Binding rule "0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890" deleted successfully Binding rule "0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890" deleted successfully
``` ```

View File

@ -55,7 +55,7 @@ resolved to the full UUID and used.
Create a new binding rule: Create a new binding rule:
```shell ```shell-session
$ consul acl binding-rule create \ $ consul acl binding-rule create \
-method=minikube \ -method=minikube \
-bind-type=service \ -bind-type=service \
@ -65,25 +65,25 @@ $ consul acl binding-rule create \
List all binding rules: List all binding rules:
```shell ```shell-session
$ consul acl binding-rule list $ consul acl binding-rule list
``` ```
Update a binding rule: Update a binding rule:
```shell ```shell-session
$ consul acl binding-rule update -id=43cb72df-9c6f-4315-ac8a-01a9d98155ef \ $ consul acl binding-rule update -id=43cb72df-9c6f-4315-ac8a-01a9d98155ef \
-bind-name='k8s-${serviceaccount.name}' -bind-name='k8s-${serviceaccount.name}'
``` ```
Read a binding rule: Read a binding rule:
```shell ```shell-session
$ consul acl binding-rule read -id fdabbcb5-9de5-4b1a-961f-77214ae88cba $ consul acl binding-rule read -id fdabbcb5-9de5-4b1a-961f-77214ae88cba
``` ```
Delete a binding rule: Delete a binding rule:
```shell ```shell-session
$ consul acl binding-rule delete -id b6b856da-5193-4e78-845a-7d61ca8371ba $ consul acl binding-rule delete -id b6b856da-5193-4e78-845a-7d61ca8371ba
``` ```

View File

@ -35,7 +35,7 @@ Usage: `consul acl binding-rule list`
Default listing. Default listing.
```shell ```shell-session
$ consul acl binding-rule list $ consul acl binding-rule list
0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890: 0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890:
AuthMethod: minikube AuthMethod: minikube
@ -53,7 +53,7 @@ e21ae868-7b13-a230-0235-f8e83510642c:
Show Metadata. Show Metadata.
```shell ```shell-session
$ consul acl binding-rule list -meta $ consul acl binding-rule list -meta
0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890: 0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890:
AuthMethod: minikube AuthMethod: minikube

View File

@ -38,7 +38,7 @@ Usage: `consul acl binding-rule read [options] [args]`
Get binding rule details: Get binding rule details:
```shell ```shell-session
$ consul acl binding-rule read -id '0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890' $ consul acl binding-rule read -id '0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890'
ID: 0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890 ID: 0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890
AuthMethod: minikube AuthMethod: minikube

View File

@ -55,7 +55,7 @@ Usage: `consul acl binding-rule update [options] [args]`
Update a binding rule: Update a binding rule:
```shell ```shell-session
$ consul acl binding-rule update -id '0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890' \ $ consul acl binding-rule update -id '0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890' \
-selector 'serviceaccount.namespace==default' -selector 'serviceaccount.namespace==default'
Binding rule updated successfully Binding rule updated successfully

View File

@ -17,7 +17,7 @@ ACLs are also accessible via the [HTTP API](/api/acl/acl).
Bootstrap Consul's ACLs: Bootstrap Consul's ACLs:
```shell ```shell-session
$ consul acl bootstrap $ consul acl bootstrap
AccessorID: 4d123dff-f460-73c3-02c4-8dd64d136e01 AccessorID: 4d123dff-f460-73c3-02c4-8dd64d136e01
SecretID: 86cddfb9-2760-d947-358d-a2811156bf31 SecretID: 86cddfb9-2760-d947-358d-a2811156bf31
@ -30,7 +30,7 @@ Policies:
Create a policy: Create a policy:
```shell ```shell-session
$ consul acl policy create -name "acl-replication" -description "Token capable of replicating ACL policies" -rules 'acl = "read"' $ consul acl policy create -name "acl-replication" -description "Token capable of replicating ACL policies" -rules 'acl = "read"'
ID: 35b8ecb0-707c-ee18-2002-81b238b54b38 ID: 35b8ecb0-707c-ee18-2002-81b238b54b38
Name: acl-replication Name: acl-replication
@ -42,7 +42,7 @@ acl = "read"
Create a token: Create a token:
```shell ```shell-session
$ consul acl token create -description "Agent Policy Replication - my-agent" -policy-name "acl-replication" $ consul acl token create -description "Agent Policy Replication - my-agent" -policy-name "acl-replication"
AccessorID: c24c11aa-4e08-e25c-1a67-705a2e8d75a4 AccessorID: c24c11aa-4e08-e25c-1a67-705a2e8d75a4
SecretID: e7024f9c-f016-02dd-6217-daedbffb86ac SecretID: e7024f9c-f016-02dd-6217-daedbffb86ac

View File

@ -66,7 +66,7 @@ Usage: `consul acl policy create [options] [args]`
Create a new policy that is valid in all datacenters: Create a new policy that is valid in all datacenters:
```shell ```shell-session
$ consul acl policy create -name "acl-replication" -description "Policy capable of replicating ACL policies" -rules 'acl = "read"' $ consul acl policy create -name "acl-replication" -description "Policy capable of replicating ACL policies" -rules 'acl = "read"'
ID: 35b8ecb0-707c-ee18-2002-81b238b54b38 ID: 35b8ecb0-707c-ee18-2002-81b238b54b38
Name: acl-replication Name: acl-replication
@ -78,7 +78,7 @@ acl = "read"
Create a new policy valid only in specific datacenters with rules read from a file: Create a new policy valid only in specific datacenters with rules read from a file:
```shell ```shell-session
$ consul acl policy create -name "replication" -description "Replication" -rules @rules.hcl -valid-datacenter dc1 -valid-datacenter dc2 $ consul acl policy create -name "replication" -description "Replication" -rules @rules.hcl -valid-datacenter dc1 -valid-datacenter dc2
ID: ca44555b-a2d8-94de-d763-88caffdaf11f ID: ca44555b-a2d8-94de-d763-88caffdaf11f
Name: replication Name: replication
@ -94,7 +94,7 @@ service_prefix "" {
Create a new policy with rules equivalent to that of a legacy ACL token: Create a new policy with rules equivalent to that of a legacy ACL token:
```shell ```shell-session
$ consul acl policy create -name "node-services-read" -from-token 5793a5ce -description "Can read any node and service" $ consul acl policy create -name "node-services-read" -from-token 5793a5ce -description "Can read any node and service"
ID: 06acc965-df4b-5a99-58cb-3250930c6324 ID: 06acc965-df4b-5a99-58cb-3250930c6324
Name: node-services-read Name: node-services-read

View File

@ -35,14 +35,14 @@ Usage: `consul acl policy delete [options]`
Delete a policy: Delete a policy:
```shell ```shell-session
$ consul acl policy delete -id 35b8 $ consul acl policy delete -id 35b8
Policy "35b8ecb0-707c-ee18-2002-81b238b54b38" deleted successfully Policy "35b8ecb0-707c-ee18-2002-81b238b54b38" deleted successfully
``` ```
Delete a policy by name: Delete a policy by name:
```shell ```shell-session
$ consul acl policy delete -name acl-replication $ consul acl policy delete -name acl-replication
Policy "35b8ecb0-707c-ee18-2002-81b238b54b38" deleted successfully Policy "35b8ecb0-707c-ee18-2002-81b238b54b38" deleted successfully
``` ```

View File

@ -63,7 +63,7 @@ Builtin policies:
Create a new ACL policy: Create a new ACL policy:
```shell ```shell-session
$ consul acl policy create -name "new-policy" \ $ consul acl policy create -name "new-policy" \
-description "This is an example policy" \ -description "This is an example policy" \
-datacenter "dc1" \ -datacenter "dc1" \
@ -73,24 +73,24 @@ $ consul acl policy create -name "new-policy" \
List all policies: List all policies:
```shell ```shell-session
$ consul acl policy list $ consul acl policy list
``` ```
Update a policy: Update a policy:
```shell ```shell-session
$ consul acl policy update -name "other-policy" -datacenter "dc1" $ consul acl policy update -name "other-policy" -datacenter "dc1"
``` ```
Read a policy: Read a policy:
```shell ```shell-session
$ consul acl policy read -id 0479e93e-091c-4475-9b06-79a004765c24 $ consul acl policy read -id 0479e93e-091c-4475-9b06-79a004765c24
``` ```
Delete a policy Delete a policy
```shell ```shell-session
$ consul acl policy delete -name "my-policy" $ consul acl policy delete -name "my-policy"
``` ```

View File

@ -35,7 +35,7 @@ Usage: `consul acl policy list`
Default listing. Default listing.
```shell ```shell-session
$ consul acl policy list $ consul acl policy list
global-management: global-management:
ID: 00000000-0000-0000-0000-000000000001 ID: 00000000-0000-0000-0000-000000000001
@ -49,7 +49,7 @@ acl-replication:
Show Metadata. Show Metadata.
```shell ```shell-session
$ consul acl policy list -meta $ consul acl policy list -meta
global-management: global-management:
ID: 00000000-0000-0000-0000-000000000001 ID: 00000000-0000-0000-0000-000000000001

View File

@ -40,7 +40,7 @@ Usage: `consul acl policy read [options] [args]`
Get policy details: Get policy details:
```shell ```shell-session
$ consul acl policy read -id 00000000-0000-0000-0000-000000000001 $ consul acl policy read -id 00000000-0000-0000-0000-000000000001
ID: 00000000-0000-0000-0000-000000000001 ID: 00000000-0000-0000-0000-000000000001
Name: global-management Name: global-management
@ -77,7 +77,7 @@ session_prefix "" {
Get policy details by name: Get policy details by name:
```shell ```shell-session
$ consul acl policy read -name "acl-replication" $ consul acl policy read -name "acl-replication"
ID: 35b8ecb0-707c-ee18-2002-81b238b54b38 ID: 35b8ecb0-707c-ee18-2002-81b238b54b38
Name: acl-replication Name: acl-replication
@ -91,7 +91,7 @@ Get policy details (Builtin Policies):
Builtin policies can be accessed by specifying their original name as the value to the `-id` parameter. Builtin policies can be accessed by specifying their original name as the value to the `-id` parameter.
```shell ```shell-session
$ consul acl policy read -id global-management $ consul acl policy read -id global-management
ID: 00000000-0000-0000-0000-000000000001 ID: 00000000-0000-0000-0000-000000000001
Name: global-management Name: global-management

View File

@ -57,7 +57,7 @@ Usage: `consul acl policy update [options] [args]`
Update a policy: Update a policy:
```shell ```shell-session
$ consul acl policy update -id 35b8 -name "replication" -description "Policy capable of replication ACL policies and Intentions" -rules @rules.hcl $ consul acl policy update -id 35b8 -name "replication" -description "Policy capable of replication ACL policies and Intentions" -rules @rules.hcl
Policy updated successfully Policy updated successfully
ID: 35b8ecb0-707c-ee18-2002-81b238b54b38 ID: 35b8ecb0-707c-ee18-2002-81b238b54b38
@ -75,7 +75,7 @@ service_prefix "" {
Rename a policy: Rename a policy:
```shell ```shell-session
$ consul acl policy update -id 35b8 -name "dc1-replication" $ consul acl policy update -id 35b8 -name "dc1-replication"
Policy updated successfully Policy updated successfully
ID: 35b8ecb0-707c-ee18-2002-81b238b54b38 ID: 35b8ecb0-707c-ee18-2002-81b238b54b38

View File

@ -49,7 +49,7 @@ Usage: `consul acl role create [options] [args]`
Create a new role with one policy: Create a new role with one policy:
```shell ```shell-session
$ consul acl role create -name "crawler" -description "web crawler role" -policy-name "crawler-kv" $ consul acl role create -name "crawler" -description "web crawler role" -policy-name "crawler-kv"
ID: 57147d87-6bf7-f794-1a6e-7d038c4e4ae9 ID: 57147d87-6bf7-f794-1a6e-7d038c4e4ae9
Name: crawler Name: crawler
@ -60,7 +60,7 @@ Policies:
Create a new role with one service identity: Create a new role with one service identity:
```shell ```shell-session
$ consul acl role create -name archiver -description 'archiver role' -service-identity "archiver:dc2" $ consul acl role create -name archiver -description 'archiver role' -service-identity "archiver:dc2"
ID: a365fdc9-ac71-e754-0645-7ab6bd747301 ID: a365fdc9-ac71-e754-0645-7ab6bd747301
Name: archiver Name: archiver

View File

@ -35,14 +35,14 @@ Usage: `consul acl role delete [options]`
Delete a role by prefix: Delete a role by prefix:
```shell ```shell-session
$ consul acl role delete -id 57147 $ consul acl role delete -id 57147
Role "57147d87-6bf7-f794-1a6e-7d038c4e4ae9" deleted successfully Role "57147d87-6bf7-f794-1a6e-7d038c4e4ae9" deleted successfully
``` ```
Delete a role by name: Delete a role by name:
```shell ```shell-session
$ consul acl role delete -name crawler $ consul acl role delete -name crawler
Role "a365fdc9-ac71-e754-0645-7ab6bd747301" deleted successfully Role "a365fdc9-ac71-e754-0645-7ab6bd747301" deleted successfully
``` ```

View File

@ -55,7 +55,7 @@ full UUID and used.
Create a new ACL role: Create a new ACL role:
```shell ```shell-session
$ consul acl role create -name "new-role" \ $ consul acl role create -name "new-role" \
-description "This is an example role" \ -description "This is an example role" \
-policy-id 06acc965 -policy-id 06acc965
@ -63,24 +63,24 @@ $ consul acl role create -name "new-role" \
List all roles: List all roles:
```shell ```shell-session
$ consul acl role list $ consul acl role list
``` ```
Update a role: Update a role:
```shell ```shell-session
$ consul acl role update -name "other-role" -datacenter "dc1" $ consul acl role update -name "other-role" -datacenter "dc1"
``` ```
Read a role: Read a role:
```shell ```shell-session
$ consul acl role read -id 0479e93e-091c-4475-9b06-79a004765c24 $ consul acl role read -id 0479e93e-091c-4475-9b06-79a004765c24
``` ```
Delete a role Delete a role
```shell ```shell-session
$ consul acl role delete -name "my-role" $ consul acl role delete -name "my-role"
``` ```

View File

@ -35,7 +35,7 @@ Usage: `consul acl role list`
Default listing. Default listing.
```shell ```shell-session
$ consul acl role list $ consul acl role list
web-crawler: web-crawler:
ID: 57147d87-6bf7-f794-1a6e-7d038c4e4ae9 ID: 57147d87-6bf7-f794-1a6e-7d038c4e4ae9
@ -53,7 +53,7 @@ archiver:
Show Metadata. Show Metadata.
```shell ```shell-session
$ consul acl role list -meta $ consul acl role list -meta
web-crawler: web-crawler:
ID: 57147d87-6bf7-f794-1a6e-7d038c4e4ae9 ID: 57147d87-6bf7-f794-1a6e-7d038c4e4ae9

View File

@ -40,7 +40,7 @@ Usage: `consul acl role read [options] [args]`
Get role details: Get role details:
```shell ```shell-session
$ consul acl role read -id 57147d87-6bf7-f794-1a6e-7d038c4e4ae9 $ consul acl role read -id 57147d87-6bf7-f794-1a6e-7d038c4e4ae9
ID: 57147d87-6bf7-f794-1a6e-7d038c4e4ae9 ID: 57147d87-6bf7-f794-1a6e-7d038c4e4ae9
Name: crawler Name: crawler
@ -51,7 +51,7 @@ Policies:
Get role details by name: Get role details by name:
```shell ```shell-session
$ consul acl role read -name archiver $ consul acl role read -name archiver
ID: a365fdc9-ac71-e754-0645-7ab6bd747301 ID: a365fdc9-ac71-e754-0645-7ab6bd747301
Name: archiver Name: archiver

View File

@ -60,7 +60,7 @@ Usage: `consul acl role update [options] [args]`
Update a role: Update a role:
```shell ```shell-session
$ consul acl role update -id 57147d87-6bf7-f794-1a6e-7d038c4e4ae9 \ $ consul acl role update -id 57147d87-6bf7-f794-1a6e-7d038c4e4ae9 \
-description 'web crawler updated role' -service-identity 'crawler' -description 'web crawler updated role' -service-identity 'crawler'
Role updated successfully Role updated successfully
@ -75,7 +75,7 @@ Service Identities:
Rename a role by prefix: Rename a role by prefix:
```shell ```shell-session
$ consul acl role update -id 57147 -name web-crawler $ consul acl role update -id 57147 -name web-crawler
Role updated successfully Role updated successfully
ID: 57147d87-6bf7-f794-1a6e-7d038c4e4ae9 ID: 57147d87-6bf7-f794-1a6e-7d038c4e4ae9

View File

@ -44,6 +44,6 @@ Usage: `consul acl set-agent-token [options] TYPE TOKEN`
Set the `default` token: Set the `default` token:
``` ```shell-session
$ consul acl set-agent-token default c4d0f8df-3aba-4ab6-a7a0-35b760dc29a1 $ consul acl set-agent-token default c4d0f8df-3aba-4ab6-a7a0-35b760dc29a1
``` ```

View File

@ -39,7 +39,7 @@ Usage: `consul acl token clone [options]`
Clone a token: Clone a token:
```shell ```shell-session
$ consul acl token clone -id 59f8 -description "Clone of Super User" $ consul acl token clone -id 59f8 -description "Clone of Super User"
Token cloned successfully. Token cloned successfully.
AccessorID: dcfa52ed-9288-b3ff-056d-255ef69d2d88 AccessorID: dcfa52ed-9288-b3ff-056d-255ef69d2d88

View File

@ -63,7 +63,7 @@ Usage: `consul acl token create [options] [args]`
Create a new token: Create a new token:
```shell ```shell-session
$ consul acl token create -description "Read Nodes and Services" -policy-id 06acc965 $ consul acl token create -description "Read Nodes and Services" -policy-id 06acc965
AccessorID: 986193b5-e2b5-eb26-6264-b524ea60cc6d AccessorID: 986193b5-e2b5-eb26-6264-b524ea60cc6d
SecretID: ec15675e-2999-d789-832e-8c4794daa8d7 SecretID: ec15675e-2999-d789-832e-8c4794daa8d7
@ -76,7 +76,7 @@ Policies:
Create a new local token: Create a new local token:
```shell ```shell-session
$ consul acl token create -description "Read Nodes and Services" -policy-id 06acc965 -local $ consul acl token create -description "Read Nodes and Services" -policy-id 06acc965 -local
AccessorID: 4fdf0ec8-d251-3865-079c-7247c974fc50 AccessorID: 4fdf0ec8-d251-3865-079c-7247c974fc50
SecretID: 02143514-abf2-6c23-0aa1-ec2107e68f6b SecretID: 02143514-abf2-6c23-0aa1-ec2107e68f6b
@ -89,7 +89,7 @@ Policies:
Create a new token and link with policies by name: Create a new token and link with policies by name:
```shell ```shell-session
$ consul acl token create -description "Super User" -policy-name global-management $ consul acl token create -description "Super User" -policy-name global-management
AccessorID: 59f86a9b-d3b6-166c-32a0-be4ab3f94caa AccessorID: 59f86a9b-d3b6-166c-32a0-be4ab3f94caa
SecretID: ada7f751-f654-8872-7f93-498e799158b6 SecretID: ada7f751-f654-8872-7f93-498e799158b6
@ -102,7 +102,7 @@ Policies:
Create a new token with one service identity that expires in 15 minutes: Create a new token with one service identity that expires in 15 minutes:
```shell ```shell-session
$ consul acl token create -description 'crawler token' -service-identity 'crawler' -expires-ttl '15m' $ consul acl token create -description 'crawler token' -service-identity 'crawler' -expires-ttl '15m'
AccessorID: 0c083aca-6c15-f0cc-c4d9-30578db54cd9 AccessorID: 0c083aca-6c15-f0cc-c4d9-30578db54cd9
SecretID: 930dafb6-5c08-040b-23fb-a368a95256f9 SecretID: 930dafb6-5c08-040b-23fb-a368a95256f9

View File

@ -33,7 +33,7 @@ Usage: `consul acl token delete [options]`
Delete a token: Delete a token:
```shell ```shell-session
$ consul acl token delete -id 35b8 $ consul acl token delete -id 35b8
Token "35b8ecb0-707c-ee18-2002-81b238b54b38" deleted successfully Token "35b8ecb0-707c-ee18-2002-81b238b54b38" deleted successfully
``` ```

View File

@ -61,7 +61,7 @@ Builtin Tokens:
Create a new ACL token: Create a new ACL token:
```shell ```shell-session
$ consul acl token create \ $ consul acl token create \
-description "This is an example token" \ -description "This is an example token" \
-policy-id 06acc965 -policy-id 06acc965
@ -69,24 +69,24 @@ $ consul acl token create \
List all tokens: List all tokens:
```shell ```shell-session
$ consul acl token list $ consul acl token list
``` ```
Update a token: Update a token:
```shell ```shell-session
$ consul acl token update -id 986193 -description "WonderToken" $ consul acl token update -id 986193 -description "WonderToken"
``` ```
Read a token with an accessor ID: Read a token with an accessor ID:
```shell ```shell-session
$ consul acl token read -id 986193 $ consul acl token read -id 986193
``` ```
Delete a token Delete a token
```shell ```shell-session
$ consul acl token delete -id 986193 $ consul acl token delete -id 986193
``` ```

View File

@ -35,7 +35,7 @@ Usage: `consul acl token list`
Default listing. Default listing.
```shell ```shell-session
$ consul acl token list $ consul acl token list
AccessorID: 4d123dff-f460-73c3-02c4-8dd64d136e01 AccessorID: 4d123dff-f460-73c3-02c4-8dd64d136e01
Description: Bootstrap Token (Global Management) Description: Bootstrap Token (Global Management)

View File

@ -41,7 +41,7 @@ Usage: `consul acl token read [options] [args]`
Get token details: Get token details:
```shell ```shell-session
$ consul acl token read -id 986 $ consul acl token read -id 986
AccessorID: 986193b5-e2b5-eb26-6264-b524ea60cc6d AccessorID: 986193b5-e2b5-eb26-6264-b524ea60cc6d
SecretID: ec15675e-2999-d789-832e-8c4794daa8d7 SecretID: ec15675e-2999-d789-832e-8c4794daa8d7
@ -67,7 +67,7 @@ Policies:
Get token details (Builtin Tokens) Get token details (Builtin Tokens)
```shell ```shell-session
$ consul acl token read -id anonymous $ consul acl token read -id anonymous
AccessorID: 00000000-0000-0000-0000-000000000002 AccessorID: 00000000-0000-0000-0000-000000000002
SecretID: anonymous SecretID: anonymous

View File

@ -69,7 +69,7 @@ guide.
Update the anonymous token: Update the anonymous token:
```shell ```shell-session
$ consul acl token update -id anonymous -policy-id 06acc $ consul acl token update -id anonymous -policy-id 06acc
Token updated successfully. Token updated successfully.
AccessorID: 00000000-0000-0000-0000-000000000002 AccessorID: 00000000-0000-0000-0000-000000000002
@ -83,7 +83,7 @@ Policies:
Update a token description and take the policies from the existing token: Update a token description and take the policies from the existing token:
```shell ```shell-session
$ consul acl token update -id 986193 -description "WonderToken" -merge-policies $ consul acl token update -id 986193 -description "WonderToken" -merge-policies
Token updated successfully. Token updated successfully.
AccessorID: 986193b5-e2b5-eb26-6264-b524ea60cc6d AccessorID: 986193b5-e2b5-eb26-6264-b524ea60cc6d

View File

@ -42,30 +42,30 @@ Usage: `consul acl translate rules [options] TRANSLATE`
Translate rules within a file: Translate rules within a file:
```shell ```shell-session
$ consul acl translate-rules @rules.hcl $ consul acl translate-rules @rules.hcl
``` ```
Translate rules from stdin: Translate rules from stdin:
```shell ```shell-session
$ consul acl translate-rules - $ consul acl translate-rules -
``` ```
Translate rules from a string argument: Translate rules from a string argument:
```shell ```shell-session
$ consul acl translate-rules 'key "" { policy = "write"}' $ consul acl translate-rules 'key "" { policy = "write"}'
``` ```
Translate rules for a legacy ACL token using its SecretID passed from stdin: Translate rules for a legacy ACL token using its SecretID passed from stdin:
```shell ```shell-session
$ consul acl translate-rules --token-secret - $ consul acl translate-rules --token-secret -
``` ```
Translate rules for a legacy ACL token using its AccessorID: Translate rules for a legacy ACL token using its AccessorID:
```shell ```shell-session
$ consul acl translate-rules 429cd746-03d5-4bbb-a83a-18b164171c89 $ consul acl translate-rules 429cd746-03d5-4bbb-a83a-18b164171c89
``` ```

View File

@ -14,7 +14,7 @@ The `catalog datacenters` command prints all known datacenters.
List all datacenters: List all datacenters:
``` ```shell-session
$ consul catalog datacenters $ consul catalog datacenters
dc1 dc1
dc2 dc2

View File

@ -18,7 +18,7 @@ The catalog is also accessible via the [HTTP API](/api/catalog).
List all datacenters: List all datacenters:
```text ```shell-session
$ consul catalog datacenters $ consul catalog datacenters
dc1 dc1
dc2 dc2
@ -27,7 +27,7 @@ dc3
List all nodes: List all nodes:
```text ```shell-session
$ consul catalog nodes $ consul catalog nodes
Node ID Address DC Node ID Address DC
worker-01 1b662d97 10.4.5.31 dc1 worker-01 1b662d97 10.4.5.31 dc1
@ -35,7 +35,7 @@ worker-01 1b662d97 10.4.5.31 dc1
List all nodes which provide a particular service: List all nodes which provide a particular service:
```text ```shell-session
$ consul catalog nodes -service=redis $ consul catalog nodes -service=redis
Node ID Address DC Node ID Address DC
worker-01 1b662d97 10.4.5.31 dc1 worker-01 1b662d97 10.4.5.31 dc1
@ -44,7 +44,7 @@ worker-02 d407a592 10.4.4.158 dc1
List all services: List all services:
```text ```shell-session
$ consul catalog services $ consul catalog services
consul consul
postgresql postgresql
@ -53,7 +53,7 @@ redis
List all services on a node: List all services on a node:
```text ```shell-session
$ consul catalog services -node=worker-01 $ consul catalog services -node=worker-01
consul consul
postgres postgres

View File

@ -16,7 +16,7 @@ particular service.
List all nodes: List all nodes:
```text ```shell-session
$ consul catalog nodes $ consul catalog nodes
Node ID Address DC Node ID Address DC
worker-01 1b662d97 10.4.5.31 dc1 worker-01 1b662d97 10.4.5.31 dc1
@ -24,7 +24,7 @@ worker-01 1b662d97 10.4.5.31 dc1
Print detailed node information such as tagged addresses and node metadata: Print detailed node information such as tagged addresses and node metadata:
```text ```shell-session
$ consul catalog nodes -detailed $ consul catalog nodes -detailed
Node ID Address DC TaggedAddresses Meta Node ID Address DC TaggedAddresses Meta
worker-01 1b662d97-8b5c-3cc2-0ac0-96f55ad423b5 10.4.5.31 dc1 lan=10.4.5.31, wan=10.4.5.31 worker-01 1b662d97-8b5c-3cc2-0ac0-96f55ad423b5 10.4.5.31 dc1 lan=10.4.5.31, wan=10.4.5.31
@ -32,7 +32,7 @@ worker-01 1b662d97-8b5c-3cc2-0ac0-96f55ad423b5 10.4.5.31 dc1 lan=10.4.5.31,
List nodes which provide the service name "web": List nodes which provide the service name "web":
```text ```shell-session
$ consul catalog nodes -service=web $ consul catalog nodes -service=web
Node ID Address DC TaggedAddresses Meta Node ID Address DC TaggedAddresses Meta
worker-01 1b662d97-8b5c-3cc2-0ac0-96f55ad423b5 10.4.5.31 dc1 lan=10.4.5.31, wan=10.4.5.31 worker-01 1b662d97-8b5c-3cc2-0ac0-96f55ad423b5 10.4.5.31 dc1 lan=10.4.5.31, wan=10.4.5.31
@ -40,7 +40,7 @@ worker-01 1b662d97-8b5c-3cc2-0ac0-96f55ad423b5 10.4.5.31 dc1 lan=10.4.5.31,
Sort the resulting node list by estimated round trip time to worker-05: Sort the resulting node list by estimated round trip time to worker-05:
```text ```shell-session
$ consul catalog nodes -near=web-05 $ consul catalog nodes -near=web-05
Node ID Address DC TaggedAddresses Meta Node ID Address DC TaggedAddresses Meta
worker-01 1b662d97-8b5c-3cc2-0ac0-96f55ad423b5 10.4.5.31 dc1 lan=10.4.5.31, wan=10.4.5.31 worker-01 1b662d97-8b5c-3cc2-0ac0-96f55ad423b5 10.4.5.31 dc1 lan=10.4.5.31, wan=10.4.5.31

View File

@ -16,7 +16,7 @@ particular node provides.
List all services: List all services:
```text ```shell-session
$ consul catalog services $ consul catalog services
consul consul
postgresql postgresql
@ -25,7 +25,7 @@ redis
Show all services with their tags: Show all services with their tags:
```text ```shell-session
$ consul catalog services -tags $ consul catalog services -tags
consul consul
postgresql leader postgresql leader
@ -34,7 +34,7 @@ redis primary,v1
List services for the node "worker-01": List services for the node "worker-01":
```text ```shell-session
$ consul catalog services -node=worker-01 $ consul catalog services -node=worker-01
consul consul
redis redis

View File

@ -145,7 +145,7 @@ service {
The sidecar Envoy process can be started with. The sidecar Envoy process can be started with.
```text ```shell-session
$ consul connect envoy -sidecar-for web $ consul connect envoy -sidecar-for web
``` ```
@ -158,7 +158,7 @@ agent is using all-default configuration.
To pass additional arguments directly to Envoy, for example output logging To pass additional arguments directly to Envoy, for example output logging
level, you can use: level, you can use:
```text ```shell-session
$ consul connect envoy -sidecar-for web -- -l debug $ consul connect envoy -sidecar-for web -- -l debug
``` ```
@ -168,7 +168,7 @@ To run multiple different proxy instances on the same host, you will
need to use `-admin-bind` on all but one to ensure they don't attempt to bind to need to use `-admin-bind` on all but one to ensure they don't attempt to bind to
the same port as in the following example. the same port as in the following example.
```text ```shell-session
$ consul connect envoy -sidecar-for db -admin-bind localhost:19001 $ consul connect envoy -sidecar-for db -admin-bind localhost:19001
``` ```
@ -176,7 +176,7 @@ $ consul connect envoy -sidecar-for db -admin-bind localhost:19001
The mesh gateway Envoy process can be auto-registered and started with the following command. The mesh gateway Envoy process can be auto-registered and started with the following command.
```shell ```shell-session
$ consul connect envoy -gateway=mesh -register \ $ consul connect envoy -gateway=mesh -register \
-address '{{ GetInterfaceIP "eth0" }}:8443' \ -address '{{ GetInterfaceIP "eth0" }}:8443' \
-wan-address '{{ GetInterfaceIP "eth1" }}:8443' -wan-address '{{ GetInterfaceIP "eth1" }}:8443'
@ -186,7 +186,7 @@ $ consul connect envoy -gateway=mesh -register \
The terminating gateway Envoy process can be auto-registered and started with the following command. The terminating gateway Envoy process can be auto-registered and started with the following command.
```shell ```shell-session
$ consul connect envoy -gateway=terminating -register -service my-gateway \ $ consul connect envoy -gateway=terminating -register -service my-gateway \
-address '{{ GetInterfaceIP "eth0" }}:8443' -address '{{ GetInterfaceIP "eth0" }}:8443'
``` ```
@ -195,7 +195,7 @@ $ consul connect envoy -gateway=terminating -register -service my-gateway \
The ingress gateway Envoy process can be auto-registered and started with the following command. The ingress gateway Envoy process can be auto-registered and started with the following command.
```shell ```shell-session
$ consul connect envoy -gateway=ingress -register -service ingress-service \ $ consul connect envoy -gateway=ingress -register -service ingress-service \
-address '{{ GetInterfaceIP "eth0" }}:8888' -address '{{ GetInterfaceIP "eth0" }}:8888'
``` ```

View File

@ -82,14 +82,14 @@ connections to "db" representing the frontend service. Once running, any
process that creates a TCP connection to the specified port (8181) will process that creates a TCP connection to the specified port (8181) will
establish a mutual TLS connection to "db" identified as "frontend". establish a mutual TLS connection to "db" identified as "frontend".
```text ```shell-session
$ consul connect proxy -service frontend -upstream db:8181 $ consul connect proxy -service frontend -upstream db:8181
``` ```
The next example starts a local proxy that also accepts inbound connections The next example starts a local proxy that also accepts inbound connections
on port 8443, authorizes the connection, then proxies it to port 8080: on port 8443, authorizes the connection, then proxies it to port 8080:
```text ```shell-session
$ consul connect proxy \ $ consul connect proxy \
-service frontend \ -service frontend \
-service-addr 127.0.0.1:8080 \ -service-addr 127.0.0.1:8080 \

View File

@ -91,7 +91,7 @@ directory) on the host where the command runs.
By default the command will capture all available data from the default By default the command will capture all available data from the default
agent address on loopback for 2 minutes at 30 second intervals. agent address on loopback for 2 minutes at 30 second intervals.
```text ```shell-session
$ consul debug $ consul debug
... ...
``` ```
@ -99,7 +99,7 @@ $ consul debug
In this example, the archive is collected from a different agent on the In this example, the archive is collected from a different agent on the
network using the standard Consul CLI flag to change the API address. network using the standard Consul CLI flag to change the API address.
```text ```shell-session
$ consul debug -http-addr=10.0.1.10:8500 $ consul debug -http-addr=10.0.1.10:8500
... ...
``` ```
@ -107,7 +107,7 @@ $ consul debug -http-addr=10.0.1.10:8500
The capture flag can be specified to only record a subset of data The capture flag can be specified to only record a subset of data
about the agent and environment. about the agent and environment.
```text ```shell-session
$ consul debug -capture agent -capture host -capture logs $ consul debug -capture agent -capture host -capture logs
... ...
``` ```
@ -116,7 +116,7 @@ The duration of the command and interval of capturing dynamic
information (such as metrics) can be specified with the `-interval` information (such as metrics) can be specified with the `-interval`
and `-duration` flags. and `-duration` flags.
```text ```shell-session
$ consul debug -interval=15s -duration=1m $ consul debug -interval=15s -duration=1m
... ...
``` ```

View File

@ -24,7 +24,7 @@ as you'd most likely expect. And some commands that expect input accept
To view a list of the available commands at any time, just run `consul` with To view a list of the available commands at any time, just run `consul` with
no arguments: no arguments:
```text ```shell-session
$ consul $ consul
Usage: consul [--version] [--help] <command> [<args>] Usage: consul [--version] [--help] <command> [<args>]
@ -64,7 +64,7 @@ Available commands are:
To get help for any specific command, pass the `-h` flag to the relevant To get help for any specific command, pass the `-h` flag to the relevant
subcommand. For example, to see help about the `join` subcommand: subcommand. For example, to see help about the `join` subcommand:
```text ```shell-session
$ consul join -h $ consul join -h
Usage: consul join [options] address ... Usage: consul join [options] address ...
@ -100,7 +100,7 @@ you can invoke a new shell and use the feature.
For example, assume a tab is typed at the end of each prompt line: For example, assume a tab is typed at the end of each prompt line:
```shell ```shell-session
$ consul e $ consul e
event exec event exec

View File

@ -28,7 +28,7 @@ Usage: `consul intention check [options] SRC DST`
## Examples ## Examples
```text ```shell-session
$ consul intention check web db $ consul intention check web db
Denied Denied

View File

@ -39,18 +39,18 @@ Usage: `consul intention create [options] -f FILE...`
Create an intention `web => db`: Create an intention `web => db`:
```shell ```shell-session
$ consul intention create web db $ consul intention create web db
``` ```
Create intentions from a set of files: Create intentions from a set of files:
```shell ```shell-session
$ consul intention create -file one.json two.json $ consul intention create -file one.json two.json
``` ```
Create intentions from a directory using shell expansion: Create intentions from a directory using shell expansion:
```shell ```shell-session
$ consul intention create -file intentions/*.json $ consul intention create -file intentions/*.json
``` ```

View File

@ -25,12 +25,12 @@ Usage:
Delete an intention from "web" to "db" with any action: Delete an intention from "web" to "db" with any action:
```text ```shell-session
$ consul intention delete web db $ consul intention delete web db
``` ```
Delete an intention by unique ID: Delete an intention by unique ID:
```text ```shell-session
$ consul intention delete 4ffed935-439c-695d-4f51-f4fc0b12a7a7 $ consul intention delete 4ffed935-439c-695d-4f51-f4fc0b12a7a7
``` ```

View File

@ -23,7 +23,7 @@ Usage:
## Examples ## Examples
```text ```shell-session
$ consul intention get web db $ consul intention get web db
Source: web Source: web
Destination: db Destination: db

View File

@ -42,25 +42,25 @@ of the subcommand in the sidebar.
Create an intention to allow "web" to talk to "db": Create an intention to allow "web" to talk to "db":
```shell ```shell-session
$ consul intention create web db $ consul intention create web db
``` ```
Create an intention to deny "db" from initiating connections to _any_ service: Create an intention to deny "db" from initiating connections to _any_ service:
```shell ```shell-session
$ consul intention create -deny db '*' $ consul intention create -deny db '*'
Created: db => * (deny) Created: db => * (deny)
``` ```
Test whether a "web" is allowed to connect to "db": Test whether a "web" is allowed to connect to "db":
```shell ```shell-session
$ consul intention check web db $ consul intention check web db
``` ```
Find all intentions for communicating to the "db" service: Find all intentions for communicating to the "db" service:
```shell ```shell-session
$ consul intention match db $ consul intention match db
``` ```

Some files were not shown because too many files have changed in this diff Show More