Skip to content

Commit 7ae3ba5

Browse files
authored
Merge pull request #171 from ovh/dev/mrocher/storage-command-refactor
feat(ovhcloud-cli): refactor all storage commands
2 parents 4641b1d + 52244ff commit 7ae3ba5

131 files changed

Lines changed: 5151 additions & 74 deletions

File tree

Some content is hidden

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

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: generate-docs
5+
name: Generate CLI documentation
6+
entry: make doc
7+
language: system
8+
pass_filenames: false

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,8 @@ schemas:
3636
curl -s "https://eu.api.ovh.com/v1/$(UNIVERSE).json?format=openapi3" | jq 'del(.paths[] | .[]["x-code-samples"])' > "$$tmp" && \
3737
mv "$$tmp" internal/assets/api-schemas/$(UNIVERSE).json
3838

39-
.PHONY: all wasm doc schemas
39+
setup:
40+
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prek/releases/latest/download/prek-installer.sh | sh
41+
prek install
42+
43+
.PHONY: all wasm doc schemas setup

doc/ovhcloud_cloud.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ Manage your projects and services in the Public Cloud universe (MKS, MPR, MRS, O
4848
* [ovhcloud cloud region](ovhcloud_cloud_region.md) - Check regions in the given cloud project
4949
* [ovhcloud cloud savings-plan](ovhcloud_cloud_savings-plan.md) - Manage savings plans for your cloud project
5050
* [ovhcloud cloud ssh-key](ovhcloud_cloud_ssh-key.md) - Manage SSH keys in the given cloud project
51-
* [ovhcloud cloud storage-block](ovhcloud_cloud_storage-block.md) - Manage block storage volumes in the given cloud project
52-
* [ovhcloud cloud storage-file](ovhcloud_cloud_storage-file.md) - Manage file storage shares in the given cloud project
53-
* [ovhcloud cloud storage-s3](ovhcloud_cloud_storage-s3.md) - Manage S3™* compatible storage containers in the given cloud project (* S3 is a trademark filed by Amazon Technologies,Inc. OVHcloud's service is not sponsored by, endorsed by, or otherwise affiliated with Amazon Technologies,Inc.)
54-
* [ovhcloud cloud storage-swift](ovhcloud_cloud_storage-swift.md) - Manage SWIFT storage containers in the given cloud project
51+
* [ovhcloud cloud storage](ovhcloud_cloud_storage.md) - Manage storage services in the given cloud project
5552
* [ovhcloud cloud user](ovhcloud_cloud_user.md) - Manage users in the given cloud project
5653

doc/ovhcloud_cloud_storage.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## ovhcloud cloud storage
2+
3+
Manage storage services in the given cloud project
4+
5+
### Options
6+
7+
```
8+
-h, --help help for storage
9+
```
10+
11+
### Options inherited from parent commands
12+
13+
```
14+
-d, --debug Activate debug mode (will log all HTTP requests details)
15+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
16+
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
17+
Examples:
18+
--output json
19+
--output yaml
20+
--output interactive
21+
--output 'id' (to extract a single field)
22+
--output 'nested.field.subfield' (to extract a nested field)
23+
--output '[id, "name"]' (to extract multiple fields as an array)
24+
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
25+
--output 'name+","+type' (to extract and concatenate fields in a string)
26+
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
27+
--profile string Use a specific profile from the configuration file
28+
```
29+
30+
### SEE ALSO
31+
32+
* [ovhcloud cloud](ovhcloud_cloud.md) - Manage your projects and services in the Public Cloud universe (MKS, MPR, MRS, Object Storage...)
33+
* [ovhcloud cloud storage block](ovhcloud_cloud_storage_block.md) - Manage block storage volumes in the given cloud project
34+
* [ovhcloud cloud storage file](ovhcloud_cloud_storage_file.md) - Manage file storage shares in the given cloud project
35+
* [ovhcloud cloud storage object](ovhcloud_cloud_storage_object.md) - Manage S3™* compatible storage containers in the given cloud project (* S3 is a trademark filed by Amazon Technologies,Inc. OVHcloud's service is not sponsored by, endorsed by, or otherwise affiliated with Amazon Technologies,Inc.)
36+
* [ovhcloud cloud storage swift](ovhcloud_cloud_storage_swift.md) - Manage SWIFT storage containers in the given cloud project
37+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## ovhcloud cloud storage block
2+
3+
Manage block storage volumes in the given cloud project
4+
5+
### Options
6+
7+
```
8+
--cloud-project string Cloud project ID
9+
-h, --help help for block
10+
```
11+
12+
### Options inherited from parent commands
13+
14+
```
15+
-d, --debug Activate debug mode (will log all HTTP requests details)
16+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
17+
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
18+
Examples:
19+
--output json
20+
--output yaml
21+
--output interactive
22+
--output 'id' (to extract a single field)
23+
--output 'nested.field.subfield' (to extract a nested field)
24+
--output '[id, "name"]' (to extract multiple fields as an array)
25+
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
26+
--output 'name+","+type' (to extract and concatenate fields in a string)
27+
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
28+
--profile string Use a specific profile from the configuration file
29+
```
30+
31+
### SEE ALSO
32+
33+
* [ovhcloud cloud storage](ovhcloud_cloud_storage.md) - Manage storage services in the given cloud project
34+
* [ovhcloud cloud storage block attach](ovhcloud_cloud_storage_block_attach.md) - Attach the given volume to the given instance
35+
* [ovhcloud cloud storage block backup](ovhcloud_cloud_storage_block_backup.md) - Manage volume backups in the given cloud project
36+
* [ovhcloud cloud storage block create](ovhcloud_cloud_storage_block_create.md) - Create a new volume
37+
* [ovhcloud cloud storage block create-from-backup](ovhcloud_cloud_storage_block_create-from-backup.md) - Create a volume from the given backup
38+
* [ovhcloud cloud storage block delete](ovhcloud_cloud_storage_block_delete.md) - Delete the given volume
39+
* [ovhcloud cloud storage block detach](ovhcloud_cloud_storage_block_detach.md) - Detach the given volume from the given instance
40+
* [ovhcloud cloud storage block edit](ovhcloud_cloud_storage_block_edit.md) - Edit the given volume
41+
* [ovhcloud cloud storage block get](ovhcloud_cloud_storage_block_get.md) - Get a specific volume
42+
* [ovhcloud cloud storage block list](ovhcloud_cloud_storage_block_list.md) - List volumes
43+
* [ovhcloud cloud storage block snapshot](ovhcloud_cloud_storage_block_snapshot.md) - Manage snapshots of the given volume
44+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## ovhcloud cloud storage block attach
2+
3+
Attach the given volume to the given instance
4+
5+
```
6+
ovhcloud cloud storage block attach <volume_id> <instance_id> [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
-h, --help help for attach
13+
```
14+
15+
### Options inherited from parent commands
16+
17+
```
18+
--cloud-project string Cloud project ID
19+
-d, --debug Activate debug mode (will log all HTTP requests details)
20+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
21+
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
22+
Examples:
23+
--output json
24+
--output yaml
25+
--output interactive
26+
--output 'id' (to extract a single field)
27+
--output 'nested.field.subfield' (to extract a nested field)
28+
--output '[id, "name"]' (to extract multiple fields as an array)
29+
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
30+
--output 'name+","+type' (to extract and concatenate fields in a string)
31+
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
32+
--profile string Use a specific profile from the configuration file
33+
```
34+
35+
### SEE ALSO
36+
37+
* [ovhcloud cloud storage block](ovhcloud_cloud_storage_block.md) - Manage block storage volumes in the given cloud project
38+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## ovhcloud cloud storage block backup
2+
3+
Manage volume backups in the given cloud project
4+
5+
### Options
6+
7+
```
8+
-h, --help help for backup
9+
```
10+
11+
### Options inherited from parent commands
12+
13+
```
14+
--cloud-project string Cloud project ID
15+
-d, --debug Activate debug mode (will log all HTTP requests details)
16+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
17+
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
18+
Examples:
19+
--output json
20+
--output yaml
21+
--output interactive
22+
--output 'id' (to extract a single field)
23+
--output 'nested.field.subfield' (to extract a nested field)
24+
--output '[id, "name"]' (to extract multiple fields as an array)
25+
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
26+
--output 'name+","+type' (to extract and concatenate fields in a string)
27+
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
28+
--profile string Use a specific profile from the configuration file
29+
```
30+
31+
### SEE ALSO
32+
33+
* [ovhcloud cloud storage block](ovhcloud_cloud_storage_block.md) - Manage block storage volumes in the given cloud project
34+
* [ovhcloud cloud storage block backup create](ovhcloud_cloud_storage_block_backup_create.md) - Create a backup of the given volume
35+
* [ovhcloud cloud storage block backup delete](ovhcloud_cloud_storage_block_backup_delete.md) - Delete the given volume backup
36+
* [ovhcloud cloud storage block backup get](ovhcloud_cloud_storage_block_backup_get.md) - Get a specific volume backup
37+
* [ovhcloud cloud storage block backup list](ovhcloud_cloud_storage_block_backup_list.md) - List volume backups
38+
* [ovhcloud cloud storage block backup restore](ovhcloud_cloud_storage_block_backup_restore.md) - Restore a volume from the given backup
39+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## ovhcloud cloud storage block backup create
2+
3+
Create a backup of the given volume
4+
5+
```
6+
ovhcloud cloud storage block backup create <volume_id> <backup_name> [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
-h, --help help for create
13+
```
14+
15+
### Options inherited from parent commands
16+
17+
```
18+
--cloud-project string Cloud project ID
19+
-d, --debug Activate debug mode (will log all HTTP requests details)
20+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
21+
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
22+
Examples:
23+
--output json
24+
--output yaml
25+
--output interactive
26+
--output 'id' (to extract a single field)
27+
--output 'nested.field.subfield' (to extract a nested field)
28+
--output '[id, "name"]' (to extract multiple fields as an array)
29+
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
30+
--output 'name+","+type' (to extract and concatenate fields in a string)
31+
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
32+
--profile string Use a specific profile from the configuration file
33+
```
34+
35+
### SEE ALSO
36+
37+
* [ovhcloud cloud storage block backup](ovhcloud_cloud_storage_block_backup.md) - Manage volume backups in the given cloud project
38+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## ovhcloud cloud storage block backup delete
2+
3+
Delete the given volume backup
4+
5+
```
6+
ovhcloud cloud storage block backup delete <backup_id> [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
-h, --help help for delete
13+
```
14+
15+
### Options inherited from parent commands
16+
17+
```
18+
--cloud-project string Cloud project ID
19+
-d, --debug Activate debug mode (will log all HTTP requests details)
20+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
21+
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
22+
Examples:
23+
--output json
24+
--output yaml
25+
--output interactive
26+
--output 'id' (to extract a single field)
27+
--output 'nested.field.subfield' (to extract a nested field)
28+
--output '[id, "name"]' (to extract multiple fields as an array)
29+
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
30+
--output 'name+","+type' (to extract and concatenate fields in a string)
31+
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
32+
--profile string Use a specific profile from the configuration file
33+
```
34+
35+
### SEE ALSO
36+
37+
* [ovhcloud cloud storage block backup](ovhcloud_cloud_storage_block_backup.md) - Manage volume backups in the given cloud project
38+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## ovhcloud cloud storage block backup get
2+
3+
Get a specific volume backup
4+
5+
```
6+
ovhcloud cloud storage block backup get <backup_id> [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
-h, --help help for get
13+
```
14+
15+
### Options inherited from parent commands
16+
17+
```
18+
--cloud-project string Cloud project ID
19+
-d, --debug Activate debug mode (will log all HTTP requests details)
20+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
21+
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
22+
Examples:
23+
--output json
24+
--output yaml
25+
--output interactive
26+
--output 'id' (to extract a single field)
27+
--output 'nested.field.subfield' (to extract a nested field)
28+
--output '[id, "name"]' (to extract multiple fields as an array)
29+
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
30+
--output 'name+","+type' (to extract and concatenate fields in a string)
31+
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
32+
--profile string Use a specific profile from the configuration file
33+
```
34+
35+
### SEE ALSO
36+
37+
* [ovhcloud cloud storage block backup](ovhcloud_cloud_storage_block_backup.md) - Manage volume backups in the given cloud project
38+

0 commit comments

Comments
 (0)