Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI List and HCP command docs refresh #28778

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
eff1d27
Update hcp connect and disconnect docs
kiannaquach Oct 25, 2024
3862d15
Update list command docs
kiannaquach Oct 25, 2024
aab4ec5
Merge branch 'main' into docs/cli
kiannaquach Oct 25, 2024
237b270
Merge branch 'main' into docs/cli
kiannaquach Oct 25, 2024
e552aa0
Remove hcp index.mdx
kiannaquach Oct 25, 2024
bdfa363
Merge branch 'main' into docs/cli
kiannaquach Oct 29, 2024
27bad7a
Update website/content/docs/commands/hcp/connect.mdx
kiannaquach Nov 4, 2024
75208df
Update website/content/docs/commands/hcp/connect.mdx
kiannaquach Nov 4, 2024
5ce3108
Update website/content/docs/commands/hcp/connect.mdx
kiannaquach Nov 4, 2024
fdc3713
Update website/content/docs/commands/hcp/connect.mdx
kiannaquach Nov 4, 2024
d69a590
Update website/content/docs/commands/hcp/disconnect.mdx
kiannaquach Nov 4, 2024
14952b0
Update website/content/docs/commands/hcp/disconnect.mdx
kiannaquach Nov 4, 2024
41e80aa
Update website/content/partials/cli/hcp/flags/cluster-id.mdx
kiannaquach Nov 4, 2024
9c80836
Update website/content/docs/commands/hcp/disconnect.mdx
kiannaquach Nov 4, 2024
5b9c37e
Update website/content/partials/cli/hcp/flags/project-id.mdx
kiannaquach Nov 4, 2024
17c8c63
Update website/content/partials/cli/hcp/flags/organization-id.mdx
kiannaquach Nov 4, 2024
2bd3d0e
Update website/content/docs/commands/hcp/disconnect.mdx
kiannaquach Nov 4, 2024
e3920b4
Update website/content/docs/commands/list.mdx
kiannaquach Nov 4, 2024
c4f0162
Update website/content/docs/commands/list.mdx
kiannaquach Nov 4, 2024
c74a565
Update website/content/docs/commands/hcp/connect.mdx
kiannaquach Nov 4, 2024
944b6c2
Update website/content/docs/commands/hcp/connect.mdx
kiannaquach Nov 4, 2024
7ca1dd8
Update website/content/docs/commands/hcp/disconnect.mdx
kiannaquach Nov 4, 2024
2a8142f
Update website/content/docs/commands/list.mdx
kiannaquach Nov 4, 2024
f738cb9
Update website/content/docs/commands/list.mdx
kiannaquach Nov 4, 2024
2960177
Update website/content/docs/commands/list.mdx
kiannaquach Nov 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 64 additions & 32 deletions website/content/docs/commands/hcp/connect.mdx
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
---
layout: docs
page_title: hcp connect - Command
page_title: hcp connect - Vault CLI
description: |-
Use "hcp connect" command to authenticate users and machines to HCP with explicit
Authenticate users and machines to HCP with explicit
credentials or an HCP token and interactive browser login.
---

# hcp connect

The `hcp connect` command authenticates users and machines to HCP with explicit
credentials or an HCP token and interactive browser login.
`hcp connect` authenticates users or machines to HCP using either provided arguments or retrieved token through
browser login. A successful authentication results in an HCP token and an HCP Vault address being
locally cached.
kiannaquach marked this conversation as resolved.
Show resolved Hide resolved

By default, the `hcp connect` command uses interactive authentication that requires
<CodeBlockConfig hideClipboard>

```shell-session
$ vault hcp connect [options]
$ vault hcp connect [-help | -h]
```

</CodeBlockConfig>

## Description

By default, `hcp connect` uses interactive authentication that requires
kiannaquach marked this conversation as resolved.
Show resolved Hide resolved
users to log into the HashiCorp Cloud Platform with a browser.

Non-interactive login requires a service principal credential that was
Expand All @@ -21,40 +33,60 @@ access to the requested organization, project, and HCP Vault Dedicated cluster.
If authentication succeeds, the Vault CLI saves the returned HCP token and HCP
Vault address in the local cache.

## Examples
### Limitations and warnings
kiannaquach marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a corresponding API endpoint?


Connect to HCP interactively:
- None
kiannaquach marked this conversation as resolved.
Show resolved Hide resolved

```shell-session
$ vault hcp connect
The default web browser has been opened at <auth_url>. Please continue the login in the web browser.
Success!
```
## Command arguments

- None
kiannaquach marked this conversation as resolved.
Show resolved Hide resolved

## Command options

- None
kiannaquach marked this conversation as resolved.
Show resolved Hide resolved

## Usage
## Command flags

The following flags are available in addition to the [standard set of
flags](/vault/docs/commands) included on all commands.
<br />

### Command options
@include 'cli/hcp/flags/client-id.mdx'

- `-client-id` `(string: "")` - Client ID belonging to a service principal
credential generated in the HCP Portal. **Required for non-interactive
authentication**.
<br />
<hr />
<br />

- `-secret-id` `(string: "")` - Secret ID belonging to a service principal
credential previously generated in the HCP Portal. **Required for
non-interactive authentication**.
@include 'cli/hcp/flags/secret-id.mdx'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should list flags in alphabetic order


- `-organization-id` `(string: "")` - Optional ID of the desired HCP
organization. If `organization-id` is empty and the user is associated with
multiple HCP organizations, the CLI prompts the user to select from a list
of available organizations.
<br />
<hr />
<br />

- `-project-id` `(string: "")` - Optional ID of the desired HCP project. If
`project-id` is empty and the user is associated with more than one HCP
project, the CLI prompts the user to select from a list of available projects.
@include 'cli/hcp/flags/organization-id.mdx'

- `-cluster-id` `(string: "")` - Optional ID of the desired HCP Vault Dedicated cluster.
If `cluster-id` is empty and the user is associated with multiple HCP clusters,
the CLI prompts the user to select from a list of available clusters.
<br />
<hr />
<br />

@include 'cli/hcp/flags/project-id.mdx'

<br />
<hr />
<br />

@include 'cli/hcp/flags/cluster-id.mdx'

## Standard flags

<br />

@include 'cli/standard-settings/all-standard-flags.mdx'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think login uses format.


## Examples

Connect to HCP interactively:

```shell-session
$ vault hcp connect
The default web browser has been opened at <auth_url>. Please continue the login in the web browser.
Success!
```
48 changes: 39 additions & 9 deletions website/content/docs/commands/hcp/disconnect.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,48 @@
---
layout: docs
page_title: hcp disconnect - Command
page_title: hcp disconnect - Vault CLI
description: |-
Use "hcp disconnect" command invalidates live sessions to a HCP Vault Dedicated cluster.
Invalidate live sessions to a HCP Vault Dedicated cluster.
---

# hcp disconnect
# `hcp disconnect`

The `hcp disconnect` command invalidates live sessions to a HCP Vault Dedicated cluster.
`hcp disconnect` invalidates live sessions to a HCP Vault Dedicated cluster.

<CodeBlockConfig hideClipboard>

```shell-session
$ vault hcp disconnect [options]
$ vault hcp disconnect [-help | -h]
```

</CodeBlockConfig>

## Description

`hcp disconnect` invalidates live sessions to a HCP Vault Dedicated cluster.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a corresponding API endpoint?

### Limitations and warnings

- None
kiannaquach marked this conversation as resolved.
Show resolved Hide resolved

## Command arguments

- None
kiannaquach marked this conversation as resolved.
Show resolved Hide resolved

## Command options

- None
kiannaquach marked this conversation as resolved.
Show resolved Hide resolved

## Command flags

- None
kiannaquach marked this conversation as resolved.
Show resolved Hide resolved

## Standard flags

<br />

@include 'cli/standard-settings/all-standard-flags.mdx'
kiannaquach marked this conversation as resolved.
Show resolved Hide resolved

## Examples

Expand All @@ -16,8 +51,3 @@ Disconnect from HCP:
```shell-session
$ vault hcp disconnect
```

## Usage

All [standard set of
flags](/vault/docs/commands) are included.
27 changes: 0 additions & 27 deletions website/content/docs/commands/hcp/index.mdx

This file was deleted.

45 changes: 37 additions & 8 deletions website/content/docs/commands/list.mdx
Original file line number Diff line number Diff line change
@@ -1,25 +1,54 @@
---
layout: docs
page_title: list - Command
page_title: list - Vault CLI
description: |-
The "list" command lists data from Vault at the given path. This can be used
List data from Vault at the given path. This can be used
to list keys in a, given secrets engine.
---

# list

The `list` command lists data from Vault at the given path (wrapper command for
List data from Vault at the given path. This can be used
to list keys in a, given secrets engine.
kiannaquach marked this conversation as resolved.
Show resolved Hide resolved

<CodeBlockConfig hideClipboard>

```shell-session
$ vault list [options] PATH
kiannaquach marked this conversation as resolved.
Show resolved Hide resolved
$ vault list [-help | -h]
```

</CodeBlockConfig>

## Description
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a corresponding API endpoint?


`list` lists data from Vault at the given path (wrapper command for
HTTP LIST). This can be used to list keys in a given secrets engine.

### Limitations and warnings

- None
kiannaquach marked this conversation as resolved.
Show resolved Hide resolved

## Command arguments

<br />

@include 'cli/list/args/path.mdx'

## Command flags
kiannaquach marked this conversation as resolved.
Show resolved Hide resolved

- None
kiannaquach marked this conversation as resolved.
Show resolved Hide resolved

## Standard flags

<br />

@include 'cli/standard-settings/all-standard-flags.mdx'

## Examples

List available entities by their identifiers:

```shell-session
$ vault list identity/entity/id
```

## Usage

There are no flags beyond the [standard set of flags](/vault/docs/commands)
included on all commands.
9 changes: 9 additions & 0 deletions website/content/partials/cli/hcp/flags/client-id.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<a id="hcp-connect-flag-client-id" />

** `-client-id (string : "")` **

Client ID belonging to a service principal
credential generated in the HCP Portal. **Required for non-interactive
authentication**.

**Example**: `-client-id "sp-739987@d79db23f-54f6-41c1-bc48-f870542c0ae1"`
9 changes: 9 additions & 0 deletions website/content/partials/cli/hcp/flags/cluster-id.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<a id="hcp-connect-flag-cluster-id" />

** `-project-id (string : "")` **

Optional ID of the desired HCP Vault Dedicated cluster.
kiannaquach marked this conversation as resolved.
Show resolved Hide resolved
If `cluster-id` is empty and the user is associated with multiple HCP clusters,
the CLI prompts the user to select from a list of available clusters.

**Example**: `-cluster-id "cluster-name"`
10 changes: 10 additions & 0 deletions website/content/partials/cli/hcp/flags/organization-id.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<a id="hcp-connect-flag-organization-id" />

** `-organization-id (string : "")` **

Optional ID of the desired HCP
kiannaquach marked this conversation as resolved.
Show resolved Hide resolved
organization. If `organization-id` is empty and the user is associated with
multiple HCP organizations, the CLI prompts the user to select from a list
of available organizations.

**Example**: `-organization-id "80wdc133-3eb3-4d57-a244-1rt43b67nui9"`
9 changes: 9 additions & 0 deletions website/content/partials/cli/hcp/flags/project-id.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<a id="hcp-connect-flag-project-id" />

** `-project-id (string : "")` **

Optional ID of the desired HCP project. If
kiannaquach marked this conversation as resolved.
Show resolved Hide resolved
`project-id` is empty and the user is associated with more than one HCP
project, the CLI prompts the user to select from a list of available projects.

**Example**: `-project-id "d79cs87e-54f6-41w1-bc48-f870542c0av1"`
9 changes: 9 additions & 0 deletions website/content/partials/cli/hcp/flags/secret-id.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<a id="hcp-connect-flag-secret-id" />

** `-secret-id (string "")` **

Secret ID belonging to a service principal
credential previously generated in the HCP Portal. **Required for
non-interactive authentication**.

**Example**: `-secret-id "secret-id-value"`
7 changes: 7 additions & 0 deletions website/content/partials/cli/list/args/path.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<a id="list-arg-path" />

**`path (string : <required>)`**

The internal path in Vault that lists data.

**Example**: `"secret/my-app/"`
7 changes: 1 addition & 6 deletions website/data/docs-nav-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@
{
"title": "<code>generate-config</code>",
"path": "commands/agent/generate-config"
}
}
]
},
{
Expand Down Expand Up @@ -712,10 +712,6 @@
{
"title": "<code>hcp</code>",
"routes": [
{
"title": "Overview",
"path": "commands/hcp"
},
{
"title": "<code>connect</code>",
"path": "commands/hcp/connect"
Expand Down Expand Up @@ -1950,7 +1946,6 @@
"path": "auth/saml/troubleshoot-adfs/adfs-event-320"
}
]

}
]
},
Expand Down