Skip to content

Commit a325c67

Browse files
authored
Merge pull request #122 from gtema/volume
feat(volume): cover block-storage backup
2 parents d97bb3a + 4a043fb commit a325c67

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+6864
-87
lines changed

doc/src/osc.md

Lines changed: 258 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ This document contains the help content for the `osc` command-line program.
1010
* [`osc auth login`↴](#osc-auth-login)
1111
* [`osc auth show`↴](#osc-auth-show)
1212
* [`osc block-storage`↴](#osc-block-storage)
13+
* [`osc block-storage backup`↴](#osc-block-storage-backup)
14+
* [`osc block-storage backup create351`↴](#osc-block-storage-backup-create351)
15+
* [`osc block-storage backup create343`↴](#osc-block-storage-backup-create343)
16+
* [`osc block-storage backup create30`↴](#osc-block-storage-backup-create30)
17+
* [`osc block-storage backup delete`↴](#osc-block-storage-backup-delete)
18+
* [`osc block-storage backup export`↴](#osc-block-storage-backup-export)
19+
* [`osc block-storage backup force-delete`↴](#osc-block-storage-backup-force-delete)
20+
* [`osc block-storage backup import`↴](#osc-block-storage-backup-import)
21+
* [`osc block-storage backup list`↴](#osc-block-storage-backup-list)
22+
* [`osc block-storage backup reset-status`↴](#osc-block-storage-backup-reset-status)
23+
* [`osc block-storage backup set343`↴](#osc-block-storage-backup-set343)
24+
* [`osc block-storage backup set39`↴](#osc-block-storage-backup-set39)
25+
* [`osc block-storage backup show`↴](#osc-block-storage-backup-show)
1326
* [`osc block-storage volume`↴](#osc-block-storage-volume)
1427
* [`osc block-storage volume create353`↴](#osc-block-storage-volume-create353)
1528
* [`osc block-storage volume create347`↴](#osc-block-storage-volume-create347)
@@ -645,11 +658,252 @@ Block Storage (Volume) service (Cinder) commands
645658

646659
###### **Subcommands:**
647660

661+
* `backup` — Backups
648662
* `volume` — Block Storage Volume commands
649663
* `type` — Block Storage VolumeType type commands
650664

651665

652666

667+
## `osc block-storage backup`
668+
669+
Backups
670+
671+
A backup is a full copy of a volume stored in an external service. The service can be configured. The only supported service is Object Storage. A backup can subsequently be restored from the external service to either the same volume that the backup was originally taken from or to a new volume.
672+
673+
**Usage:** `osc block-storage backup <COMMAND>`
674+
675+
###### **Subcommands:**
676+
677+
* `create351` — Create a new backup
678+
* `create343` — Create a new backup
679+
* `create30` — Create a new backup
680+
* `delete` — Delete a backup
681+
* `export` — Export a backup
682+
* `force-delete` — Empty body for os-force_delete action
683+
* `import` — Import a backup
684+
* `list` — Returns a detailed list of backups
685+
* `reset-status` — Command without description in OpenAPI
686+
* `set343` — Update a backup
687+
* `set39` — Update a backup
688+
* `show` — Return data about the given backup
689+
690+
691+
692+
## `osc block-storage backup create351`
693+
694+
Create a new backup
695+
696+
**Usage:** `osc block-storage backup create351 [OPTIONS] --volume-id <VOLUME_ID>`
697+
698+
###### **Options:**
699+
700+
* `--availability-zone <AVAILABILITY_ZONE>` — The backup availability zone key value pair
701+
* `--container <CONTAINER>` — The container name or null
702+
* `--description <DESCRIPTION>` — The backup description or null
703+
* `--force <FORCE>` — Indicates whether to backup, even if the volume is attached. Default is `false`. See [valid boolean values](#valid-boolean-values)
704+
705+
Possible values: `true`, `false`
706+
707+
* `--incremental <INCREMENTAL>` — Indicates whether to backup, even if the volume is attached. Default is `false`. See [valid boolean values](#valid-boolean-values)
708+
709+
Possible values: `true`, `false`
710+
711+
* `--metadata <key=value>` — The backup metadata key value pairs
712+
* `--name <NAME>` — The name of the Volume Backup
713+
* `--snapshot-id <SNAPSHOT_ID>` — The UUID of the source snapshot that you want to back up
714+
* `--volume-id <VOLUME_ID>` — The UUID of the volume that you want to back up
715+
716+
717+
718+
## `osc block-storage backup create343`
719+
720+
Create a new backup
721+
722+
**Usage:** `osc block-storage backup create343 [OPTIONS] --volume-id <VOLUME_ID>`
723+
724+
###### **Options:**
725+
726+
* `--container <CONTAINER>` — The container name or null
727+
* `--description <DESCRIPTION>` — The backup description or null
728+
* `--force <FORCE>` — Indicates whether to backup, even if the volume is attached. Default is `false`. See [valid boolean values](#valid-boolean-values)
729+
730+
Possible values: `true`, `false`
731+
732+
* `--incremental <INCREMENTAL>` — Indicates whether to backup, even if the volume is attached. Default is `false`. See [valid boolean values](#valid-boolean-values)
733+
734+
Possible values: `true`, `false`
735+
736+
* `--metadata <key=value>` — The backup metadata key value pairs
737+
* `--name <NAME>` — The name of the Volume Backup
738+
* `--snapshot-id <SNAPSHOT_ID>` — The UUID of the source snapshot that you want to back up
739+
* `--volume-id <VOLUME_ID>` — The UUID of the volume that you want to back up
740+
741+
742+
743+
## `osc block-storage backup create30`
744+
745+
Create a new backup
746+
747+
**Usage:** `osc block-storage backup create30 [OPTIONS] --volume-id <VOLUME_ID>`
748+
749+
###### **Options:**
750+
751+
* `--container <CONTAINER>` — The container name or null
752+
* `--description <DESCRIPTION>` — The backup description or null
753+
* `--force <FORCE>` — Indicates whether to backup, even if the volume is attached. Default is `false`. See [valid boolean values](#valid-boolean-values)
754+
755+
Possible values: `true`, `false`
756+
757+
* `--incremental <INCREMENTAL>` — Indicates whether to backup, even if the volume is attached. Default is `false`. See [valid boolean values](#valid-boolean-values)
758+
759+
Possible values: `true`, `false`
760+
761+
* `--name <NAME>` — The name of the Volume Backup
762+
* `--snapshot-id <SNAPSHOT_ID>` — The UUID of the source snapshot that you want to back up
763+
* `--volume-id <VOLUME_ID>` — The UUID of the volume that you want to back up
764+
765+
766+
767+
## `osc block-storage backup delete`
768+
769+
Delete a backup
770+
771+
**Usage:** `osc block-storage backup delete <ID>`
772+
773+
###### **Arguments:**
774+
775+
* `<ID>` — id parameter for /v3/backups/{id} API
776+
777+
778+
779+
## `osc block-storage backup export`
780+
781+
Export a backup
782+
783+
**Usage:** `osc block-storage backup export <ID>`
784+
785+
###### **Arguments:**
786+
787+
* `<ID>` — id parameter for /v3/backups/{id}/export_record API
788+
789+
790+
791+
## `osc block-storage backup force-delete`
792+
793+
Empty body for os-force_delete action
794+
795+
**Usage:** `osc block-storage backup force-delete <ID>`
796+
797+
###### **Arguments:**
798+
799+
* `<ID>` — id parameter for /v3/backups/{id}/action API
800+
801+
802+
803+
## `osc block-storage backup import`
804+
805+
Import a backup
806+
807+
**Usage:** `osc block-storage backup import --backup-service <BACKUP_SERVICE> --backup-url <BACKUP_URL>`
808+
809+
###### **Options:**
810+
811+
* `--backup-service <BACKUP_SERVICE>` — The service used to perform the backup
812+
* `--backup-url <BACKUP_URL>` — An identifier string to locate the backup
813+
814+
815+
816+
## `osc block-storage backup list`
817+
818+
Returns a detailed list of backups
819+
820+
**Usage:** `osc block-storage backup list [OPTIONS]`
821+
822+
###### **Options:**
823+
824+
* `--all-tenants <ALL_TENANTS>` — Shows details for all project. Admin only
825+
826+
Possible values: `true`, `false`
827+
828+
* `--limit <LIMIT>` — Requests a page size of items. Returns a number of items up to a limit value. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request
829+
* `--marker <MARKER>` — The ID of the last-seen item. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request
830+
* `--offset <OFFSET>` — Used in conjunction with limit to return a slice of items. offset is where to start in the list
831+
* `--sort <SORT>` — Comma-separated list of sort keys and optional sort directions in the form of \< key > \[: \< direction > \]. A valid direction is asc (ascending) or desc (descending)
832+
* `--sort-dir <SORT_DIR>` — Sorts by one or more sets of attribute and sort direction combinations. If you omit the sort direction in a set, default is desc. Deprecated in favour of the combined sort parameter
833+
* `--sort-key <SORT_KEY>` — Sorts by an attribute. A valid value is name, status, container_format, disk_format, size, id, created_at, or updated_at. Default is created_at. The API uses the natural sorting direction of the sort_key attribute value. Deprecated in favour of the combined sort parameter
834+
* `--with-count <WITH_COUNT>` — Whether to show count in API response or not, default is False
835+
836+
Possible values: `true`, `false`
837+
838+
* `--max-items <MAX_ITEMS>` — Total limit of entities count to return. Use this when there are too many entries
839+
840+
Default value: `10000`
841+
842+
843+
844+
## `osc block-storage backup reset-status`
845+
846+
Command without description in OpenAPI
847+
848+
**Usage:** `osc block-storage backup reset-status --status <STATUS> <ID>`
849+
850+
###### **Arguments:**
851+
852+
* `<ID>` — id parameter for /v3/backups/{id}/action API
853+
854+
###### **Options:**
855+
856+
* `--status <STATUS>`
857+
858+
859+
860+
## `osc block-storage backup set343`
861+
862+
Update a backup
863+
864+
**Usage:** `osc block-storage backup set343 [OPTIONS] <ID>`
865+
866+
###### **Arguments:**
867+
868+
* `<ID>` — id parameter for /v3/backups/{id} API
869+
870+
###### **Options:**
871+
872+
* `--description <DESCRIPTION>`
873+
* `--metadata <key=value>`
874+
* `--name <NAME>`
875+
876+
877+
878+
## `osc block-storage backup set39`
879+
880+
Update a backup
881+
882+
**Usage:** `osc block-storage backup set39 [OPTIONS] <ID>`
883+
884+
###### **Arguments:**
885+
886+
* `<ID>` — id parameter for /v3/backups/{id} API
887+
888+
###### **Options:**
889+
890+
* `--description <DESCRIPTION>`
891+
* `--name <NAME>`
892+
893+
894+
895+
## `osc block-storage backup show`
896+
897+
Return data about the given backup
898+
899+
**Usage:** `osc block-storage backup show <ID>`
900+
901+
###### **Arguments:**
902+
903+
* `<ID>` — id parameter for /v3/backups/{id} API
904+
905+
906+
653907
## `osc block-storage volume`
654908

655909
Block Storage Volume commands
@@ -693,7 +947,7 @@ Creates a new volume.
693947
* `--image-id <IMAGE_ID>`
694948
* `--image-ref <IMAGE_REF>` — The UUID of the image from which you want to create the volume. Required to create a bootable volume
695949
* `--metadata <key=value>` — One or more metadata key and value pairs to be associated with the new volume
696-
* `--multiattach <MULTIATTACH>` — To enable this volume to attach to more than one server, set this value to `true`. Default is `false`. Note that support for multiattach volumes depends on the volume type being used. See [valid boolean values](#valid-boolean-values)
950+
* `--multiattach <MULTIATTACH>`
697951

698952
Possible values: `true`, `false`
699953

@@ -726,7 +980,7 @@ Creates a new volume.
726980
* `--image-id <IMAGE_ID>`
727981
* `--image-ref <IMAGE_REF>` — The UUID of the image from which you want to create the volume. Required to create a bootable volume
728982
* `--metadata <key=value>` — One or more metadata key and value pairs to be associated with the new volume
729-
* `--multiattach <MULTIATTACH>` — To enable this volume to attach to more than one server, set this value to `true`. Default is `false`. Note that support for multiattach volumes depends on the volume type being used. See [valid boolean values](#valid-boolean-values)
983+
* `--multiattach <MULTIATTACH>`
730984

731985
Possible values: `true`, `false`
732986

@@ -758,7 +1012,7 @@ Creates a new volume.
7581012
* `--image-id <IMAGE_ID>`
7591013
* `--image-ref <IMAGE_REF>` — The UUID of the image from which you want to create the volume. Required to create a bootable volume
7601014
* `--metadata <key=value>` — One or more metadata key and value pairs to be associated with the new volume
761-
* `--multiattach <MULTIATTACH>` — To enable this volume to attach to more than one server, set this value to `true`. Default is `false`. Note that support for multiattach volumes depends on the volume type being used. See [valid boolean values](#valid-boolean-values)
1015+
* `--multiattach <MULTIATTACH>`
7621016

7631017
Possible values: `true`, `false`
7641018

@@ -789,7 +1043,7 @@ Creates a new volume.
7891043
* `--image-id <IMAGE_ID>`
7901044
* `--image-ref <IMAGE_REF>` — The UUID of the image from which you want to create the volume. Required to create a bootable volume
7911045
* `--metadata <key=value>` — One or more metadata key and value pairs to be associated with the new volume
792-
* `--multiattach <MULTIATTACH>` — To enable this volume to attach to more than one server, set this value to `true`. Default is `false`. Note that support for multiattach volumes depends on the volume type being used. See [valid boolean values](#valid-boolean-values)
1046+
* `--multiattach <MULTIATTACH>`
7931047

7941048
Possible values: `true`, `false`
7951049

openstack_cli/src/block_storage/v3.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use openstack_sdk::AsyncOpenStack;
1919

2020
use crate::{Cli, OpenStackCliError};
2121

22+
mod backup;
2223
mod r#type;
2324
mod volume;
2425

@@ -34,6 +35,7 @@ pub struct BlockStorageCommand {
3435
#[allow(missing_docs)]
3536
#[derive(Subcommand)]
3637
pub enum BlockStorageCommands {
38+
Backup(backup::BackupCommand),
3739
Volume(volume::VolumeCommand),
3840
Type(r#type::VolumeTypeCommand),
3941
}
@@ -46,6 +48,7 @@ impl BlockStorageCommand {
4648
session: &mut AsyncOpenStack,
4749
) -> Result<(), OpenStackCliError> {
4850
match &self.command {
51+
BlockStorageCommands::Backup(cmd) => cmd.take_action(parsed_args, session).await,
4952
BlockStorageCommands::Volume(cmd) => cmd.take_action(parsed_args, session).await,
5053
BlockStorageCommands::Type(cmd) => cmd.take_action(parsed_args, session).await,
5154
}

0 commit comments

Comments
 (0)