diff --git a/website/source/docs/commands/snapshot.html.markdown b/website/source/docs/commands/snapshot.html.markdown index 9f9ece331f..e68e86a410 100644 --- a/website/source/docs/commands/snapshot.html.markdown +++ b/website/source/docs/commands/snapshot.html.markdown @@ -8,10 +8,10 @@ sidebar_current: "docs-commands-snapshot" Command: `consul snapshot` -The `snapshot` command has subcommands for saving and restoring the state of the -Consul servers for disaster recovery. These are atomic, point-in-time snapshots -which include key/value entries, service catalog, prepared queries, sessions, and -ACLs. This command is available in Consul 0.7.1 and later. +The `snapshot` command has subcommands for saving, restoring and inspecting the +state of the Consul servers for disaster recovery. These are atomic, point-in-time +snapshots which include key/value entries, service catalog, prepared queries, +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). @@ -29,6 +29,7 @@ Usage: consul snapshot [options] [args] Subcommands: + inspect Displays information about a Consul snapshot file restore Restores 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 of the subcommand in the sidebar or one of the links below: +- [inspect] (/docs/commands/snapshot/inspect.html) - [restore](/docs/commands/snapshot/restore.html) - [save](/docs/commands/snapshot/save.html) @@ -55,5 +57,16 @@ $ consul snapshot restore backup.snap 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 by clicking on one of the links in the sidebar. diff --git a/website/source/docs/commands/snapshot/inspect.html.markdown.erb b/website/source/docs/commands/snapshot/inspect.html.markdown.erb new file mode 100644 index 0000000000..d249c06f5a --- /dev/null +++ b/website/source/docs/commands/snapshot/inspect.html.markdown.erb @@ -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. \ No newline at end of file diff --git a/website/source/layouts/docs.erb b/website/source/layouts/docs.erb index 0b7a00ec52..726ce44f0d 100644 --- a/website/source/layouts/docs.erb +++ b/website/source/layouts/docs.erb @@ -152,6 +152,9 @@ > snapshot