Skip to content

Commit 81165e8

Browse files
author
Mathis Rocher
committed
feat(ovhcloud-cli): add share features
Signed-off-by: Mathis Rocher <mathis.rocher@corp.ovh.com>
1 parent cc6e2d6 commit 81165e8

26 files changed

Lines changed: 1780 additions & 385 deletions

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,8 @@ release-snapshot:
3030
release:
3131
goreleaser release --clean
3232

33-
.PHONY: all wasm doc
33+
schemas:
34+
@if [ -z "$(UNIVERSE)" ]; then echo "Usage: make schemas UNIVERSE=<name> (e.g. cloud, domain, vps)"; exit 1; fi
35+
curl -s https://eu.api.ovh.com/v1/$(UNIVERSE).json?format=openapi3 | jq 'del(.paths[] | .[]["x-code-samples"])' > internal/assets/api-schemas/$(UNIVERSE).json
36+
37+
.PHONY: all wasm doc schemas

doc/ovhcloud_cloud.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Manage your projects and services in the Public Cloud universe (MKS, MPR, MRS, O
4747
* [ovhcloud cloud savings-plan](ovhcloud_cloud_savings-plan.md) - Manage savings plans for your cloud project
4848
* [ovhcloud cloud ssh-key](ovhcloud_cloud_ssh-key.md) - Manage SSH keys in the given cloud project
4949
* [ovhcloud cloud storage-block](ovhcloud_cloud_storage-block.md) - Manage block storage volumes in the given cloud project
50+
* [ovhcloud cloud storage-file](ovhcloud_cloud_storage-file.md) - Manage file storage shares in the given cloud project
5051
* [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.)
5152
* [ovhcloud cloud storage-swift](ovhcloud_cloud_storage-swift.md) - Manage SWIFT storage containers in the given cloud project
5253
* [ovhcloud cloud user](ovhcloud_cloud_user.md) - Manage users in the given cloud project

doc/ovhcloud_cloud_storage-file.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## ovhcloud cloud storage-file
2+
3+
Manage file storage shares in the given cloud project
4+
5+
### Options
6+
7+
```
8+
--cloud-project string Cloud project ID
9+
-h, --help help for storage-file
10+
--region string Region (skip region discovery if set)
11+
```
12+
13+
### Options inherited from parent commands
14+
15+
```
16+
-d, --debug Activate debug mode (will log all HTTP requests details)
17+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
18+
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
19+
Examples:
20+
--output json
21+
--output yaml
22+
--output interactive
23+
--output 'id' (to extract a single field)
24+
--output 'nested.field.subfield' (to extract a nested field)
25+
--output '[id, "name"]' (to extract multiple fields as an array)
26+
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
27+
--output 'name+","+type' (to extract and concatenate fields in a string)
28+
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
29+
--profile string Use a specific profile from the configuration file
30+
```
31+
32+
### SEE ALSO
33+
34+
* [ovhcloud cloud](ovhcloud_cloud.md) - Manage your projects and services in the Public Cloud universe (MKS, MPR, MRS, Object Storage...)
35+
* [ovhcloud cloud storage-file share](ovhcloud_cloud_storage-file_share.md) - Manage file storage shares
36+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## ovhcloud cloud storage-file share
2+
3+
Manage file storage shares
4+
5+
### Options
6+
7+
```
8+
-h, --help help for share
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+
--region string Region (skip region discovery if set)
30+
```
31+
32+
### SEE ALSO
33+
34+
* [ovhcloud cloud storage-file](ovhcloud_cloud_storage-file.md) - Manage file storage shares in the given cloud project
35+
* [ovhcloud cloud storage-file share acl](ovhcloud_cloud_storage-file_share_acl.md) - Manage share access control lists
36+
* [ovhcloud cloud storage-file share create](ovhcloud_cloud_storage-file_share_create.md) - Create a new share
37+
* [ovhcloud cloud storage-file share delete](ovhcloud_cloud_storage-file_share_delete.md) - Delete the given share
38+
* [ovhcloud cloud storage-file share edit](ovhcloud_cloud_storage-file_share_edit.md) - Edit the given share
39+
* [ovhcloud cloud storage-file share get](ovhcloud_cloud_storage-file_share_get.md) - Get a specific share
40+
* [ovhcloud cloud storage-file share list](ovhcloud_cloud_storage-file_share_list.md) - List shares
41+
* [ovhcloud cloud storage-file share snapshot](ovhcloud_cloud_storage-file_share_snapshot.md) - Manage share snapshots
42+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## ovhcloud cloud storage-file share acl
2+
3+
Manage share access control lists
4+
5+
### Options
6+
7+
```
8+
-h, --help help for acl
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+
--region string Region (skip region discovery if set)
30+
```
31+
32+
### SEE ALSO
33+
34+
* [ovhcloud cloud storage-file share](ovhcloud_cloud_storage-file_share.md) - Manage file storage shares
35+
* [ovhcloud cloud storage-file share acl create](ovhcloud_cloud_storage-file_share_acl_create.md) - Create an ACL for the given share
36+
* [ovhcloud cloud storage-file share acl delete](ovhcloud_cloud_storage-file_share_acl_delete.md) - Delete an ACL from the given share
37+
* [ovhcloud cloud storage-file share acl get](ovhcloud_cloud_storage-file_share_acl_get.md) - Get a specific ACL for the given share
38+
* [ovhcloud cloud storage-file share acl list](ovhcloud_cloud_storage-file_share_acl_list.md) - List ACLs for the given share
39+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## ovhcloud cloud storage-file share acl create
2+
3+
Create an ACL for the given share
4+
5+
```
6+
ovhcloud cloud storage-file share acl create <share_id> [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
--access-level string Access level (ro, rw)
13+
--access-to string Access target (IP address or CIDR)
14+
-h, --help help for create
15+
```
16+
17+
### Options inherited from parent commands
18+
19+
```
20+
--cloud-project string Cloud project ID
21+
-d, --debug Activate debug mode (will log all HTTP requests details)
22+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
23+
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
24+
Examples:
25+
--output json
26+
--output yaml
27+
--output interactive
28+
--output 'id' (to extract a single field)
29+
--output 'nested.field.subfield' (to extract a nested field)
30+
--output '[id, "name"]' (to extract multiple fields as an array)
31+
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
32+
--output 'name+","+type' (to extract and concatenate fields in a string)
33+
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
34+
--profile string Use a specific profile from the configuration file
35+
--region string Region (skip region discovery if set)
36+
```
37+
38+
### SEE ALSO
39+
40+
* [ovhcloud cloud storage-file share acl](ovhcloud_cloud_storage-file_share_acl.md) - Manage share access control lists
41+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## ovhcloud cloud storage-file share acl delete
2+
3+
Delete an ACL from the given share
4+
5+
```
6+
ovhcloud cloud storage-file share acl delete <share_id> <acl_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+
--region string Region (skip region discovery if set)
34+
```
35+
36+
### SEE ALSO
37+
38+
* [ovhcloud cloud storage-file share acl](ovhcloud_cloud_storage-file_share_acl.md) - Manage share access control lists
39+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## ovhcloud cloud storage-file share acl get
2+
3+
Get a specific ACL for the given share
4+
5+
```
6+
ovhcloud cloud storage-file share acl get <share_id> <acl_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+
--region string Region (skip region discovery if set)
34+
```
35+
36+
### SEE ALSO
37+
38+
* [ovhcloud cloud storage-file share acl](ovhcloud_cloud_storage-file_share_acl.md) - Manage share access control lists
39+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## ovhcloud cloud storage-file share acl list
2+
3+
List ACLs for the given share
4+
5+
```
6+
ovhcloud cloud storage-file share acl list <share_id> [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
--filter stringArray Filter results by any property using https://github.com/PaesslerAG/gval syntax
13+
Examples:
14+
--filter 'state="running"'
15+
--filter 'name=~"^my.*"'
16+
--filter 'nested.property.subproperty>10'
17+
--filter 'startDate>="2023-12-01"'
18+
--filter 'name=~"something" && nbField>10'
19+
-h, --help help for list
20+
```
21+
22+
### Options inherited from parent commands
23+
24+
```
25+
--cloud-project string Cloud project ID
26+
-d, --debug Activate debug mode (will log all HTTP requests details)
27+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
28+
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
29+
Examples:
30+
--output json
31+
--output yaml
32+
--output interactive
33+
--output 'id' (to extract a single field)
34+
--output 'nested.field.subfield' (to extract a nested field)
35+
--output '[id, "name"]' (to extract multiple fields as an array)
36+
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
37+
--output 'name+","+type' (to extract and concatenate fields in a string)
38+
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
39+
--profile string Use a specific profile from the configuration file
40+
--region string Region (skip region discovery if set)
41+
```
42+
43+
### SEE ALSO
44+
45+
* [ovhcloud cloud storage-file share acl](ovhcloud_cloud_storage-file_share_acl.md) - Manage share access control lists
46+
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
## ovhcloud cloud storage-file share create
2+
3+
Create a new share
4+
5+
```
6+
ovhcloud cloud storage-file share create <region> [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
--availability-zone string Availability zone (required in 3AZ regions)
13+
--description string Share description
14+
--editor Use a text editor to define parameters
15+
--from-file string File containing parameters
16+
-h, --help help for create
17+
--init-file string Create a file with example parameters
18+
--name string Share name
19+
--network-id string Network ID
20+
--replace Replace parameters file if it already exists
21+
--size int Share size in GB
22+
--snapshot-id string Snapshot ID to create the share from
23+
--subnet-id string Subnet ID
24+
--type string Share type
25+
```
26+
27+
### Options inherited from parent commands
28+
29+
```
30+
--cloud-project string Cloud project ID
31+
-d, --debug Activate debug mode (will log all HTTP requests details)
32+
-e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution
33+
-o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax)
34+
Examples:
35+
--output json
36+
--output yaml
37+
--output interactive
38+
--output 'id' (to extract a single field)
39+
--output 'nested.field.subfield' (to extract a nested field)
40+
--output '[id, "name"]' (to extract multiple fields as an array)
41+
--output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object)
42+
--output 'name+","+type' (to extract and concatenate fields in a string)
43+
--output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields)
44+
--profile string Use a specific profile from the configuration file
45+
--region string Region (skip region discovery if set)
46+
```
47+
48+
### SEE ALSO
49+
50+
* [ovhcloud cloud storage-file share](ovhcloud_cloud_storage-file_share.md) - Manage file storage shares
51+

0 commit comments

Comments
 (0)