update dependencies
This commit is contained in:
parent
5aefdea1a8
commit
306e8c84b6
|
@ -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 })
|
||||
})
|
||||
}
|
|
@ -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
|
|
@ -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");`,
|
||||
},
|
||||
],
|
||||
}
|
|
@ -16,6 +16,9 @@ module.exports = withHashicorp({
|
|||
],
|
||||
},
|
||||
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',
|
||||
},
|
||||
})
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -7,7 +7,7 @@
|
|||
"@bugsnag/js": "^7.0.1",
|
||||
"@bugsnag/plugin-react": "^7.0.1",
|
||||
"@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-banner": "^3.0.13",
|
||||
"@hashicorp/react-button": "^2.1.9",
|
||||
|
|
|
@ -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‘re sorry but we can‘t find the page you‘re looking
|
||||
for.
|
||||
</p>
|
||||
<p>
|
||||
<Link href="/">
|
||||
<a>Back to Home</a>
|
||||
</Link>
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -1,106 +1,89 @@
|
|||
import './style.css'
|
||||
import App from 'next/app'
|
||||
import NProgress from 'nprogress'
|
||||
import '@hashicorp/nextjs-scripts/lib/nprogress/style.css'
|
||||
|
||||
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 Footer from '../components/footer'
|
||||
import AlertBanner from '@hashicorp/react-alert-banner'
|
||||
import { ConsentManager, open } from '@hashicorp/react-consent-manager'
|
||||
import consentManagerConfig from '../lib/consent-manager-config'
|
||||
import bugsnagClient from '../lib/bugsnag'
|
||||
import anchorLinkAnalytics from '../lib/anchor-link-analytics'
|
||||
import Footer from '../components/footer'
|
||||
import ProductSubnav from '../components/subnav'
|
||||
import alertBannerData, { ALERT_BANNER_ACTIVE } from '../data/alert-banner'
|
||||
import Error from './_error'
|
||||
import Head from 'next/head'
|
||||
import HashiHead from '@hashicorp/react-head'
|
||||
|
||||
Router.events.on('routeChangeStart', NProgress.start)
|
||||
Router.events.on('routeChangeError', NProgress.done)
|
||||
Router.events.on('routeChangeComplete', (url) => {
|
||||
setTimeout(() => window.analytics.page(url), 0)
|
||||
NProgress.done()
|
||||
NProgress({ Router })
|
||||
const { ConsentManager, openConsentManager } = createConsentManager({
|
||||
preset: 'oss',
|
||||
})
|
||||
|
||||
// Bugsnag
|
||||
const ErrorBoundary = bugsnagClient.getPlugin('react')
|
||||
|
||||
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 (
|
||||
<ErrorBoundary FallbackComponent={Error}>
|
||||
<HashiHead
|
||||
is={Head}
|
||||
title="Consul by HashiCorp"
|
||||
siteName="Consul by HashiCorp"
|
||||
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"
|
||||
stylesheet={[
|
||||
{ href: '/css/nprogress.css' },
|
||||
{
|
||||
href:
|
||||
'https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&display=swap',
|
||||
},
|
||||
]}
|
||||
icon={[{ href: '/favicon.ico' }]}
|
||||
preload={[
|
||||
{ href: '/fonts/klavika/medium.woff2', as: 'font' },
|
||||
{ href: '/fonts/gilmer/light.woff2', as: 'font' },
|
||||
{ href: '/fonts/gilmer/regular.woff2', as: 'font' },
|
||||
{ href: '/fonts/gilmer/medium.woff2', as: 'font' },
|
||||
{ href: '/fonts/gilmer/bold.woff2', as: 'font' },
|
||||
{ href: '/fonts/metro-sans/book.woff2', as: 'font' },
|
||||
{ href: '/fonts/metro-sans/regular.woff2', as: 'font' },
|
||||
{ href: '/fonts/metro-sans/semi-bold.woff2', as: 'font' },
|
||||
{ href: '/fonts/metro-sans/bold.woff2', as: 'font' },
|
||||
{ href: '/fonts/dejavu/mono.woff2', as: 'font' },
|
||||
]}
|
||||
>
|
||||
<meta
|
||||
name="og:title"
|
||||
property="og:title"
|
||||
content="Consul by HashiCorp"
|
||||
/>
|
||||
</HashiHead>
|
||||
{ALERT_BANNER_ACTIVE && (
|
||||
<AlertBanner {...alertBannerData} theme="consul" />
|
||||
)}
|
||||
<MegaNav product="Consul" />
|
||||
<ProductSubnav />
|
||||
<div className="content">
|
||||
<Component {...pageProps} />
|
||||
</div>
|
||||
<Footer openConsentManager={open} />
|
||||
<ConsentManager {...consentManagerConfig} />
|
||||
</ErrorBoundary>
|
||||
)
|
||||
}
|
||||
function App({ Component, pageProps }) {
|
||||
useAnchorLinkAnalytics()
|
||||
return (
|
||||
<ErrorBoundary FallbackComponent={Error}>
|
||||
<HashiHead
|
||||
is={Head}
|
||||
title="Consul by HashiCorp"
|
||||
siteName="Consul by HashiCorp"
|
||||
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"
|
||||
stylesheet={[
|
||||
{
|
||||
href:
|
||||
'https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&display=swap',
|
||||
},
|
||||
]}
|
||||
icon={[{ href: '/favicon.ico' }]}
|
||||
preload={[
|
||||
{ href: '/fonts/klavika/medium.woff2', as: 'font' },
|
||||
{ href: '/fonts/gilmer/light.woff2', as: 'font' },
|
||||
{ href: '/fonts/gilmer/regular.woff2', as: 'font' },
|
||||
{ href: '/fonts/gilmer/medium.woff2', as: 'font' },
|
||||
{ href: '/fonts/gilmer/bold.woff2', as: 'font' },
|
||||
{ href: '/fonts/metro-sans/book.woff2', as: 'font' },
|
||||
{ href: '/fonts/metro-sans/regular.woff2', as: 'font' },
|
||||
{ href: '/fonts/metro-sans/semi-bold.woff2', as: 'font' },
|
||||
{ href: '/fonts/metro-sans/bold.woff2', as: 'font' },
|
||||
{ href: '/fonts/dejavu/mono.woff2', as: 'font' },
|
||||
]}
|
||||
>
|
||||
<meta
|
||||
name="og:title"
|
||||
property="og:title"
|
||||
content="Consul by HashiCorp"
|
||||
/>
|
||||
</HashiHead>
|
||||
{ALERT_BANNER_ACTIVE && (
|
||||
<AlertBanner {...alertBannerData} theme="consul" />
|
||||
)}
|
||||
<MegaNav product="Consul" />
|
||||
<ProductSubnav />
|
||||
<div className="content">
|
||||
<Component {...pageProps} />
|
||||
</div>
|
||||
<Footer openConsentManager={openConsentManager} />
|
||||
<ConsentManager />
|
||||
</ErrorBoundary>
|
||||
)
|
||||
}
|
||||
|
||||
export default NextApp
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
return { pageProps }
|
||||
}
|
||||
|
||||
export default App
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
import React from 'react'
|
||||
import ErrorPage from 'next/error'
|
||||
import bugsnagClient from '../lib/bugsnag'
|
||||
import NotFound from './404'
|
||||
import Bugsnag from '@hashicorp/nextjs-scripts/lib/bugsnag'
|
||||
|
||||
export default class Page extends React.Component {
|
||||
static async getInitialProps(ctx) {
|
||||
if (ctx.err) bugsnagClient.notify(ctx.err)
|
||||
return ErrorPage.getInitialProps(ctx)
|
||||
}
|
||||
render() {
|
||||
return <ErrorPage statusCode={this.props.statusCode || '¯\\_(ツ)_/¯'} />
|
||||
}
|
||||
function Error({ statusCode }) {
|
||||
console.log('this is working')
|
||||
return <NotFound statusCode={statusCode} />
|
||||
}
|
||||
|
||||
Error.getInitialProps = ({ res, err }) => {
|
||||
if (err) Bugsnag.notify(err)
|
||||
const statusCode = res ? res.statusCode : err ? err.statusCode : 404
|
||||
return { statusCode }
|
||||
}
|
||||
|
||||
export default Error
|
||||
|
|
|
@ -42,7 +42,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
http://127.0.0.1:8500/v1/acl/bootstrap
|
||||
|
@ -108,7 +108,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload.json \
|
||||
|
@ -160,7 +160,7 @@ required.
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload.json \
|
||||
|
@ -202,7 +202,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/acl/list
|
||||
```
|
||||
|
@ -373,7 +373,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/acl/replication
|
||||
```
|
||||
|
|
|
@ -54,7 +54,7 @@ The table below shows this endpoint's support for
|
|||
- `MaxTokenTTL` `(duration: 0s)` - This specifies the maximum life of any token
|
||||
created by this auth method. When set it will initialize the
|
||||
[`ExpirationTime`](/api/acl/tokens.html#expirationtime) field on all tokens
|
||||
to a value of `Token.CreateTime + AuthMethod.MaxTokenTTL`. This field is not
|
||||
to a value of `Token.CreateTime + AuthMethod.MaxTokenTTL`. This field is not
|
||||
persisted beyond its initial use. Can be specified in the form of `"60s"` or
|
||||
`"5m"` (i.e., 60 seconds or 5 minutes, respectively). This value must be no
|
||||
smaller than 1 minute and no longer than 24 hours. Added in Consul 1.8.0.
|
||||
|
@ -114,7 +114,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X PUT \
|
||||
--data @payload.json \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X GET http://127.0.0.1:8500/v1/acl/auth-method/minikube
|
||||
```
|
||||
|
||||
|
@ -229,7 +229,7 @@ The table below shows this endpoint's support for
|
|||
- `MaxTokenTTL` `(duration: 0s)` - This specifies the maximum life of any token
|
||||
created by this auth method. When set it will initialize the
|
||||
[`ExpirationTime`](/api/acl/tokens.html#expirationtime) field on all tokens
|
||||
to a value of `Token.CreateTime + AuthMethod.MaxTokenTTL`. This field is not
|
||||
to a value of `Token.CreateTime + AuthMethod.MaxTokenTTL`. This field is not
|
||||
persisted beyond its initial use. Can be specified in the form of `"60s"` or
|
||||
`"5m"` (i.e., 60 seconds or 5 minutes, respectively). This value must be no
|
||||
smaller than 1 minute and no longer than 24 hours. Added in Consul 1.8.0.
|
||||
|
@ -288,7 +288,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X PUT \
|
||||
--data @payload.json \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X DELETE \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X GET http://127.0.0.1:8500/v1/acl/auth-methods
|
||||
```
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X PUT \
|
||||
--data @payload.json \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X PUT \
|
||||
--data @payload.json \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X DELETE \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X GET http://127.0.0.1:8500/v1/acl/binding-rules
|
||||
```
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
http://127.0.0.1:8500/v1/acl/bootstrap
|
||||
|
@ -112,7 +112,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request GET \
|
||||
http://127.0.0.1:8500/v1/acl/replication
|
||||
|
@ -213,7 +213,7 @@ agent "" {
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ 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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ 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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request POST \
|
||||
--data @payload.json \
|
||||
|
@ -379,7 +379,7 @@ deleting a token for which you already must possess its secret.
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl \
|
||||
-H "X-Consul-Token: b78d37c7-0ca7-5f4d-99ee-6d9975ce4586" \
|
||||
--request POST \
|
||||
|
@ -388,7 +388,10 @@ $ curl \
|
|||
|
||||
## 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
|
||||
URL from Consul to start an [OIDC login flow](/docs/acl/auth-methods/oidc).
|
||||
|
@ -417,9 +420,9 @@ replication enabled.
|
|||
### Parameters
|
||||
|
||||
- `AuthMethod` `(string: <required>)` - The name of the auth method to use for
|
||||
login. This must be of type [`oidc`](/docs/acl/auth-methods/oidc).
|
||||
login. This must be of type [`oidc`](/docs/acl/auth-methods/oidc).
|
||||
|
||||
- `RedirectURI` `(string: <required>)` - See [Redirect
|
||||
- `RedirectURI` `(string: <required>)` - See [Redirect
|
||||
URIs](/docs/acl/auth-methods/oidc#redirect-uris) for more information.
|
||||
|
||||
- `ClientNonce` `(string: "")` - Optional client-provided nonce that must match
|
||||
|
@ -447,7 +450,7 @@ replication enabled.
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request POST \
|
||||
--data @payload.json \
|
||||
|
@ -464,7 +467,10 @@ $ curl \
|
|||
|
||||
## 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
|
||||
authorization code for an OIDC ID Token. The ID token will in turn be exchanged
|
||||
|
@ -494,7 +500,7 @@ replication enabled.
|
|||
### Parameters
|
||||
|
||||
- `AuthMethod` `(string: <required>)` - The name of the auth method to use for
|
||||
login. This must be of type [`oidc`](/docs/acl/auth-methods/oidc).
|
||||
login. This must be of type [`oidc`](/docs/acl/auth-methods/oidc).
|
||||
|
||||
- `State` `(string: <required>)` - Opaque state ID that is part of the
|
||||
Authorization URL and will be included in the the redirect following
|
||||
|
@ -529,7 +535,7 @@ replication enabled.
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request POST \
|
||||
--data @payload.json \
|
||||
|
|
|
@ -60,7 +60,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload.json \
|
||||
|
@ -112,7 +112,7 @@ required.
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload.json \
|
||||
|
@ -155,7 +155,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/acl/list
|
||||
```
|
||||
|
|
|
@ -68,7 +68,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X PUT \
|
||||
--data @payload.json \
|
||||
http://127.0.0.1:8500/v1/acl/policy
|
||||
|
@ -120,7 +120,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X PUT \
|
||||
--data @payload.json \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X DELETE \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X GET http://127.0.0.1:8500/v1/acl/policies
|
||||
```
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X PUT \
|
||||
--data @payload.json \
|
||||
http://127.0.0.1:8500/v1/acl/role
|
||||
|
@ -162,7 +162,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X PUT \
|
||||
--data @payload.json \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X DELETE \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X GET http://127.0.0.1:8500/v1/acl/roles
|
||||
```
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X PUT \
|
||||
--data @payload.json \
|
||||
http://127.0.0.1:8500/v1/acl/token
|
||||
|
@ -175,7 +175,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -H "X-Consul-Token: 6a1253d2-1785-24fd-91c2-f8e78c745511" \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X PUT \
|
||||
--data @payload.json \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X PUT \
|
||||
--data @payload.json \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X DELETE \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X GET http://127.0.0.1:8500/v1/acl/tokens
|
||||
```
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/agent/checks
|
||||
```
|
||||
|
@ -220,7 +220,7 @@ The table below shows this endpoint's support for
|
|||
"Shell": "/bin/bash",
|
||||
"HTTP": "https://example.com",
|
||||
"Method": "POST",
|
||||
"Header": { "Content-Type": ["application/json"]},
|
||||
"Header": { "Content-Type": ["application/json"] },
|
||||
"Body": "{\"check\":\"mem\"}",
|
||||
"TCP": "example.com:22",
|
||||
"Interval": "10s",
|
||||
|
@ -231,7 +231,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload.json \
|
||||
|
@ -265,7 +265,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload.json \
|
||||
|
|
|
@ -76,7 +76,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request POST \
|
||||
--data @payload.json \
|
||||
|
@ -120,7 +120,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/agent/connect/ca/leaf/web
|
||||
```
|
||||
|
|
|
@ -53,7 +53,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/agent/members
|
||||
```
|
||||
|
@ -107,7 +107,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/agent/self
|
||||
```
|
||||
|
@ -187,7 +187,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
http://127.0.0.1:8500/v1/agent/reload
|
||||
|
@ -230,7 +230,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/agent/metrics
|
||||
```
|
||||
|
@ -397,7 +397,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/agent/monitor
|
||||
```
|
||||
|
@ -443,7 +443,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
http://127.0.0.1:8500/v1/agent/leave
|
||||
|
@ -515,7 +515,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload.json \
|
||||
|
|
|
@ -45,7 +45,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/agent/services
|
||||
```
|
||||
|
@ -155,7 +155,7 @@ only.
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload.json \
|
||||
|
@ -650,7 +650,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
http://127.0.0.1:8500/v1/agent/service/maintenance/my-service-id?enable=true&reason=For+the+docs
|
||||
|
|
|
@ -156,7 +156,7 @@ and vice versa. A catalog entry can have either, neither, or both.
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload.json \
|
||||
|
@ -236,7 +236,7 @@ The behavior of the endpoint depends on what keys are provided.
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload.json \
|
||||
|
@ -269,7 +269,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/catalog/datacenters
|
||||
```
|
||||
|
@ -319,7 +319,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/catalog/nodes
|
||||
```
|
||||
|
@ -409,7 +409,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/catalog/node-services/my-node
|
||||
```
|
||||
|
|
|
@ -72,7 +72,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload \
|
||||
|
@ -123,7 +123,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request GET \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request GET \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request DELETE \
|
||||
http://127.0.0.1:8500/v1/config/service-defaults/web
|
||||
|
|
|
@ -33,7 +33,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload.json \
|
||||
|
|
|
@ -79,7 +79,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request POST \
|
||||
--data @payload.json \
|
||||
|
@ -128,7 +128,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
'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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload.json \
|
||||
|
@ -329,7 +329,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request DELETE \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/connect/intentions/match?by=source&name=web
|
||||
```
|
||||
|
|
|
@ -41,7 +41,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/coordinate/datacenters
|
||||
```
|
||||
|
@ -104,7 +104,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/coordinate/nodes
|
||||
```
|
||||
|
@ -161,7 +161,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload.json \
|
||||
|
|
|
@ -126,7 +126,7 @@ failover = {
|
|||
|
||||
Request:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl http://127.0.0.1:8500/v1/discovery-chain/web
|
||||
```
|
||||
|
||||
|
@ -203,7 +203,7 @@ redirect {
|
|||
|
||||
Request:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl -X POST \
|
||||
-d'
|
||||
{
|
||||
|
@ -292,7 +292,7 @@ splits = [
|
|||
|
||||
Request:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl http://127.0.0.1:8500/v1/discovery-chain/web?compile-dc=dc2
|
||||
```
|
||||
|
||||
|
@ -428,7 +428,7 @@ routes = [
|
|||
|
||||
Request:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl http://127.0.0.1:8500/v1/discovery-chain/web
|
||||
```
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ Lorem ipsum dolor sit amet, consectetur adipisicing elit...
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload \
|
||||
|
@ -122,7 +122,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/event/list
|
||||
```
|
||||
|
|
|
@ -53,7 +53,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
-H "X-Consul-Namespace: *" \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/health/state/passing?ns=default
|
||||
```
|
||||
|
|
|
@ -23,7 +23,7 @@ clients should communicate via TLS. If you don’t provide a token in the reques
|
|||
|
||||
Below is an example using `curl` with `X-Consul-Token`.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl \
|
||||
--header "X-Consul-Token: <consul token>" \
|
||||
http://127.0.0.1:8500/v1/agent/members
|
||||
|
@ -31,7 +31,7 @@ $ curl \
|
|||
|
||||
Below is an example using `curl` with Bearer scheme.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl \
|
||||
--header "Authorization: Bearer <consul token>" \
|
||||
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`:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data 'hello consul' \
|
||||
|
|
|
@ -76,7 +76,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```bash
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @contents \
|
||||
|
@ -272,7 +272,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request DELETE \
|
||||
http://127.0.0.1:8500/v1/kv/my-key
|
||||
|
|
|
@ -94,7 +94,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X PUT \
|
||||
-H "X-Consul-Token: 5cdcae6c-0cce-4210-86fe-5dff3b984a6e" \
|
||||
--data @payload.json \
|
||||
|
@ -165,7 +165,7 @@ the request has been granted any access in the namespace (read, list or write).
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -H "X-Consul-Token: b23b3cad-5ea1-4413-919e-c76884b9ad60" \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X PUT \
|
||||
-H "X-Consul-Token: 5cdcae6c-0cce-4210-86fe-5dff3b984a6e" \
|
||||
--data @payload.json \
|
||||
|
@ -364,7 +364,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -X DELETE \
|
||||
-H "X-Consul-Token: b23b3cad-5ea1-4413-919e-c76884b9ad60" \
|
||||
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
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ curl -H "X-Consul-Token: 0137db51-5895-4c25-b6cd-d9ed992f4a52" \
|
||||
http://127.0.0.1:8500/v1/namespaces
|
||||
```
|
||||
|
|
|
@ -79,7 +79,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request POST \
|
||||
--data @payload.json \
|
||||
|
@ -120,7 +120,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/operator/area
|
||||
```
|
||||
|
@ -174,7 +174,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload.json \
|
||||
|
@ -210,7 +210,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request DELETE \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload.json \
|
||||
|
@ -365,7 +365,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/operator/area/8f246b77-f3e1-ff88-5b48-8ec93abf3e05/members
|
||||
```
|
||||
|
|
|
@ -46,7 +46,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/operator/autopilot/health
|
||||
```
|
||||
|
|
|
@ -48,7 +48,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/operator/keyring
|
||||
```
|
||||
|
@ -132,7 +132,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request POST \
|
||||
--data @payload.json \
|
||||
|
@ -178,7 +178,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload.json \
|
||||
|
@ -223,7 +223,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request DELETE \
|
||||
--data @payload.json \
|
||||
|
|
|
@ -40,7 +40,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/operator/license
|
||||
```
|
||||
|
@ -106,7 +106,7 @@ The payload is the raw license blob.
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @consul.license \
|
||||
|
@ -169,7 +169,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request DELETE \
|
||||
http://127.0.0.1:8500/v1/operator/license
|
||||
|
|
|
@ -48,7 +48,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request DELETE \
|
||||
http://127.0.0.1:8500/v1/operator/raft/peer?address=1.2.3.4:5678
|
||||
|
|
|
@ -47,7 +47,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/operator/segment
|
||||
```
|
||||
|
|
|
@ -278,7 +278,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request POST \
|
||||
--data @payload.json \
|
||||
|
@ -319,7 +319,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/query
|
||||
```
|
||||
|
@ -388,7 +388,7 @@ more information.
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload.json \
|
||||
|
@ -425,7 +425,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request DELETE \
|
||||
http://127.0.0.1:8500/v1/query/8f246b77-f3e1-ff88-5b48-8ec93abf3e05
|
||||
|
@ -523,7 +523,7 @@ be used.
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/query/8f246b77-f3e1-ff88-5b48-8ec93abf3e05/explain
|
||||
```
|
||||
|
|
|
@ -80,7 +80,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload.json \
|
||||
|
@ -137,7 +137,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
http://127.0.0.1:8500/v1/session/list
|
||||
```
|
||||
|
@ -357,7 +357,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
http://127.0.0.1:8500/v1/session/renew/adf4238a-882b-9ddc-4a9d-5b6758e4159e
|
||||
|
|
|
@ -60,7 +60,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
With a custom datacenter:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ 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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data-binary @snapshot.tgz \
|
||||
|
|
|
@ -41,7 +41,7 @@ The table below shows this endpoint's support for
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ 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
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl http://127.0.0.1:8500/v1/status/peers
|
||||
```
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ atomic transaction. Up to 64 operations may be present in a single transaction.
|
|||
|
||||
### Sample Request
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data @payload.json \
|
||||
|
|
|
@ -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
|
||||
file. To use this approach, omit `acl_master_token` from the above config and then call the API:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
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
|
||||
ACL API, and the ACL master token we set in the previous step:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--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,
|
||||
so it doesn't need to be set in the configuration file:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--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
|
||||
agent token using an API, so it doesn't need to be set in the configuration file:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--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
|
||||
by the ACL default policy of "deny":
|
||||
|
||||
```
|
||||
```shell-session
|
||||
$ 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
|
||||
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
|
||||
Node Address Status Type Build Protocol DC
|
||||
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
|
||||
we will give the anonymous token read privileges for all nodes:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--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
|
||||
`consul members` without supplying a token and we will be able to see the nodes:
|
||||
|
||||
```
|
||||
```shell-session
|
||||
$ consul members
|
||||
Node Address Status Type Build Protocol DC
|
||||
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
|
||||
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 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
|
||||
"consul" service. Let's add that to the anonymous token's policy:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--header "X-Consul-Token: b1gs33cr3t" \
|
||||
|
@ -523,7 +523,7 @@ $ curl \
|
|||
|
||||
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 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
|
||||
web browser session to authenticate the interface.
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--header "X-Consul-Token: b1gs33cr3t" \
|
||||
|
@ -663,7 +663,7 @@ of the rules section.
|
|||
|
||||
Here's a sample request using the HCL form:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data \
|
||||
|
@ -676,7 +676,7 @@ $ curl \
|
|||
|
||||
Here's an equivalent request using the JSON form:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data \
|
||||
|
|
|
@ -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,
|
||||
using `curl` and `jq` in bash:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ LEGACY_IDS=$(curl -sH "X-Consul-Token: $CONSUL_HTTP_TOKEN" \
|
||||
'localhost:8500/v1/acl/tokens' | jq -r '.[] | select (.Legacy) | .AccessorID')
|
||||
$ echo "$LEGACY_IDS"
|
||||
|
@ -188,7 +188,7 @@ done
|
|||
Each policy now has an identical set of rules to the original token. You can
|
||||
inspect these:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl policy read -name migrated-621cbd12-dde7-de06-9be0-e28d067b5b7f
|
||||
ID: 573d84bd-8b08-3061-e391-d2602e1b4947
|
||||
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,
|
||||
using `curl` and `jq` in bash:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ LEGACY_IDS=$(curl -sH "X-Consul-Token: $CONSUL_HTTP_TOKEN" \
|
||||
'localhost:8500/v1/acl/tokens' | jq -r '.[] | select (.Legacy) | .AccessorID')
|
||||
$ 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
|
||||
token's policy and return a new ACL policy that is exactly equivalent.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ for id in $LEGACY_IDS; do \
|
||||
echo "Policy for $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
|
||||
available on macOS but equivalents for other platforms should be easy to find.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ mkdir policies
|
||||
$ for id in $LEGACY_IDS; do \
|
||||
# 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
|
||||
hash as it will allow us to match tokens to policies later.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ cat policies/024ce11f26f59436c518fb31f0999d1400485c17.hcl
|
||||
service_prefix "bar" {
|
||||
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
|
||||
policy to use exact match.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ cat policies/501b787c9444fbd62f346ab257eeb27197be2444.hcl
|
||||
service_prefix "foo" {
|
||||
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
|
||||
can create each one with something like the following.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ for p in $(ls policies | grep ".hcl"); do \
|
||||
# Extract the hash part of the file name
|
||||
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
|
||||
created from those rules.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ for id in $LEGACY_IDS; do \
|
||||
NEW_POLICY=$(consul acl translate-rules -token-accessor "$id"); \
|
||||
HASH=$(echo -n "$NEW_POLICY" | shasum | awk '{ print $1 }'); \
|
||||
|
|
|
@ -109,7 +109,7 @@ of the rules section of a policy.
|
|||
|
||||
Here's a sample request using the HCL form:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data \
|
||||
|
@ -121,7 +121,7 @@ $ curl \
|
|||
|
||||
Here's an equivalent request using the JSON form:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ curl \
|
||||
--request PUT \
|
||||
--data \
|
||||
|
|
|
@ -79,7 +79,7 @@ parameters are required to properly configure an auth method of type
|
|||
login; any match is sufficient.
|
||||
|
||||
- `VerboseOIDCLogging` `(bool: false)` - Log received OIDC tokens and claims when
|
||||
debug-level logging is active. Not recommended in production since sensitive
|
||||
debug-level logging is active. Not recommended in production since sensitive
|
||||
information may be present in OIDC responses.
|
||||
|
||||
### Sample Config
|
||||
|
@ -140,8 +140,7 @@ The "host:port" must be correct for the Consul agent serving the Consul UI.
|
|||
|
||||
#### CLI
|
||||
|
||||
If you plan to support authentication via `consul login -type=oidc
|
||||
-method=<name>`, a localhost redirect URI must be set (usually this is
|
||||
If you plan to support authentication via `consul login -type=oidc -method=<name>`, a localhost redirect URI must be set (usually this is
|
||||
`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
|
||||
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
|
||||
|
||||
```
|
||||
```shell-session
|
||||
$ consul login -method=oidc -type=oidc -token-sink-file=consul.token
|
||||
|
||||
Complete the login via your OIDC provider. Launching browser to:
|
||||
|
|
|
@ -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
|
||||
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" ...'
|
||||
```
|
||||
|
||||
|
@ -50,7 +50,7 @@ provider.
|
|||
This returns the first private IP address of all servers in the given
|
||||
region which have the given `tag_key` and `tag_value`.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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
|
||||
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=..."
|
||||
```
|
||||
|
||||
|
@ -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
|
||||
project which have the given `tag_value`.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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
|
||||
datacenter with the given `tag_value`.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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
|
||||
`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=..."
|
||||
```
|
||||
|
||||
|
@ -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
|
||||
`region` with the given `tag_name`.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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
|
||||
`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=..."
|
||||
```
|
||||
|
||||
|
@ -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
|
||||
`region` with the given `tag_name`.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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`.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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`.
|
||||
|
||||
```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"
|
||||
```
|
||||
|
||||
|
@ -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`.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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`.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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`.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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
|
||||
may be an integer or a named port.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul agent -retry-join "provider=k8s label_selector=\"app=consul,component=server\""
|
||||
```
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ Config {
|
|||
|
||||
Then to apply this configuration, run:
|
||||
|
||||
```bash
|
||||
```shell-session
|
||||
$ consul config write proxy-defaults.hcl
|
||||
```
|
||||
|
||||
|
@ -95,7 +95,7 @@ Consul's HTTP API.
|
|||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
```shell-session
|
||||
$ consul config read -kind service-defaults -name web
|
||||
{
|
||||
"Kind": "service-defaults",
|
||||
|
@ -111,7 +111,7 @@ list out all the configuration entries for a given kind.
|
|||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
```shell-session
|
||||
$ consul config list -kind service-defaults
|
||||
web
|
||||
api
|
||||
|
@ -125,7 +125,7 @@ to delete an entry by specifying both its `kind` and `name`.
|
|||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
```shell-session
|
||||
$ consul config delete -kind service-defaults -name web
|
||||
```
|
||||
|
||||
|
@ -139,11 +139,11 @@ added in Consul 1.7.0.
|
|||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
```shell-session
|
||||
$ consul config write service-defaults.hcl -namespace foo
|
||||
```
|
||||
|
||||
```bash
|
||||
```shell-session
|
||||
$ consul config list -kind service-defaults -namespace foo
|
||||
web
|
||||
api
|
||||
|
|
|
@ -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`:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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
|
||||
`node_meta` values of the node.
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ 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
|
||||
|
@ -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
|
||||
them, like so:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ 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
|
||||
|
@ -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`,
|
||||
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 9.8.3-P1 <<>> @127.0.0.1 -p 8600 _rabbitmq._amqp.service.consul ANY
|
||||
|
|
|
@ -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
|
||||
cryptographically suitable key:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul keygen
|
||||
pUqJrVyVRj5jsiYEkM/tFQYfWyJIv4s3XkvDwy7Cu5s=
|
||||
```
|
||||
|
@ -37,7 +37,7 @@ pUqJrVyVRj5jsiYEkM/tFQYfWyJIv4s3XkvDwy7Cu5s=
|
|||
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":
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ cat encrypt.json
|
||||
{"encrypt": "pUqJrVyVRj5jsiYEkM/tFQYfWyJIv4s3XkvDwy7Cu5s="}
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul agent -data-dir=/tmp/consul
|
||||
==> Starting Consul agent...
|
||||
==> Consul agent running!
|
||||
|
|
|
@ -137,7 +137,7 @@ Here is an example configuration:
|
|||
|
||||
Or, using the watch command:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul watch -type=keyprefix -prefix=foo/ /usr/bin/my-prefix-handler.sh
|
||||
```
|
||||
|
||||
|
@ -307,13 +307,13 @@ Or, using the watch command:
|
|||
|
||||
Single tag:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul watch -type=service -service=redis -tag=bar /usr/bin/my-service-handler.sh
|
||||
```
|
||||
|
||||
Multiple tag:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul watch -type=checks -state=passing /usr/bin/my-check-handler.sh -passing
|
||||
```
|
||||
|
||||
Service:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ 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:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul event -name=web-deploy 1609030
|
||||
```
|
||||
|
|
|
@ -71,7 +71,7 @@ Usage: `consul acl auth-method create [options] [args]`
|
|||
|
||||
Create a new Kubernetes auth method:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl auth-method create -name minikube -type kubernetes \
|
||||
-description 'minikube auth method' \
|
||||
-kubernetes-host 'https://192.0.2.42:8443' \
|
||||
|
|
|
@ -32,7 +32,7 @@ Usage: `consul acl auth-method delete [options]`
|
|||
|
||||
Delete an auth method:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl auth-method delete -name minikube
|
||||
Auth-method "minikube" deleted successfully
|
||||
```
|
||||
|
|
|
@ -45,7 +45,7 @@ of the subcommand in the sidebar.
|
|||
|
||||
Create a new auth method:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl auth-method create -type "kubernetes" \
|
||||
-name "my-k8s" \
|
||||
-description "This is an example kube auth method" \
|
||||
|
@ -56,13 +56,13 @@ $ consul acl auth-method create -type "kubernetes" \
|
|||
|
||||
List all auth methods:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl auth-method list
|
||||
```
|
||||
|
||||
Update all editable fields of the auth method:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl auth-method update -name "my-k8s" \
|
||||
-description "new description" \
|
||||
-kubernetes-host "https://new-apiserver.example.com:8443" \
|
||||
|
@ -72,12 +72,12 @@ $ consul acl auth-method update -name "my-k8s" \
|
|||
|
||||
Read an auth method:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl auth-method read -name my-k8s
|
||||
```
|
||||
|
||||
Delete an auth method:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl auth-method delete -name my-k8s
|
||||
```
|
||||
|
|
|
@ -35,7 +35,7 @@ Usage: `consul acl auth-method list`
|
|||
|
||||
Default listing.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl auth-method list
|
||||
minikube:
|
||||
Type: kubernetes
|
||||
|
@ -47,7 +47,7 @@ minikube-two:
|
|||
|
||||
Show Metadata.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl auth-method list -meta
|
||||
minikube:
|
||||
Type: kubernetes
|
||||
|
|
|
@ -37,7 +37,7 @@ Usage: `consul acl auth-method read [options] [args]`
|
|||
|
||||
Get auth method details:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl auth-method read -name minikube
|
||||
Name: minikube
|
||||
Type: kubernetes
|
||||
|
|
|
@ -76,7 +76,7 @@ Usage: `consul acl auth-method update [options] [args]`
|
|||
|
||||
Update an auth method:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl auth-method update -name minikube \
|
||||
-description 'dev cluster' \
|
||||
-kubernetes-host 'https://192.0.2.44:8443'
|
||||
|
|
|
@ -48,7 +48,7 @@ Usage: `consul acl binding-rule create [options] [args]`
|
|||
|
||||
Create a new binding rule that binds to a service identity:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl binding-rule create -method 'minikube' \
|
||||
-description 'wildcard 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:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl binding-rule create -method 'minikube' \
|
||||
-description 'just vault role' \
|
||||
-bind-type 'role' \
|
||||
|
|
|
@ -33,7 +33,7 @@ Usage: `consul acl binding-rule delete [options]`
|
|||
|
||||
Delete a binding rule:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl binding-rule delete -id 0ec1bd
|
||||
Binding rule "0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890" deleted successfully
|
||||
```
|
||||
|
|
|
@ -55,7 +55,7 @@ resolved to the full UUID and used.
|
|||
|
||||
Create a new binding rule:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl binding-rule create \
|
||||
-method=minikube \
|
||||
-bind-type=service \
|
||||
|
@ -65,25 +65,25 @@ $ consul acl binding-rule create \
|
|||
|
||||
List all binding rules:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl binding-rule list
|
||||
```
|
||||
|
||||
Update a binding rule:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl binding-rule update -id=43cb72df-9c6f-4315-ac8a-01a9d98155ef \
|
||||
-bind-name='k8s-${serviceaccount.name}'
|
||||
```
|
||||
|
||||
Read a binding rule:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl binding-rule read -id fdabbcb5-9de5-4b1a-961f-77214ae88cba
|
||||
```
|
||||
|
||||
Delete a binding rule:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl binding-rule delete -id b6b856da-5193-4e78-845a-7d61ca8371ba
|
||||
```
|
||||
|
|
|
@ -35,7 +35,7 @@ Usage: `consul acl binding-rule list`
|
|||
|
||||
Default listing.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl binding-rule list
|
||||
0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890:
|
||||
AuthMethod: minikube
|
||||
|
@ -53,7 +53,7 @@ e21ae868-7b13-a230-0235-f8e83510642c:
|
|||
|
||||
Show Metadata.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl binding-rule list -meta
|
||||
0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890:
|
||||
AuthMethod: minikube
|
||||
|
|
|
@ -38,7 +38,7 @@ Usage: `consul acl binding-rule read [options] [args]`
|
|||
|
||||
Get binding rule details:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl binding-rule read -id '0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890'
|
||||
ID: 0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890
|
||||
AuthMethod: minikube
|
||||
|
|
|
@ -55,7 +55,7 @@ Usage: `consul acl binding-rule update [options] [args]`
|
|||
|
||||
Update a binding rule:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl binding-rule update -id '0ec1bd2f-1d3b-bafb-d9bf-90ef04ab1890' \
|
||||
-selector 'serviceaccount.namespace==default'
|
||||
Binding rule updated successfully
|
||||
|
|
|
@ -17,7 +17,7 @@ ACLs are also accessible via the [HTTP API](/api/acl/acl).
|
|||
|
||||
Bootstrap Consul's ACLs:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl bootstrap
|
||||
AccessorID: 4d123dff-f460-73c3-02c4-8dd64d136e01
|
||||
SecretID: 86cddfb9-2760-d947-358d-a2811156bf31
|
||||
|
@ -30,7 +30,7 @@ Policies:
|
|||
|
||||
Create a policy:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl policy create -name "acl-replication" -description "Token capable of replicating ACL policies" -rules 'acl = "read"'
|
||||
ID: 35b8ecb0-707c-ee18-2002-81b238b54b38
|
||||
Name: acl-replication
|
||||
|
@ -42,7 +42,7 @@ acl = "read"
|
|||
|
||||
Create a token:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl token create -description "Agent Policy Replication - my-agent" -policy-name "acl-replication"
|
||||
AccessorID: c24c11aa-4e08-e25c-1a67-705a2e8d75a4
|
||||
SecretID: e7024f9c-f016-02dd-6217-daedbffb86ac
|
||||
|
|
|
@ -66,7 +66,7 @@ Usage: `consul acl policy create [options] [args]`
|
|||
|
||||
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"'
|
||||
ID: 35b8ecb0-707c-ee18-2002-81b238b54b38
|
||||
Name: acl-replication
|
||||
|
@ -78,7 +78,7 @@ acl = "read"
|
|||
|
||||
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
|
||||
ID: ca44555b-a2d8-94de-d763-88caffdaf11f
|
||||
Name: replication
|
||||
|
@ -94,7 +94,7 @@ service_prefix "" {
|
|||
|
||||
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"
|
||||
ID: 06acc965-df4b-5a99-58cb-3250930c6324
|
||||
Name: node-services-read
|
||||
|
|
|
@ -35,14 +35,14 @@ Usage: `consul acl policy delete [options]`
|
|||
|
||||
Delete a policy:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl policy delete -id 35b8
|
||||
Policy "35b8ecb0-707c-ee18-2002-81b238b54b38" deleted successfully
|
||||
```
|
||||
|
||||
Delete a policy by name:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl policy delete -name acl-replication
|
||||
Policy "35b8ecb0-707c-ee18-2002-81b238b54b38" deleted successfully
|
||||
```
|
||||
|
|
|
@ -63,7 +63,7 @@ Builtin policies:
|
|||
|
||||
Create a new ACL policy:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl policy create -name "new-policy" \
|
||||
-description "This is an example policy" \
|
||||
-datacenter "dc1" \
|
||||
|
@ -73,24 +73,24 @@ $ consul acl policy create -name "new-policy" \
|
|||
|
||||
List all policies:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl policy list
|
||||
```
|
||||
|
||||
Update a policy:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl policy update -name "other-policy" -datacenter "dc1"
|
||||
```
|
||||
|
||||
Read a policy:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl policy read -id 0479e93e-091c-4475-9b06-79a004765c24
|
||||
```
|
||||
|
||||
Delete a policy
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl policy delete -name "my-policy"
|
||||
```
|
||||
|
|
|
@ -35,7 +35,7 @@ Usage: `consul acl policy list`
|
|||
|
||||
Default listing.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl policy list
|
||||
global-management:
|
||||
ID: 00000000-0000-0000-0000-000000000001
|
||||
|
@ -49,7 +49,7 @@ acl-replication:
|
|||
|
||||
Show Metadata.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl policy list -meta
|
||||
global-management:
|
||||
ID: 00000000-0000-0000-0000-000000000001
|
||||
|
|
|
@ -40,7 +40,7 @@ Usage: `consul acl policy read [options] [args]`
|
|||
|
||||
Get policy details:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl policy read -id 00000000-0000-0000-0000-000000000001
|
||||
ID: 00000000-0000-0000-0000-000000000001
|
||||
Name: global-management
|
||||
|
@ -77,7 +77,7 @@ session_prefix "" {
|
|||
|
||||
Get policy details by name:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl policy read -name "acl-replication"
|
||||
ID: 35b8ecb0-707c-ee18-2002-81b238b54b38
|
||||
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.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl policy read -id global-management
|
||||
ID: 00000000-0000-0000-0000-000000000001
|
||||
Name: global-management
|
||||
|
|
|
@ -57,7 +57,7 @@ Usage: `consul acl policy update [options] [args]`
|
|||
|
||||
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
|
||||
Policy updated successfully
|
||||
ID: 35b8ecb0-707c-ee18-2002-81b238b54b38
|
||||
|
@ -75,7 +75,7 @@ service_prefix "" {
|
|||
|
||||
Rename a policy:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl policy update -id 35b8 -name "dc1-replication"
|
||||
Policy updated successfully
|
||||
ID: 35b8ecb0-707c-ee18-2002-81b238b54b38
|
||||
|
|
|
@ -49,7 +49,7 @@ Usage: `consul acl role create [options] [args]`
|
|||
|
||||
Create a new role with one policy:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl role create -name "crawler" -description "web crawler role" -policy-name "crawler-kv"
|
||||
ID: 57147d87-6bf7-f794-1a6e-7d038c4e4ae9
|
||||
Name: crawler
|
||||
|
@ -60,7 +60,7 @@ Policies:
|
|||
|
||||
Create a new role with one service identity:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl role create -name archiver -description 'archiver role' -service-identity "archiver:dc2"
|
||||
ID: a365fdc9-ac71-e754-0645-7ab6bd747301
|
||||
Name: archiver
|
||||
|
|
|
@ -35,14 +35,14 @@ Usage: `consul acl role delete [options]`
|
|||
|
||||
Delete a role by prefix:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl role delete -id 57147
|
||||
Role "57147d87-6bf7-f794-1a6e-7d038c4e4ae9" deleted successfully
|
||||
```
|
||||
|
||||
Delete a role by name:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl role delete -name crawler
|
||||
Role "a365fdc9-ac71-e754-0645-7ab6bd747301" deleted successfully
|
||||
```
|
||||
|
|
|
@ -55,7 +55,7 @@ full UUID and used.
|
|||
|
||||
Create a new ACL role:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl role create -name "new-role" \
|
||||
-description "This is an example role" \
|
||||
-policy-id 06acc965
|
||||
|
@ -63,24 +63,24 @@ $ consul acl role create -name "new-role" \
|
|||
|
||||
List all roles:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl role list
|
||||
```
|
||||
|
||||
Update a role:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl role update -name "other-role" -datacenter "dc1"
|
||||
```
|
||||
|
||||
Read a role:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl role read -id 0479e93e-091c-4475-9b06-79a004765c24
|
||||
```
|
||||
|
||||
Delete a role
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl role delete -name "my-role"
|
||||
```
|
||||
|
|
|
@ -35,7 +35,7 @@ Usage: `consul acl role list`
|
|||
|
||||
Default listing.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl role list
|
||||
web-crawler:
|
||||
ID: 57147d87-6bf7-f794-1a6e-7d038c4e4ae9
|
||||
|
@ -53,7 +53,7 @@ archiver:
|
|||
|
||||
Show Metadata.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl role list -meta
|
||||
web-crawler:
|
||||
ID: 57147d87-6bf7-f794-1a6e-7d038c4e4ae9
|
||||
|
|
|
@ -40,7 +40,7 @@ Usage: `consul acl role read [options] [args]`
|
|||
|
||||
Get role details:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl role read -id 57147d87-6bf7-f794-1a6e-7d038c4e4ae9
|
||||
ID: 57147d87-6bf7-f794-1a6e-7d038c4e4ae9
|
||||
Name: crawler
|
||||
|
@ -51,7 +51,7 @@ Policies:
|
|||
|
||||
Get role details by name:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl role read -name archiver
|
||||
ID: a365fdc9-ac71-e754-0645-7ab6bd747301
|
||||
Name: archiver
|
||||
|
|
|
@ -60,7 +60,7 @@ Usage: `consul acl role update [options] [args]`
|
|||
|
||||
Update a role:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl role update -id 57147d87-6bf7-f794-1a6e-7d038c4e4ae9 \
|
||||
-description 'web crawler updated role' -service-identity 'crawler'
|
||||
Role updated successfully
|
||||
|
@ -75,7 +75,7 @@ Service Identities:
|
|||
|
||||
Rename a role by prefix:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl role update -id 57147 -name web-crawler
|
||||
Role updated successfully
|
||||
ID: 57147d87-6bf7-f794-1a6e-7d038c4e4ae9
|
||||
|
|
|
@ -44,6 +44,6 @@ Usage: `consul acl set-agent-token [options] TYPE TOKEN`
|
|||
|
||||
Set the `default` token:
|
||||
|
||||
```
|
||||
```shell-session
|
||||
$ consul acl set-agent-token default c4d0f8df-3aba-4ab6-a7a0-35b760dc29a1
|
||||
```
|
||||
|
|
|
@ -39,7 +39,7 @@ Usage: `consul acl token clone [options]`
|
|||
|
||||
Clone a token:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl token clone -id 59f8 -description "Clone of Super User"
|
||||
Token cloned successfully.
|
||||
AccessorID: dcfa52ed-9288-b3ff-056d-255ef69d2d88
|
||||
|
|
|
@ -63,7 +63,7 @@ Usage: `consul acl token create [options] [args]`
|
|||
|
||||
Create a new token:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl token create -description "Read Nodes and Services" -policy-id 06acc965
|
||||
AccessorID: 986193b5-e2b5-eb26-6264-b524ea60cc6d
|
||||
SecretID: ec15675e-2999-d789-832e-8c4794daa8d7
|
||||
|
@ -76,7 +76,7 @@ Policies:
|
|||
|
||||
Create a new local token:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl token create -description "Read Nodes and Services" -policy-id 06acc965 -local
|
||||
AccessorID: 4fdf0ec8-d251-3865-079c-7247c974fc50
|
||||
SecretID: 02143514-abf2-6c23-0aa1-ec2107e68f6b
|
||||
|
@ -89,7 +89,7 @@ Policies:
|
|||
|
||||
Create a new token and link with policies by name:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl token create -description "Super User" -policy-name global-management
|
||||
AccessorID: 59f86a9b-d3b6-166c-32a0-be4ab3f94caa
|
||||
SecretID: ada7f751-f654-8872-7f93-498e799158b6
|
||||
|
@ -102,7 +102,7 @@ Policies:
|
|||
|
||||
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'
|
||||
AccessorID: 0c083aca-6c15-f0cc-c4d9-30578db54cd9
|
||||
SecretID: 930dafb6-5c08-040b-23fb-a368a95256f9
|
||||
|
|
|
@ -33,7 +33,7 @@ Usage: `consul acl token delete [options]`
|
|||
|
||||
Delete a token:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl token delete -id 35b8
|
||||
Token "35b8ecb0-707c-ee18-2002-81b238b54b38" deleted successfully
|
||||
```
|
||||
|
|
|
@ -61,7 +61,7 @@ Builtin Tokens:
|
|||
|
||||
Create a new ACL token:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl token create \
|
||||
-description "This is an example token" \
|
||||
-policy-id 06acc965
|
||||
|
@ -69,24 +69,24 @@ $ consul acl token create \
|
|||
|
||||
List all tokens:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl token list
|
||||
```
|
||||
|
||||
Update a token:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl token update -id 986193 -description "WonderToken"
|
||||
```
|
||||
|
||||
Read a token with an accessor ID:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl token read -id 986193
|
||||
```
|
||||
|
||||
Delete a token
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl token delete -id 986193
|
||||
```
|
||||
|
|
|
@ -35,7 +35,7 @@ Usage: `consul acl token list`
|
|||
|
||||
Default listing.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl token list
|
||||
AccessorID: 4d123dff-f460-73c3-02c4-8dd64d136e01
|
||||
Description: Bootstrap Token (Global Management)
|
||||
|
|
|
@ -41,7 +41,7 @@ Usage: `consul acl token read [options] [args]`
|
|||
|
||||
Get token details:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl token read -id 986
|
||||
AccessorID: 986193b5-e2b5-eb26-6264-b524ea60cc6d
|
||||
SecretID: ec15675e-2999-d789-832e-8c4794daa8d7
|
||||
|
@ -67,7 +67,7 @@ Policies:
|
|||
|
||||
Get token details (Builtin Tokens)
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl token read -id anonymous
|
||||
AccessorID: 00000000-0000-0000-0000-000000000002
|
||||
SecretID: anonymous
|
||||
|
|
|
@ -69,7 +69,7 @@ guide.
|
|||
|
||||
Update the anonymous token:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl token update -id anonymous -policy-id 06acc
|
||||
Token updated successfully.
|
||||
AccessorID: 00000000-0000-0000-0000-000000000002
|
||||
|
@ -83,7 +83,7 @@ Policies:
|
|||
|
||||
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
|
||||
Token updated successfully.
|
||||
AccessorID: 986193b5-e2b5-eb26-6264-b524ea60cc6d
|
||||
|
|
|
@ -42,30 +42,30 @@ Usage: `consul acl translate rules [options] TRANSLATE`
|
|||
|
||||
Translate rules within a file:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl translate-rules @rules.hcl
|
||||
```
|
||||
|
||||
Translate rules from stdin:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl translate-rules -
|
||||
```
|
||||
|
||||
Translate rules from a string argument:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl translate-rules 'key "" { policy = "write"}'
|
||||
```
|
||||
|
||||
Translate rules for a legacy ACL token using its SecretID passed from stdin:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl translate-rules --token-secret -
|
||||
```
|
||||
|
||||
Translate rules for a legacy ACL token using its AccessorID:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul acl translate-rules 429cd746-03d5-4bbb-a83a-18b164171c89
|
||||
```
|
||||
|
|
|
@ -14,7 +14,7 @@ The `catalog datacenters` command prints all known datacenters.
|
|||
|
||||
List all datacenters:
|
||||
|
||||
```
|
||||
```shell-session
|
||||
$ consul catalog datacenters
|
||||
dc1
|
||||
dc2
|
||||
|
|
|
@ -18,7 +18,7 @@ The catalog is also accessible via the [HTTP API](/api/catalog).
|
|||
|
||||
List all datacenters:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul catalog datacenters
|
||||
dc1
|
||||
dc2
|
||||
|
@ -27,7 +27,7 @@ dc3
|
|||
|
||||
List all nodes:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul catalog nodes
|
||||
Node ID Address DC
|
||||
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:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul catalog nodes -service=redis
|
||||
Node ID Address DC
|
||||
worker-01 1b662d97 10.4.5.31 dc1
|
||||
|
@ -44,7 +44,7 @@ worker-02 d407a592 10.4.4.158 dc1
|
|||
|
||||
List all services:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul catalog services
|
||||
consul
|
||||
postgresql
|
||||
|
@ -53,7 +53,7 @@ redis
|
|||
|
||||
List all services on a node:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul catalog services -node=worker-01
|
||||
consul
|
||||
postgres
|
||||
|
|
|
@ -16,7 +16,7 @@ particular service.
|
|||
|
||||
List all nodes:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul catalog nodes
|
||||
Node ID Address DC
|
||||
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:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul catalog nodes -detailed
|
||||
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
|
||||
|
@ -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":
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul catalog nodes -service=web
|
||||
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
|
||||
|
@ -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:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul catalog nodes -near=web-05
|
||||
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
|
||||
|
|
|
@ -16,7 +16,7 @@ particular node provides.
|
|||
|
||||
List all services:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul catalog services
|
||||
consul
|
||||
postgresql
|
||||
|
@ -25,7 +25,7 @@ redis
|
|||
|
||||
Show all services with their tags:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul catalog services -tags
|
||||
consul
|
||||
postgresql leader
|
||||
|
@ -34,7 +34,7 @@ redis primary,v1
|
|||
|
||||
List services for the node "worker-01":
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul catalog services -node=worker-01
|
||||
consul
|
||||
redis
|
||||
|
|
|
@ -145,7 +145,7 @@ service {
|
|||
|
||||
The sidecar Envoy process can be started with.
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ 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
|
||||
level, you can use:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ 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
|
||||
the same port as in the following example.
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ 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.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul connect envoy -gateway=mesh -register \
|
||||
-address '{{ GetInterfaceIP "eth0" }}: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.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul connect envoy -gateway=terminating -register -service my-gateway \
|
||||
-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.
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul connect envoy -gateway=ingress -register -service ingress-service \
|
||||
-address '{{ GetInterfaceIP "eth0" }}:8888'
|
||||
```
|
||||
|
|
|
@ -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
|
||||
establish a mutual TLS connection to "db" identified as "frontend".
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul connect proxy -service frontend -upstream db:8181
|
||||
```
|
||||
|
||||
The next example starts a local proxy that also accepts inbound connections
|
||||
on port 8443, authorizes the connection, then proxies it to port 8080:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul connect proxy \
|
||||
-service frontend \
|
||||
-service-addr 127.0.0.1:8080 \
|
||||
|
|
|
@ -91,7 +91,7 @@ directory) on the host where the command runs.
|
|||
By default the command will capture all available data from the default
|
||||
agent address on loopback for 2 minutes at 30 second intervals.
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul debug
|
||||
...
|
||||
```
|
||||
|
@ -99,7 +99,7 @@ $ consul debug
|
|||
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.
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ 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
|
||||
about the agent and environment.
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ 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`
|
||||
and `-duration` flags.
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul debug -interval=15s -duration=1m
|
||||
...
|
||||
```
|
||||
|
|
|
@ -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
|
||||
no arguments:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul
|
||||
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
|
||||
subcommand. For example, to see help about the `join` subcommand:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul join -h
|
||||
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:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul e
|
||||
event exec
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ Usage: `consul intention check [options] SRC DST`
|
|||
|
||||
## Examples
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul intention check web db
|
||||
Denied
|
||||
|
||||
|
|
|
@ -39,18 +39,18 @@ Usage: `consul intention create [options] -f FILE...`
|
|||
|
||||
Create an intention `web => db`:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul intention create web db
|
||||
```
|
||||
|
||||
Create intentions from a set of files:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul intention create -file one.json two.json
|
||||
```
|
||||
|
||||
Create intentions from a directory using shell expansion:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul intention create -file intentions/*.json
|
||||
```
|
||||
|
|
|
@ -25,12 +25,12 @@ Usage:
|
|||
|
||||
Delete an intention from "web" to "db" with any action:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul intention delete web db
|
||||
```
|
||||
|
||||
Delete an intention by unique ID:
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul intention delete 4ffed935-439c-695d-4f51-f4fc0b12a7a7
|
||||
```
|
||||
|
|
|
@ -23,7 +23,7 @@ Usage:
|
|||
|
||||
## Examples
|
||||
|
||||
```text
|
||||
```shell-session
|
||||
$ consul intention get web db
|
||||
Source: web
|
||||
Destination: db
|
||||
|
|
|
@ -42,25 +42,25 @@ of the subcommand in the sidebar.
|
|||
|
||||
Create an intention to allow "web" to talk to "db":
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul intention create web db
|
||||
```
|
||||
|
||||
Create an intention to deny "db" from initiating connections to _any_ service:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul intention create -deny db '*'
|
||||
Created: db => * (deny)
|
||||
```
|
||||
|
||||
Test whether a "web" is allowed to connect to "db":
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul intention check web db
|
||||
```
|
||||
|
||||
Find all intentions for communicating to the "db" service:
|
||||
|
||||
```shell
|
||||
```shell-session
|
||||
$ consul intention match db
|
||||
```
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue