Added website docs for snapshot inspect command

This commit is contained in:
Kyle Havlovitz 2016-10-31 16:49:25 -04:00
parent 2d29c510dc
commit c97c59b070
No known key found for this signature in database
GPG Key ID: 836A4D58766E5793
3 changed files with 67 additions and 4 deletions

View File

@ -8,10 +8,10 @@ sidebar_current: "docs-commands-snapshot"
Command: `consul snapshot` Command: `consul snapshot`
The `snapshot` command has subcommands for saving and restoring the state of the The `snapshot` command has subcommands for saving, restoring and inspecting the
Consul servers for disaster recovery. These are atomic, point-in-time snapshots state of the Consul servers for disaster recovery. These are atomic, point-in-time
which include key/value entries, service catalog, prepared queries, sessions, and snapshots which include key/value entries, service catalog, prepared queries,
ACLs. This command is available in Consul 0.7.1 and later. sessions, and ACLs. This command is available in Consul 0.7.1 and later.
Snapshots are also accessible via the [HTTP API](/docs/agent/http/snapshot.html). Snapshots are also accessible via the [HTTP API](/docs/agent/http/snapshot.html).
@ -29,6 +29,7 @@ Usage: consul snapshot <subcommand> [options] [args]
Subcommands: Subcommands:
inspect Displays information about a Consul snapshot file
restore Restores snapshot of Consul server state restore Restores snapshot of Consul server state
save Saves snapshot of Consul server state save Saves snapshot of Consul server state
``` ```
@ -36,6 +37,7 @@ Subcommands:
For more information, examples, and usage about a subcommand, click on the name For more information, examples, and usage about a subcommand, click on the name
of the subcommand in the sidebar or one of the links below: of the subcommand in the sidebar or one of the links below:
- [inspect] (/docs/commands/snapshot/inspect.html)
- [restore](/docs/commands/snapshot/restore.html) - [restore](/docs/commands/snapshot/restore.html)
- [save](/docs/commands/snapshot/save.html) - [save](/docs/commands/snapshot/save.html)
@ -55,5 +57,16 @@ $ consul snapshot restore backup.snap
Restored snapshot Restored snapshot
``` ```
To inspect a snapshot from the file "backup.snap":
```text
$ consul snapshot inspect backup.snap
ID 2-5-1477944140022
Size 667
Index 5
Term 2
Version 1
```
For more examples, ask for subcommand help or view the subcommand documentation For more examples, ask for subcommand help or view the subcommand documentation
by clicking on one of the links in the sidebar. by clicking on one of the links in the sidebar.

View File

@ -0,0 +1,47 @@
---
layout: "docs"
page_title: "Commands: Snapshot Inspect"
sidebar_current: "docs-commands-snapshot-inspect"
---
# Consul Snapshot Inspect
Command: `consul snapshot inspect`
The `snapshot inspect` command is used to inspect an atomic, point-in-time
snapshot of the state of the Consul servers which includes key/value entries,
service catalog, prepared queries, sessions, and ACLs. The snapshot is read
from the given file.
The following fields are displayed when inspecting a snapshot:
* `ID` - A unique ID for the snapshot, only used for differentiation purposes.
* `Size` - The size of the snapshot, in bytes.
* `Index` - The Raft index of the latest log entry in the snapshot.
* `Term` - The Raft term of the latest log entry in the snapshot.
* `Version` - The snapshot format version. This only refers to the structure of
the snapshot, not the data contained within.
## Usage
Usage: `consul snapshot inspect [options] FILE`
## Examples
To inspect a snapshot from the file "backup.snap":
```text
$ consul snapshot inspect backup.snap
ID 2-5-1477944140022
Size 667
Index 5
Term 2
Version 1
```
Please see the [HTTP API](/docs/agent/http/snapshot.html) documentation for
more details about snapshot internals.

View File

@ -152,6 +152,9 @@
<li<%= sidebar_current("docs-commands-snapshot") %>> <li<%= sidebar_current("docs-commands-snapshot") %>>
<a href="/docs/commands/snapshot.html">snapshot</a> <a href="/docs/commands/snapshot.html">snapshot</a>
<ul class="subnav"> <ul class="subnav">
<li<%= sidebar_current("docs-commands-snapshot-inspect") %>>
<a href="/docs/commands/snapshot/inspect.html">inspect</a>
</li>
<li<%= sidebar_current("docs-commands-snapshot-restore") %>> <li<%= sidebar_current("docs-commands-snapshot-restore") %>>
<a href="/docs/commands/snapshot/restore.html">restore</a> <a href="/docs/commands/snapshot/restore.html">restore</a>
</li> </li>