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

Docs audit: Snapshots #1491

Merged
merged 2 commits into from
Jan 9, 2024
Merged
Changes from all commits
Commits
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
29 changes: 16 additions & 13 deletions commands/snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,32 @@ func Snapshot() *Command {

snapshotDetail := `

- The snapshot's ID
- The snapshot's name
- The date and time when the snapshot was created
- The slugs of the datacenter regions in which the snapshot is available
- The type of resource the snapshot was made from, Droplet or volume, and its ID
- The minimum size in GB required for a Droplet or volume to use this snapshot
- The compressed, billable size of the snapshot
- The snapshot's ID
- The snapshot's name
- The date and time when the snapshot was created
- The slugs of the datacenter regions in which the snapshot is available
- The type of resource the snapshot was made from (either from Droplet or volume) and its ID
- The minimum size required for a Droplet or volume to use this snapshot, in GB
- The compressed, billable size of the snapshot
`

cmdRunSnapshotList := CmdBuilder(cmd, RunSnapshotList, "list [glob]",
"List Droplet and volume snapshots", "List information about Droplet and block storage volume snapshots, including:"+snapshotDetail,
"List Droplet and volume snapshots", "Retrieves a list of snapshots and their information, including:"+snapshotDetail,
Writer, aliasOpt("ls"), displayerType(&displayers.Snapshot{}))
AddStringFlag(cmdRunSnapshotList, doctl.ArgResourceType, "", "", "Filter by resource type (`droplet` or `volume`)")
AddStringFlag(cmdRunSnapshotList, doctl.ArgRegionSlug, "", "", "Filter by regional availability")
AddStringFlag(cmdRunSnapshotList, doctl.ArgResourceType, "", "", "Filters by resource type (`droplet` or `volume`)")
AddStringFlag(cmdRunSnapshotList, doctl.ArgRegionSlug, "", "", "Filters by regional availability")
cmdRunSnapshotList.Example = `The following example lists all Droplet snapshots in the ` + "`" + `nyc1` + "`" + ` region and uses the ` + "`" + `--format` + "`" + ` flag to return only name, ID, and resource type for each snapshot: doctl compute snapshot list --resource droplet --region nyc1 --format Name,ID,ResourceType`

CmdBuilder(cmd, RunSnapshotGet, "get <snapshot-id>...",
"Retrieve a Droplet or volume snapshot", "Retrieve information about a Droplet or block storage volume snapshot, including:"+snapshotDetail,
cmdSnapshotGet := CmdBuilder(cmd, RunSnapshotGet, "get <snapshot-id>...",
"Retrieve a Droplet or volume snapshot", "Retrieves information about a Droplet or block storage volume snapshot, including:"+snapshotDetail,
Writer, aliasOpt("g"), displayerType(&displayers.Snapshot{}))
cmdSnapshotGet.Example = `The following example retrieves information about a Droplet snapshot with ID ` + "`" + `386734086` + "`" + `: doctl compute snapshot get 386734086`

cmdRunSnapshotDelete := CmdBuilder(cmd, RunSnapshotDelete, "delete <snapshot-id>...",
"Delete a snapshot of a Droplet or volume", "Delete a snapshot of a Droplet or volume by specifying its ID.",
"Delete a snapshot of a Droplet or volume", "Deletes the specified snapshot or volume. This is irreversible.",
Writer, aliasOpt("d", "rm"), displayerType(&displayers.Snapshot{}))
AddBoolFlag(cmdRunSnapshotDelete, doctl.ArgForce, doctl.ArgShortForce, false, "Delete the snapshot without confirmation")
cmdRunSnapshotDelete.Example = `The following example deletes a Droplet snapshot with ID ` + "`" + `386734086` + "`" + `: doctl compute snapshot delete 386734086`

return cmd
}
Expand Down