diff --git a/doc/ovhcloud_cloud_storage.md b/doc/ovhcloud_cloud_storage.md index 6b050c81..1c3d3f75 100644 --- a/doc/ovhcloud_cloud_storage.md +++ b/doc/ovhcloud_cloud_storage.md @@ -31,7 +31,7 @@ Manage storage services in the given cloud project * [ovhcloud cloud](ovhcloud_cloud.md) - Manage your projects and services in the Public Cloud universe (MKS, MPR, MRS, Object Storage...) * [ovhcloud cloud storage block](ovhcloud_cloud_storage_block.md) - Manage block storage volumes in the given cloud project -* [ovhcloud cloud storage file](ovhcloud_cloud_storage_file.md) - Manage file storage shares in the given cloud project +* [ovhcloud cloud storage file](ovhcloud_cloud_storage_file.md) - Manage file storage in the given cloud project * [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.) * [ovhcloud cloud storage swift](ovhcloud_cloud_storage_swift.md) - Manage SWIFT storage containers in the given cloud project diff --git a/doc/ovhcloud_cloud_storage_file.md b/doc/ovhcloud_cloud_storage_file.md index eb09e4d4..dca9407b 100644 --- a/doc/ovhcloud_cloud_storage_file.md +++ b/doc/ovhcloud_cloud_storage_file.md @@ -1,13 +1,12 @@ ## ovhcloud cloud storage file -Manage file storage shares in the given cloud project +Manage file storage in the given cloud project ### Options ``` --cloud-project string Cloud project ID -h, --help help for file - --region string Region (skip region discovery if set) ``` ### Options inherited from parent commands @@ -32,5 +31,7 @@ Manage file storage shares in the given cloud project ### SEE ALSO * [ovhcloud cloud storage](ovhcloud_cloud_storage.md) - Manage storage services in the given cloud project +* [ovhcloud cloud storage file network](ovhcloud_cloud_storage_file_network.md) - Manage file storage share networks * [ovhcloud cloud storage file share](ovhcloud_cloud_storage_file_share.md) - Manage file storage shares +* [ovhcloud cloud storage file snapshot](ovhcloud_cloud_storage_file_snapshot.md) - Manage file storage snapshots diff --git a/doc/ovhcloud_cloud_storage_file_network.md b/doc/ovhcloud_cloud_storage_file_network.md new file mode 100644 index 00000000..19b13c2f --- /dev/null +++ b/doc/ovhcloud_cloud_storage_file_network.md @@ -0,0 +1,38 @@ +## ovhcloud cloud storage file network + +Manage file storage share networks + +### Options + +``` + -h, --help help for network +``` + +### Options inherited from parent commands + +``` + --cloud-project string Cloud project ID + -d, --debug Activate debug mode (will log all HTTP requests details) + -e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution + -o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax) + Examples: + --output json + --output yaml + --output interactive + --output 'id' (to extract a single field) + --output 'nested.field.subfield' (to extract a nested field) + --output '[id, "name"]' (to extract multiple fields as an array) + --output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object) + --output 'name+","+type' (to extract and concatenate fields in a string) + --output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields) + --profile string Use a specific profile from the configuration file +``` + +### SEE ALSO + +* [ovhcloud cloud storage file](ovhcloud_cloud_storage_file.md) - Manage file storage in the given cloud project +* [ovhcloud cloud storage file network create](ovhcloud_cloud_storage_file_network_create.md) - Create a new file storage share network +* [ovhcloud cloud storage file network delete](ovhcloud_cloud_storage_file_network_delete.md) - Delete the given file storage share network +* [ovhcloud cloud storage file network get](ovhcloud_cloud_storage_file_network_get.md) - Get a specific file storage share network +* [ovhcloud cloud storage file network list](ovhcloud_cloud_storage_file_network_list.md) - List file storage share networks + diff --git a/doc/ovhcloud_cloud_storage_file_network_create.md b/doc/ovhcloud_cloud_storage_file_network_create.md new file mode 100644 index 00000000..123a94ae --- /dev/null +++ b/doc/ovhcloud_cloud_storage_file_network_create.md @@ -0,0 +1,49 @@ +## ovhcloud cloud storage file network create + +Create a new file storage share network + +``` +ovhcloud cloud storage file network create [flags] +``` + +### Options + +``` + --availability-zone string Availability zone within the region + --description string Description of the share network + --editor Use a text editor to define parameters + --from-file string File containing parameters + -h, --help help for create + --init-file string Create a file with example parameters + --name string Name of the share network + --network-id string ID of the private network to back the share network + --region string Region where the share network is created + --replace Replace parameters file if it already exists + --subnet-id string ID of the subnet to back the share network + --wait Wait for the share network to be ready before exiting +``` + +### Options inherited from parent commands + +``` + --cloud-project string Cloud project ID + -d, --debug Activate debug mode (will log all HTTP requests details) + -e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution + -o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax) + Examples: + --output json + --output yaml + --output interactive + --output 'id' (to extract a single field) + --output 'nested.field.subfield' (to extract a nested field) + --output '[id, "name"]' (to extract multiple fields as an array) + --output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object) + --output 'name+","+type' (to extract and concatenate fields in a string) + --output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields) + --profile string Use a specific profile from the configuration file +``` + +### SEE ALSO + +* [ovhcloud cloud storage file network](ovhcloud_cloud_storage_file_network.md) - Manage file storage share networks + diff --git a/doc/ovhcloud_cloud_storage_file_network_delete.md b/doc/ovhcloud_cloud_storage_file_network_delete.md new file mode 100644 index 00000000..5bb4269c --- /dev/null +++ b/doc/ovhcloud_cloud_storage_file_network_delete.md @@ -0,0 +1,38 @@ +## ovhcloud cloud storage file network delete + +Delete the given file storage share network + +``` +ovhcloud cloud storage file network delete [flags] +``` + +### Options + +``` + -h, --help help for delete +``` + +### Options inherited from parent commands + +``` + --cloud-project string Cloud project ID + -d, --debug Activate debug mode (will log all HTTP requests details) + -e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution + -o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax) + Examples: + --output json + --output yaml + --output interactive + --output 'id' (to extract a single field) + --output 'nested.field.subfield' (to extract a nested field) + --output '[id, "name"]' (to extract multiple fields as an array) + --output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object) + --output 'name+","+type' (to extract and concatenate fields in a string) + --output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields) + --profile string Use a specific profile from the configuration file +``` + +### SEE ALSO + +* [ovhcloud cloud storage file network](ovhcloud_cloud_storage_file_network.md) - Manage file storage share networks + diff --git a/doc/ovhcloud_cloud_storage_file_network_get.md b/doc/ovhcloud_cloud_storage_file_network_get.md new file mode 100644 index 00000000..69363934 --- /dev/null +++ b/doc/ovhcloud_cloud_storage_file_network_get.md @@ -0,0 +1,38 @@ +## ovhcloud cloud storage file network get + +Get a specific file storage share network + +``` +ovhcloud cloud storage file network get [flags] +``` + +### Options + +``` + -h, --help help for get +``` + +### Options inherited from parent commands + +``` + --cloud-project string Cloud project ID + -d, --debug Activate debug mode (will log all HTTP requests details) + -e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution + -o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax) + Examples: + --output json + --output yaml + --output interactive + --output 'id' (to extract a single field) + --output 'nested.field.subfield' (to extract a nested field) + --output '[id, "name"]' (to extract multiple fields as an array) + --output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object) + --output 'name+","+type' (to extract and concatenate fields in a string) + --output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields) + --profile string Use a specific profile from the configuration file +``` + +### SEE ALSO + +* [ovhcloud cloud storage file network](ovhcloud_cloud_storage_file_network.md) - Manage file storage share networks + diff --git a/doc/ovhcloud_cloud_storage_file_network_list.md b/doc/ovhcloud_cloud_storage_file_network_list.md new file mode 100644 index 00000000..568583b9 --- /dev/null +++ b/doc/ovhcloud_cloud_storage_file_network_list.md @@ -0,0 +1,45 @@ +## ovhcloud cloud storage file network list + +List file storage share networks + +``` +ovhcloud cloud storage file network list [flags] +``` + +### Options + +``` + --filter stringArray Filter results by any property using https://github.com/PaesslerAG/gval syntax + Examples: + --filter 'state=="running"' + --filter 'name=~"^my.*"' + --filter 'nested.property.subproperty>10' + --filter 'startDate>="2023-12-01"' + --filter 'name=~"something" && nbField>10' + -h, --help help for list +``` + +### Options inherited from parent commands + +``` + --cloud-project string Cloud project ID + -d, --debug Activate debug mode (will log all HTTP requests details) + -e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution + -o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax) + Examples: + --output json + --output yaml + --output interactive + --output 'id' (to extract a single field) + --output 'nested.field.subfield' (to extract a nested field) + --output '[id, "name"]' (to extract multiple fields as an array) + --output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object) + --output 'name+","+type' (to extract and concatenate fields in a string) + --output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields) + --profile string Use a specific profile from the configuration file +``` + +### SEE ALSO + +* [ovhcloud cloud storage file network](ovhcloud_cloud_storage_file_network.md) - Manage file storage share networks + diff --git a/doc/ovhcloud_cloud_storage_file_share.md b/doc/ovhcloud_cloud_storage_file_share.md index aa8cddb9..10fb7d43 100644 --- a/doc/ovhcloud_cloud_storage_file_share.md +++ b/doc/ovhcloud_cloud_storage_file_share.md @@ -26,17 +26,14 @@ Manage file storage shares --output 'name+","+type' (to extract and concatenate fields in a string) --output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields) --profile string Use a specific profile from the configuration file - --region string Region (skip region discovery if set) ``` ### SEE ALSO -* [ovhcloud cloud storage file](ovhcloud_cloud_storage_file.md) - Manage file storage shares in the given cloud project -* [ovhcloud cloud storage file share acl](ovhcloud_cloud_storage_file_share_acl.md) - Manage share access control lists -* [ovhcloud cloud storage file share create](ovhcloud_cloud_storage_file_share_create.md) - Create a new share -* [ovhcloud cloud storage file share delete](ovhcloud_cloud_storage_file_share_delete.md) - Delete the given share -* [ovhcloud cloud storage file share edit](ovhcloud_cloud_storage_file_share_edit.md) - Edit the given share -* [ovhcloud cloud storage file share get](ovhcloud_cloud_storage_file_share_get.md) - Get a specific share -* [ovhcloud cloud storage file share list](ovhcloud_cloud_storage_file_share_list.md) - List shares -* [ovhcloud cloud storage file share snapshot](ovhcloud_cloud_storage_file_share_snapshot.md) - Manage share snapshots +* [ovhcloud cloud storage file](ovhcloud_cloud_storage_file.md) - Manage file storage in the given cloud project +* [ovhcloud cloud storage file share create](ovhcloud_cloud_storage_file_share_create.md) - Create a new file storage share +* [ovhcloud cloud storage file share delete](ovhcloud_cloud_storage_file_share_delete.md) - Delete the given file storage share +* [ovhcloud cloud storage file share edit](ovhcloud_cloud_storage_file_share_edit.md) - Edit the given file storage share +* [ovhcloud cloud storage file share get](ovhcloud_cloud_storage_file_share_get.md) - Get a specific file storage share +* [ovhcloud cloud storage file share list](ovhcloud_cloud_storage_file_share_list.md) - List file storage shares diff --git a/doc/ovhcloud_cloud_storage_file_share_create.md b/doc/ovhcloud_cloud_storage_file_share_create.md index 4b499dac..30a9a3b2 100644 --- a/doc/ovhcloud_cloud_storage_file_share_create.md +++ b/doc/ovhcloud_cloud_storage_file_share_create.md @@ -1,27 +1,28 @@ ## ovhcloud cloud storage file share create -Create a new share +Create a new file storage share ``` -ovhcloud cloud storage file share create [flags] +ovhcloud cloud storage file share create [flags] ``` ### Options ``` - --availability-zone string Availability zone (required in 3AZ regions) - --description string Share description + --availability-zone string Availability zone within the region + --description string Description of the file storage share --editor Use a text editor to define parameters --from-file string File containing parameters -h, --help help for create --init-file string Create a file with example parameters - --name string Share name - --network-id string Network ID + --name string Name of the file storage share + --protocol string File sharing protocol (NFS) + --region string Region where the share is created --replace Replace parameters file if it already exists - --size int Share size in GB - --snapshot-id string Snapshot ID to create the share from - --subnet-id string Subnet ID - --type string Share type + --share-network-id string ID of the share network to attach the share to + --share-type string File storage type / performance tier (STANDARD_1AZ) + --size int Size of the file storage share in GB + --wait Wait for the share to be ready before exiting ``` ### Options inherited from parent commands @@ -42,7 +43,6 @@ ovhcloud cloud storage file share create [flags] --output 'name+","+type' (to extract and concatenate fields in a string) --output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields) --profile string Use a specific profile from the configuration file - --region string Region (skip region discovery if set) ``` ### SEE ALSO diff --git a/doc/ovhcloud_cloud_storage_file_share_delete.md b/doc/ovhcloud_cloud_storage_file_share_delete.md index 064f73dc..e9faebcd 100644 --- a/doc/ovhcloud_cloud_storage_file_share_delete.md +++ b/doc/ovhcloud_cloud_storage_file_share_delete.md @@ -1,6 +1,6 @@ ## ovhcloud cloud storage file share delete -Delete the given share +Delete the given file storage share ``` ovhcloud cloud storage file share delete [flags] @@ -30,7 +30,6 @@ ovhcloud cloud storage file share delete [flags] --output 'name+","+type' (to extract and concatenate fields in a string) --output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields) --profile string Use a specific profile from the configuration file - --region string Region (skip region discovery if set) ``` ### SEE ALSO diff --git a/doc/ovhcloud_cloud_storage_file_share_edit.md b/doc/ovhcloud_cloud_storage_file_share_edit.md index 085eec56..5c134cdf 100644 --- a/doc/ovhcloud_cloud_storage_file_share_edit.md +++ b/doc/ovhcloud_cloud_storage_file_share_edit.md @@ -1,6 +1,6 @@ ## ovhcloud cloud storage file share edit -Edit the given share +Edit the given file storage share ``` ovhcloud cloud storage file share edit [flags] @@ -9,11 +9,12 @@ ovhcloud cloud storage file share edit [flags] ### Options ``` - --description string Share description + --description string Description of the file storage share --editor Use a text editor to define parameters + --from-file string File containing parameters -h, --help help for edit - --name string Share name - --new-size int New share size in GB + --name string Name of the file storage share + --size int New size of the file storage share in GB ``` ### Options inherited from parent commands @@ -34,7 +35,6 @@ ovhcloud cloud storage file share edit [flags] --output 'name+","+type' (to extract and concatenate fields in a string) --output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields) --profile string Use a specific profile from the configuration file - --region string Region (skip region discovery if set) ``` ### SEE ALSO diff --git a/doc/ovhcloud_cloud_storage_file_share_get.md b/doc/ovhcloud_cloud_storage_file_share_get.md index be1bbf9a..a6429d70 100644 --- a/doc/ovhcloud_cloud_storage_file_share_get.md +++ b/doc/ovhcloud_cloud_storage_file_share_get.md @@ -1,6 +1,6 @@ ## ovhcloud cloud storage file share get -Get a specific share +Get a specific file storage share ``` ovhcloud cloud storage file share get [flags] @@ -30,7 +30,6 @@ ovhcloud cloud storage file share get [flags] --output 'name+","+type' (to extract and concatenate fields in a string) --output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields) --profile string Use a specific profile from the configuration file - --region string Region (skip region discovery if set) ``` ### SEE ALSO diff --git a/doc/ovhcloud_cloud_storage_file_share_list.md b/doc/ovhcloud_cloud_storage_file_share_list.md index 8dad6874..354abcb2 100644 --- a/doc/ovhcloud_cloud_storage_file_share_list.md +++ b/doc/ovhcloud_cloud_storage_file_share_list.md @@ -1,6 +1,6 @@ ## ovhcloud cloud storage file share list -List shares +List file storage shares ``` ovhcloud cloud storage file share list [flags] @@ -37,7 +37,6 @@ ovhcloud cloud storage file share list [flags] --output 'name+","+type' (to extract and concatenate fields in a string) --output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields) --profile string Use a specific profile from the configuration file - --region string Region (skip region discovery if set) ``` ### SEE ALSO diff --git a/doc/ovhcloud_cloud_storage_file_snapshot.md b/doc/ovhcloud_cloud_storage_file_snapshot.md new file mode 100644 index 00000000..f20f5084 --- /dev/null +++ b/doc/ovhcloud_cloud_storage_file_snapshot.md @@ -0,0 +1,39 @@ +## ovhcloud cloud storage file snapshot + +Manage file storage snapshots + +### Options + +``` + -h, --help help for snapshot +``` + +### Options inherited from parent commands + +``` + --cloud-project string Cloud project ID + -d, --debug Activate debug mode (will log all HTTP requests details) + -e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution + -o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax) + Examples: + --output json + --output yaml + --output interactive + --output 'id' (to extract a single field) + --output 'nested.field.subfield' (to extract a nested field) + --output '[id, "name"]' (to extract multiple fields as an array) + --output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object) + --output 'name+","+type' (to extract and concatenate fields in a string) + --output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields) + --profile string Use a specific profile from the configuration file +``` + +### SEE ALSO + +* [ovhcloud cloud storage file](ovhcloud_cloud_storage_file.md) - Manage file storage in the given cloud project +* [ovhcloud cloud storage file snapshot create](ovhcloud_cloud_storage_file_snapshot_create.md) - Create a new file storage snapshot +* [ovhcloud cloud storage file snapshot delete](ovhcloud_cloud_storage_file_snapshot_delete.md) - Delete the given file storage snapshot +* [ovhcloud cloud storage file snapshot edit](ovhcloud_cloud_storage_file_snapshot_edit.md) - Edit the given file storage snapshot +* [ovhcloud cloud storage file snapshot get](ovhcloud_cloud_storage_file_snapshot_get.md) - Get a specific file storage snapshot +* [ovhcloud cloud storage file snapshot list](ovhcloud_cloud_storage_file_snapshot_list.md) - List file storage snapshots + diff --git a/doc/ovhcloud_cloud_storage_file_snapshot_create.md b/doc/ovhcloud_cloud_storage_file_snapshot_create.md new file mode 100644 index 00000000..94f5f0c5 --- /dev/null +++ b/doc/ovhcloud_cloud_storage_file_snapshot_create.md @@ -0,0 +1,42 @@ +## ovhcloud cloud storage file snapshot create + +Create a new file storage snapshot + +``` +ovhcloud cloud storage file snapshot create [flags] +``` + +### Options + +``` + --description string Description of the snapshot + -h, --help help for create + --name string Name of the snapshot + --share-id string ID of the file storage share to snapshot + --wait Wait for the snapshot to be ready before exiting +``` + +### Options inherited from parent commands + +``` + --cloud-project string Cloud project ID + -d, --debug Activate debug mode (will log all HTTP requests details) + -e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution + -o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax) + Examples: + --output json + --output yaml + --output interactive + --output 'id' (to extract a single field) + --output 'nested.field.subfield' (to extract a nested field) + --output '[id, "name"]' (to extract multiple fields as an array) + --output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object) + --output 'name+","+type' (to extract and concatenate fields in a string) + --output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields) + --profile string Use a specific profile from the configuration file +``` + +### SEE ALSO + +* [ovhcloud cloud storage file snapshot](ovhcloud_cloud_storage_file_snapshot.md) - Manage file storage snapshots + diff --git a/doc/ovhcloud_cloud_storage_file_snapshot_delete.md b/doc/ovhcloud_cloud_storage_file_snapshot_delete.md new file mode 100644 index 00000000..48e3855a --- /dev/null +++ b/doc/ovhcloud_cloud_storage_file_snapshot_delete.md @@ -0,0 +1,38 @@ +## ovhcloud cloud storage file snapshot delete + +Delete the given file storage snapshot + +``` +ovhcloud cloud storage file snapshot delete [flags] +``` + +### Options + +``` + -h, --help help for delete +``` + +### Options inherited from parent commands + +``` + --cloud-project string Cloud project ID + -d, --debug Activate debug mode (will log all HTTP requests details) + -e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution + -o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax) + Examples: + --output json + --output yaml + --output interactive + --output 'id' (to extract a single field) + --output 'nested.field.subfield' (to extract a nested field) + --output '[id, "name"]' (to extract multiple fields as an array) + --output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object) + --output 'name+","+type' (to extract and concatenate fields in a string) + --output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields) + --profile string Use a specific profile from the configuration file +``` + +### SEE ALSO + +* [ovhcloud cloud storage file snapshot](ovhcloud_cloud_storage_file_snapshot.md) - Manage file storage snapshots + diff --git a/doc/ovhcloud_cloud_storage_file_snapshot_edit.md b/doc/ovhcloud_cloud_storage_file_snapshot_edit.md new file mode 100644 index 00000000..2c1d6750 --- /dev/null +++ b/doc/ovhcloud_cloud_storage_file_snapshot_edit.md @@ -0,0 +1,41 @@ +## ovhcloud cloud storage file snapshot edit + +Edit the given file storage snapshot + +``` +ovhcloud cloud storage file snapshot edit [flags] +``` + +### Options + +``` + --description string Description of the snapshot + --editor Use a text editor to define parameters + -h, --help help for edit + --name string Name of the snapshot +``` + +### Options inherited from parent commands + +``` + --cloud-project string Cloud project ID + -d, --debug Activate debug mode (will log all HTTP requests details) + -e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution + -o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax) + Examples: + --output json + --output yaml + --output interactive + --output 'id' (to extract a single field) + --output 'nested.field.subfield' (to extract a nested field) + --output '[id, "name"]' (to extract multiple fields as an array) + --output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object) + --output 'name+","+type' (to extract and concatenate fields in a string) + --output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields) + --profile string Use a specific profile from the configuration file +``` + +### SEE ALSO + +* [ovhcloud cloud storage file snapshot](ovhcloud_cloud_storage_file_snapshot.md) - Manage file storage snapshots + diff --git a/doc/ovhcloud_cloud_storage_file_snapshot_get.md b/doc/ovhcloud_cloud_storage_file_snapshot_get.md new file mode 100644 index 00000000..a6cb5cbe --- /dev/null +++ b/doc/ovhcloud_cloud_storage_file_snapshot_get.md @@ -0,0 +1,38 @@ +## ovhcloud cloud storage file snapshot get + +Get a specific file storage snapshot + +``` +ovhcloud cloud storage file snapshot get [flags] +``` + +### Options + +``` + -h, --help help for get +``` + +### Options inherited from parent commands + +``` + --cloud-project string Cloud project ID + -d, --debug Activate debug mode (will log all HTTP requests details) + -e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution + -o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax) + Examples: + --output json + --output yaml + --output interactive + --output 'id' (to extract a single field) + --output 'nested.field.subfield' (to extract a nested field) + --output '[id, "name"]' (to extract multiple fields as an array) + --output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object) + --output 'name+","+type' (to extract and concatenate fields in a string) + --output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields) + --profile string Use a specific profile from the configuration file +``` + +### SEE ALSO + +* [ovhcloud cloud storage file snapshot](ovhcloud_cloud_storage_file_snapshot.md) - Manage file storage snapshots + diff --git a/doc/ovhcloud_cloud_storage_file_snapshot_list.md b/doc/ovhcloud_cloud_storage_file_snapshot_list.md new file mode 100644 index 00000000..a399f91f --- /dev/null +++ b/doc/ovhcloud_cloud_storage_file_snapshot_list.md @@ -0,0 +1,45 @@ +## ovhcloud cloud storage file snapshot list + +List file storage snapshots + +``` +ovhcloud cloud storage file snapshot list [flags] +``` + +### Options + +``` + --filter stringArray Filter results by any property using https://github.com/PaesslerAG/gval syntax + Examples: + --filter 'state=="running"' + --filter 'name=~"^my.*"' + --filter 'nested.property.subproperty>10' + --filter 'startDate>="2023-12-01"' + --filter 'name=~"something" && nbField>10' + -h, --help help for list +``` + +### Options inherited from parent commands + +``` + --cloud-project string Cloud project ID + -d, --debug Activate debug mode (will log all HTTP requests details) + -e, --ignore-errors Ignore errors in API calls when it is not fatal to the execution + -o, --output string Output format: json, yaml, interactive, or a custom format expression (using https://github.com/PaesslerAG/gval syntax) + Examples: + --output json + --output yaml + --output interactive + --output 'id' (to extract a single field) + --output 'nested.field.subfield' (to extract a nested field) + --output '[id, "name"]' (to extract multiple fields as an array) + --output '{"newKey": oldKey, "otherKey": nested.field}' (to extract and rename fields in an object) + --output 'name+","+type' (to extract and concatenate fields in a string) + --output '(nbFieldA + nbFieldB) * 10' (to compute values from numeric fields) + --profile string Use a specific profile from the configuration file +``` + +### SEE ALSO + +* [ovhcloud cloud storage file snapshot](ovhcloud_cloud_storage_file_snapshot.md) - Manage file storage snapshots + diff --git a/internal/assets/api-schemas/cloud_v2.json b/internal/assets/api-schemas/cloud_v2.json index d643950f..f9c981f8 100644 --- a/internal/assets/api-schemas/cloud_v2.json +++ b/internal/assets/api-schemas/cloud_v2.json @@ -2169,32 +2169,2573 @@ "preventAutomaticQuotaUpgrade", "regions" ] + }, + "publicCloud.storage.file.FileStorageAccessRule": { + "type": "object", + "description": "An access rule controlling which IP addresses can access a file storage", + "properties": { + "accessLevel": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageAccessLevelEnum" + } + ], + "description": "Access level granted (read-write or read-only)", + "readOnly": true + }, + "accessTo": { + "type": "string", + "description": "IP address or CIDR allowed to access the file storage", + "readOnly": true + }, + "createdAt": { + "type": "string", + "description": "Creation date of the access rule", + "nullable": true, + "format": "date-time", + "readOnly": true + }, + "id": { + "type": "string", + "description": "Unique identifier of the access rule", + "format": "uuid", + "readOnly": true + }, + "state": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageAccessRuleStateEnum" + } + ], + "description": "Current state of the access rule", + "readOnly": true + } + } + }, + "publicCloud.storage.file.FileStorageUpdate": { + "type": "object", + "description": "Payload to update a Public Cloud file storage", + "properties": { + "checksum": { + "type": "string", + "description": "Computed hash controlling concurrent modifications; represents the current target specification value" + }, + "targetSpec": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageUpdateTargetSpec" + } + ], + "description": "Desired target specification for the file storage" + } + }, + "required": [ + "checksum", + "targetSpec" + ] + }, + "publicCloud.storage.file.FileStorageAccessRuleInput": { + "type": "object", + "description": "Input for an access rule controlling which IP addresses can access a file storage", + "properties": { + "accessLevel": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageAccessLevelEnum" + } + ], + "description": "Access level granted (read-write or read-only)" + }, + "accessTo": { + "type": "string", + "description": "IP address or CIDR allowed to access the file storage" + } + }, + "required": [ + "accessLevel", + "accessTo" + ] + }, + "publicCloud.storage.file.FileStorage": { + "type": "object", + "description": "A Public Cloud file storage (NFS share)", + "properties": { + "checksum": { + "type": "string", + "description": "Computed hash representing the current target specification value", + "readOnly": true + }, + "createdAt": { + "type": "string", + "description": "Creation date of the file storage", + "format": "date-time", + "readOnly": true + }, + "currentState": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageCurrentState" + } + ], + "description": "Current observed state of the file storage from the infrastructure", + "nullable": true, + "readOnly": true + }, + "currentTasks": { + "type": "array", + "description": "Ongoing asynchronous tasks related to the file storage", + "nullable": true, + "items": { + "$ref": "#/components/schemas/common.CurrentTask" + }, + "readOnly": true + }, + "id": { + "type": "string", + "description": "Unique identifier of the file storage", + "format": "uuid", + "readOnly": true + }, + "resourceStatus": { + "allOf": [ + { + "$ref": "#/components/schemas/common.ResourceStatusEnum" + } + ], + "description": "File storage readiness in the system", + "readOnly": true + }, + "targetSpec": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageTargetSpec" + } + ], + "description": "Last target specification of the file storage", + "readOnly": true + }, + "updatedAt": { + "type": "string", + "description": "Last update date of the file storage", + "format": "date-time", + "readOnly": true + } + } + }, + "publicCloud.storage.file.FileStorageNetworkNetwork": { + "type": "object", + "description": "The Neutron network backing a share network", + "properties": { + "id": { + "type": "string", + "description": "Identifier of the Neutron network", + "format": "uuid", + "readOnly": true + } + } + }, + "publicCloud.storage.file.FileStorageCurrentState": { + "type": "object", + "description": "Current state of a file storage as observed from the infrastructure", + "properties": { + "accessRules": { + "type": "array", + "description": "Current access rules on the file storage", + "nullable": true, + "items": { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageAccessRule" + }, + "readOnly": true + }, + "capabilities": { + "type": "array", + "description": "Action availability flags derived from the file storage status", + "nullable": true, + "items": { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageCapability" + }, + "readOnly": true + }, + "description": { + "type": "string", + "description": "File storage description", + "nullable": true, + "readOnly": true + }, + "exportLocations": { + "type": "array", + "description": "NFS export paths for mounting the file storage", + "nullable": true, + "items": { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageExportLocation" + }, + "readOnly": true + }, + "location": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.common.Location" + } + ], + "description": "Current resource location", + "readOnly": true + }, + "name": { + "type": "string", + "description": "Current file storage name", + "readOnly": true + }, + "protocol": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageProtocolEnum" + } + ], + "description": "File sharing protocol", + "readOnly": true + }, + "shareNetwork": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageShareNetworkRef" + } + ], + "description": "Reference to the share network the file storage is attached to", + "readOnly": true + }, + "shareType": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageTypeEnum" + } + ], + "description": "File storage type (performance tier)", + "readOnly": true + }, + "size": { + "type": "integer", + "description": "Current size of the file storage in GB", + "readOnly": true + } + } + }, + "publicCloud.storage.file.FileStorageNetworkNetworkRef": { + "type": "object", + "description": "Reference to the Neutron network backing a share network", + "properties": { + "id": { + "type": "string", + "description": "Identifier of the Neutron network", + "format": "uuid" + } + }, + "required": [ + "id" + ] + }, + "publicCloud.storage.file.FileStorageNetworkCreation": { + "type": "object", + "description": "Payload to create a Public Cloud file storage share network", + "properties": { + "targetSpec": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageNetworkTargetSpec" + } + ], + "description": "Desired target specification for the share network" + } + }, + "required": [ + "targetSpec" + ] + }, + "publicCloud.storage.file.FileStorageSnapshotShareRef": { + "type": "object", + "description": "Reference to the parent file storage share of the snapshot", + "properties": { + "id": { + "type": "string", + "description": "Identifier of the parent file storage share", + "format": "uuid" + } + }, + "required": [ + "id" + ] + }, + "publicCloud.storage.file.FileStorageSnapshotCreation": { + "type": "object", + "description": "Payload to create a Public Cloud file storage snapshot", + "properties": { + "targetSpec": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageSnapshotTargetSpec" + } + ], + "description": "Desired target specification for the snapshot" + } + }, + "required": [ + "targetSpec" + ] + }, + "publicCloud.storage.file.FileStorageSnapshotUpdate": { + "type": "object", + "description": "Payload to update a Public Cloud file storage snapshot", + "properties": { + "checksum": { + "type": "string", + "description": "Computed hash controlling concurrent modifications; represents the current target specification value" + }, + "targetSpec": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageSnapshotUpdateTargetSpec" + } + ], + "description": "Desired target specification for the snapshot" + } + }, + "required": [ + "checksum", + "targetSpec" + ] + }, + "publicCloud.storage.file.FileStorageUpdateTargetSpec": { + "type": "object", + "description": "Target specification for updating a file storage (immutable fields like protocol, shareType, networkId, subnetId are excluded)", + "properties": { + "accessRules": { + "type": "array", + "description": "Access rules controlling which IPs can access the file storage (replaces all existing rules)", + "nullable": true, + "items": { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageAccessRuleInput" + } + }, + "description": { + "type": "string", + "description": "Description of the file storage", + "nullable": true + }, + "name": { + "type": "string", + "description": "Desired file storage name" + }, + "size": { + "type": "integer", + "description": "Size of the file storage in GB. The size can only be increased (extend); shrinking a file storage is not supported" + } + }, + "required": [ + "name", + "size" + ] + }, + "publicCloud.storage.file.FileStorageCapabilityEnum": { + "type": "string", + "description": "Action availability flags computed from the file storage status", + "enum": [ + "ACL_MANAGEMENT", + "DELETE", + "EDIT", + "REVERT_FROM_SNAPSHOT", + "SNAPSHOT_MANAGEMENT", + "UPDATE_SIZE" + ] + }, + "publicCloud.storage.file.FileStorageCapability": { + "type": "object", + "description": "An action availability flag for a file storage, derived from its current status", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether the action is currently available on the file storage", + "readOnly": true + }, + "name": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageCapabilityEnum" + } + ], + "description": "The action the flag refers to", + "readOnly": true + }, + "reason": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageCapabilityReasonEnum" + } + ], + "description": "Why the action is unavailable; set only when enabled is false", + "nullable": true, + "readOnly": true + } + } + }, + "publicCloud.storage.file.FileStorageProtocolEnum": { + "type": "string", + "description": "Supported file sharing protocols", + "enum": [ + "NFS" + ] + }, + "publicCloud.storage.file.FileStorageNetwork": { + "type": "object", + "description": "A Public Cloud file storage share network", + "properties": { + "checksum": { + "type": "string", + "description": "Computed hash representing the current target specification value", + "readOnly": true + }, + "createdAt": { + "type": "string", + "description": "Creation date of the share network", + "format": "date-time", + "readOnly": true + }, + "currentState": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageNetworkCurrentState" + } + ], + "description": "Current observed state of the share network from the infrastructure", + "nullable": true, + "readOnly": true + }, + "currentTasks": { + "type": "array", + "description": "Ongoing asynchronous tasks related to the share network", + "nullable": true, + "items": { + "$ref": "#/components/schemas/common.CurrentTask" + }, + "readOnly": true + }, + "id": { + "type": "string", + "description": "Unique identifier of the share network", + "format": "uuid", + "readOnly": true + }, + "resourceStatus": { + "allOf": [ + { + "$ref": "#/components/schemas/common.ResourceStatusEnum" + } + ], + "description": "Share network readiness in the system", + "readOnly": true + }, + "targetSpec": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageNetworkReadTargetSpec" + } + ], + "description": "Last target specification of the share network", + "readOnly": true + }, + "updatedAt": { + "type": "string", + "description": "Last update date of the share network", + "format": "date-time", + "readOnly": true + } + } + }, + "publicCloud.storage.file.FileStorageNetworkReadTargetSpec": { + "type": "object", + "description": "Target specification for a file storage share network as returned on read", + "properties": { + "description": { + "type": "string", + "description": "Description of the share network", + "nullable": true, + "readOnly": true + }, + "location": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.common.Location" + } + ], + "description": "Desired resource location", + "readOnly": true + }, + "name": { + "type": "string", + "description": "Desired share network name", + "readOnly": true + }, + "network": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageNetworkNetwork" + } + ], + "description": "Reference to the Neutron network to back the share network", + "nullable": true, + "readOnly": true + }, + "subnet": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageNetworkSubnet" + } + ], + "description": "Reference to the Neutron subnet to back the share network", + "nullable": true, + "readOnly": true + } + } + }, + "publicCloud.storage.file.FileStorageTargetSpec": { + "type": "object", + "description": "Target specification for a file storage", + "properties": { + "accessRules": { + "type": "array", + "description": "Access rules controlling which IPs can access the file storage", + "nullable": true, + "items": { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageAccessRuleInput" + } + }, + "description": { + "type": "string", + "description": "Description of the file storage", + "nullable": true + }, + "location": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.common.Location" + } + ], + "description": "Desired resource location" + }, + "name": { + "type": "string", + "description": "Desired file storage name" + }, + "protocol": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageProtocolEnum" + } + ], + "description": "File sharing protocol" + }, + "shareNetwork": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageShareNetworkRef" + } + ], + "description": "Reference to a pre-existing share network to attach the file storage to" + }, + "shareType": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageTypeEnum" + } + ], + "description": "File storage type (performance tier)" + }, + "size": { + "type": "integer", + "description": "Size of the file storage in GB" + } + }, + "required": [ + "location", + "name", + "protocol", + "shareNetwork", + "shareType", + "size" + ] + }, + "publicCloud.storage.file.FileStorageShareNetworkRef": { + "type": "object", + "description": "Reference to a pre-existing file storage share network", + "properties": { + "id": { + "type": "string", + "description": "Identifier of the share network to attach the file storage to", + "format": "uuid" + } + }, + "required": [ + "id" + ] + }, + "publicCloud.storage.file.FileStorageCapabilityReasonEnum": { + "type": "string", + "description": "Reason a file storage action is currently disabled", + "enum": [ + "HAS_DEPENDENT_SNAPSHOTS", + "INVALID_STATUS" + ] + }, + "publicCloud.storage.file.FileStorageNetworkTargetSpec": { + "type": "object", + "description": "Target specification for a file storage share network", + "properties": { + "description": { + "type": "string", + "description": "Description of the share network", + "nullable": true + }, + "location": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.common.Location" + } + ], + "description": "Desired resource location" + }, + "name": { + "type": "string", + "description": "Desired share network name" + }, + "network": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageNetworkNetworkRef" + } + ], + "description": "Reference to the Neutron network to back the share network" + }, + "subnet": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageNetworkSubnetRef" + } + ], + "description": "Reference to the Neutron subnet to back the share network" + } + }, + "required": [ + "location", + "name", + "network", + "subnet" + ] + }, + "publicCloud.storage.file.FileStorageAccessRuleStateEnum": { + "type": "string", + "description": "Possible states for a file storage access rule", + "enum": [ + "ACTIVE", + "APPLYING", + "DENYING", + "ERROR" + ] + }, + "publicCloud.storage.file.FileStorageNetworkSubnetRef": { + "type": "object", + "description": "Reference to the Neutron subnet backing a share network", + "properties": { + "id": { + "type": "string", + "description": "Identifier of the Neutron subnet", + "format": "uuid" + } + }, + "required": [ + "id" + ] + }, + "publicCloud.storage.file.FileStorageCreation": { + "type": "object", + "description": "Payload to create a Public Cloud file storage", + "properties": { + "targetSpec": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageTargetSpec" + } + ], + "description": "Desired target specification for the file storage" + } + }, + "required": [ + "targetSpec" + ] + }, + "publicCloud.storage.file.FileStorageAccessLevelEnum": { + "type": "string", + "description": "Access levels for file storage access rules", + "enum": [ + "READ_ONLY", + "READ_WRITE" + ] + }, + "publicCloud.storage.file.FileStorageTypeEnum": { + "type": "string", + "description": "Supported file storage types (performance tiers)", + "enum": [ + "STANDARD_1AZ" + ] + }, + "publicCloud.storage.file.FileStorageSnapshotUpdateTargetSpec": { + "type": "object", + "description": "Target specification for updating a file storage snapshot (only name and description are mutable)", + "properties": { + "description": { + "type": "string", + "description": "Description of the snapshot", + "nullable": true + }, + "name": { + "type": "string", + "description": "Desired snapshot name", + "nullable": true + } + } + }, + "publicCloud.storage.file.FileStorageSnapshotTargetSpec": { + "type": "object", + "description": "Target specification for a file storage snapshot", + "properties": { + "description": { + "type": "string", + "description": "Description of the snapshot", + "nullable": true + }, + "name": { + "type": "string", + "description": "Desired snapshot name", + "nullable": true + }, + "share": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageSnapshotShareRef" + } + ], + "description": "Reference to the parent file storage share to snapshot" + } + }, + "required": [ + "share" + ] + }, + "publicCloud.storage.file.FileStorageExportLocation": { + "type": "object", + "description": "An NFS export path for a file storage", + "properties": { + "path": { + "type": "string", + "description": "NFS export path for mounting", + "readOnly": true + }, + "preferred": { + "type": "boolean", + "description": "Whether this is the preferred export location", + "readOnly": true + } + } + }, + "publicCloud.storage.file.FileStorageNetworkCurrentState": { + "type": "object", + "description": "Current state of a file storage share network as observed from the infrastructure", + "properties": { + "description": { + "type": "string", + "description": "Share network description", + "nullable": true, + "readOnly": true + }, + "location": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.common.Location" + } + ], + "description": "Current resource location", + "readOnly": true + }, + "name": { + "type": "string", + "description": "Current share network name", + "readOnly": true + }, + "network": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageNetworkNetwork" + } + ], + "description": "The Neutron network backing the share network", + "nullable": true, + "readOnly": true + }, + "subnet": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageNetworkSubnet" + } + ], + "description": "The Neutron subnet backing the share network", + "nullable": true, + "readOnly": true + } + } + }, + "publicCloud.storage.file.FileStorageSnapshotCurrentState": { + "type": "object", + "description": "Current state of a file storage snapshot as observed from the infrastructure", + "properties": { + "description": { + "type": "string", + "description": "Snapshot description", + "nullable": true, + "readOnly": true + }, + "location": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.common.Location" + } + ], + "description": "Current resource location", + "readOnly": true + }, + "name": { + "type": "string", + "description": "Current snapshot name", + "nullable": true, + "readOnly": true + }, + "share": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageSnapshotShareRef" + } + ], + "description": "Reference to the parent file storage share of the snapshot", + "readOnly": true + }, + "size": { + "type": "integer", + "description": "Size of the snapshot in GB", + "readOnly": true + } + } + }, + "publicCloud.storage.file.FileStorageSnapshot": { + "type": "object", + "description": "A snapshot of a Public Cloud file storage (NFS share)", + "properties": { + "checksum": { + "type": "string", + "description": "Computed hash representing the current target specification value", + "readOnly": true + }, + "createdAt": { + "type": "string", + "description": "Creation date of the snapshot", + "format": "date-time", + "readOnly": true + }, + "currentState": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageSnapshotCurrentState" + } + ], + "description": "Current observed state of the snapshot from the infrastructure", + "nullable": true, + "readOnly": true + }, + "currentTasks": { + "type": "array", + "description": "Ongoing asynchronous tasks related to the snapshot", + "nullable": true, + "items": { + "$ref": "#/components/schemas/common.CurrentTask" + }, + "readOnly": true + }, + "id": { + "type": "string", + "description": "Unique identifier of the snapshot", + "format": "uuid", + "readOnly": true + }, + "resourceStatus": { + "allOf": [ + { + "$ref": "#/components/schemas/common.ResourceStatusEnum" + } + ], + "description": "Snapshot readiness in the system", + "readOnly": true + }, + "targetSpec": { + "allOf": [ + { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageSnapshotTargetSpec" + } + ], + "description": "Last target specification of the snapshot", + "readOnly": true + }, + "updatedAt": { + "type": "string", + "description": "Last update date of the snapshot", + "format": "date-time", + "readOnly": true + } + } + }, + "publicCloud.storage.file.FileStorageNetworkSubnet": { + "type": "object", + "description": "The Neutron subnet backing a share network", + "properties": { + "id": { + "type": "string", + "description": "Identifier of the Neutron subnet", + "format": "uuid", + "readOnly": true + } + } + } + }, + "securitySchemes": { + "oAuth2AuthCode": { + "type": "oauth2", + "description": "Oauth2", + "x-client-id": "1bb9c7df371741c0", + "x-client-secret": "a5b4de870aca620d10fbf63cd18d205b", + "flows": { + "authorizationCode": { + "authorizationUrl": "https://www.ovh.com/auth/oauth2/authorize", + "tokenUrl": "https://www.ovh.com/auth/oauth2/token", + "scopes": { + "account/all": "Manage your account", + "all": "Manage your whole account and all your services", + "services/all": "Manage your services lifecycle and billing" + } + } + } + } + } + }, + "paths": { + "/publicCloud/project": { + "get": { + "summary": "List all Public Cloud projects", + "security": [ + { + "oAuth2AuthCode": [] + } + ], + "parameters": [ + { + "in": "header", + "name": "X-Pagination-Cursor", + "description": "Pagination cursor", + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "X-Pagination-Size", + "description": "Pagination size", + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "iamTags", + "description": "Filter resources on IAM tags", + "schema": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "$ref": "#/components/schemas/iam.resource.TagFilter" + } + } + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/publicCloud.project.ProjectAsyncWithIAM" + } + } + } + } + } + }, + "x-badges": [ + { + "color": "green", + "label": "Stable production version" + } + ], + "x-iam-actions": [ + { + "name": "publicCloudProject:apiovh:get", + "required": true + } + ], + "x-expanded-response": "PublicCloudProjectProjectAsyncWithIAM" + } + }, + "/publicCloud/project/{projectId}": { + "get": { + "summary": "Get details on a Public Cloud project", + "security": [ + { + "oAuth2AuthCode": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "projectId", + "description": "Project ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicCloud.project.ProjectAsyncWithIAM" + } + } + } + } + }, + "x-badges": [ + { + "color": "green", + "label": "Stable production version" + } + ], + "x-iam-actions": [ + { + "name": "publicCloudProject:apiovh:get", + "required": true + } + ] + } + }, + "/publicCloud/project/{projectId}/rancher": { + "get": { + "summary": "List managed Rancher services", + "security": [ + { + "oAuth2AuthCode": [] + } + ], + "parameters": [ + { + "in": "header", + "name": "X-Pagination-Cursor", + "description": "Pagination cursor", + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "X-Pagination-Size", + "description": "Pagination size", + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "projectId", + "description": "Project ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/publicCloud.rancher.Rancher" + } + }, + "examples": { + "Example": { + "value": [ + { + "createdAt": "2020-12-31T07:39:19Z", + "currentState": { + "iamAuthEnabled": false, + "ipRestrictions": [ + { + "cidrBlock": "198.51.100.1/32", + "description": "My IP restriction" + } + ], + "name": "my_rancher", + "networking": { + "egressCidrBlocks": [ + "203.0.113.0/24" + ] + }, + "plan": "OVHCLOUD_EDITION", + "region": "EU_WEST_RBX", + "url": "https://aaaaaa.bbbb.rancher.ovhcloud.example", + "usage": { + "datetime": "2020-12-31T13:00:00Z", + "orchestratedVcpus": 16 + }, + "version": "1.0.0" + }, + "currentTasks": [], + "id": "d6b6579e-8d60-4487-bf08-8b4ddf98f7d3", + "resourceStatus": "READY", + "targetSpec": { + "iamAuthEnabled": false, + "ipRestrictions": [ + { + "cidrBlock": "198.51.100.1/32", + "description": "My IP restriction" + } + ], + "name": "my_rancher", + "plan": "OVHCLOUD_EDITION", + "version": "1.0.0" + }, + "updatedAt": "2020-12-31T07:39:19Z" + }, + { + "createdAt": "2020-12-31T13:37:46Z", + "currentState": { + "iamAuthEnabled": false, + "ipRestrictions": [], + "name": "rancher2", + "plan": "STANDARD", + "region": "EU_WEST_RBX", + "url": "https://cccccc.bbbb.rancher.ovhcloud.example", + "version": "1.0.0" + }, + "currentTasks": [ + { + "id": "30017036-ddb2-40a8-ad56-6d765b059aab", + "link": "/v2/publicCloud/project/a755273a123456788da6d6fcc71a95f3/rancher/222ce105-a3f7-44c4-a7d3-dbb5983c045d/task/30017036-ddb2-40a8-ad56-6d765b059aab", + "type": "RANCHER_UPDATE" + } + ], + "id": "222ce105-a3f7-44c4-a7d3-dbb5983c045d", + "resourceStatus": "UPDATING", + "targetSpec": { + "iamAuthEnabled": false, + "ipRestrictions": [], + "name": "rancher2", + "plan": "STANDARD", + "version": "1.1.0" + }, + "updatedAt": "2020-12-31T13:40:46Z" + } + ], + "summary": "Example" + } + } + } + } + }, + "500": { + "description": "Error 500 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "examples": { + "Server::InternalServerError::Maintenance": { + "value": { + "class": "Server::InternalServerError::Maintenance", + "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." + } + } + } + } + } + } + }, + "tags": [ + "Rancher" + ], + "x-badges": [ + { + "color": "green", + "label": "Stable production version" + } + ], + "x-iam-actions": [ + { + "name": "publicCloudProject:apiovh:rancher/get", + "required": true + } + ], + "x-response-identifier": "id", + "x-expanded-response": "PublicCloudRancherRancher" + }, + "post": { + "summary": "Create a new managed Rancher service", + "security": [ + { + "oAuth2AuthCode": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "projectId", + "description": "Project ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicCloud.rancher.RancherCreation" + }, + "examples": { + "Create a STANDARD managed Rancher on the latest version": { + "value": { + "targetSpec": { + "iamAuthEnabled": false, + "name": "my_rancher", + "plan": "STANDARD" + } + }, + "summary": "Request body for creating a managed Rancher on plan STANDARD" + }, + "Create an OVHCLOUD_EDITION managed Rancher on a specific version": { + "value": { + "targetSpec": { + "iamAuthEnabled": false, + "name": "my_rancher", + "plan": "OVHCLOUD_EDITION", + "version": "1.0.0" + } + }, + "summary": "Request body for creating a managed Rancher on plan OVHCLOUD_EDITION with a specific version" + } + } + } + } + }, + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicCloud.rancher.Rancher" + }, + "examples": { + "Example": { + "value": { + "createdAt": "2020-12-31T07:39:19Z", + "currentState": { + "bootstrapPassword": "jL%IctBOu)-$D@wa", + "iamAuthEnabled": false, + "ipRestrictions": [], + "name": "my_rancher", + "plan": "OVHCLOUD_EDITION", + "region": "EU_WEST_RBX", + "version": "1.0.0" + }, + "currentTasks": [ + { + "id": "aad7c39d-ed0e-44c3-9624-096a0ef569f2", + "link": "/v2/publicCloud/project/a755273a123456788da6d6fcc71a95f3/rancher/d6b6579e-8d60-4487-bf08-8b4ddf98f7d3/task/aad7c39d-ed0e-44c3-9624-096a0ef569f2", + "type": "RANCHER_CREATE" + } + ], + "id": "d6b6579e-8d60-4487-bf08-8b4ddf98f7d3", + "resourceStatus": "CREATING", + "targetSpec": { + "iamAuthEnabled": false, + "ipRestrictions": [], + "name": "my_rancher", + "plan": "OVHCLOUD_EDITION", + "version": "1.0.0" + }, + "updatedAt": "2020-12-31T07:39:19Z" + }, + "summary": "Example" + } + } + } + } + }, + "500": { + "description": "Error 500 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "examples": { + "Server::InternalServerError::Maintenance": { + "value": { + "class": "Server::InternalServerError::Maintenance", + "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." + } + } + } + } + } + } + }, + "tags": [ + "Rancher" + ], + "x-badges": [ + { + "color": "green", + "label": "Stable production version" + } + ], + "x-iam-actions": [ + { + "name": "publicCloudProject:apiovh:rancher/create", + "required": true + } + ] + } + }, + "/publicCloud/project/{projectId}/rancher/{rancherId}": { + "delete": { + "summary": "Delete a managed Rancher service", + "security": [ + { + "oAuth2AuthCode": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "projectId", + "description": "Project ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "rancherId", + "description": "Rancher ID", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicCloud.rancher.Rancher" + }, + "examples": { + "Example": { + "value": { + "createdAt": "2020-12-31T07:39:19Z", + "currentState": { + "iamAuthEnabled": false, + "ipRestrictions": [], + "name": "my_rancher", + "networking": { + "egressCidrBlocks": [ + "203.0.113.0/24" + ] + }, + "plan": "OVHCLOUD_EDITION", + "region": "EU_WEST_RBX", + "url": "https://aaaaaa.bbbb.rancher.ovhcloud.example", + "usage": { + "datetime": "2020-12-31T09:00:00Z", + "orchestratedVcpus": 16 + }, + "version": "1.0.0" + }, + "currentTasks": [ + { + "id": "aad7c39d-ed0e-44c3-9624-096a0ef569f2", + "link": "/v2/publicCloud/project/a755273a123456788da6d6fcc71a95f3/rancher/d6b6579e-8d60-4487-bf08-8b4ddf98f7d3/task/aad7c39d-ed0e-44c3-9624-096a0ef569f2", + "type": "RANCHER_DELETE" + } + ], + "id": "d6b6579e-8d60-4487-bf08-8b4ddf98f7d3", + "resourceStatus": "DELETING", + "targetSpec": { + "iamAuthEnabled": false, + "ipRestrictions": [], + "name": "my_rancher", + "plan": "OVHCLOUD_EDITION", + "version": "1.0.0" + }, + "updatedAt": "2020-12-31T09:10:19Z" + }, + "summary": "Example" + } + } + } + } + }, + "500": { + "description": "Error 500 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "examples": { + "Server::InternalServerError::Maintenance": { + "value": { + "class": "Server::InternalServerError::Maintenance", + "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." + } + } + } + } + } + } + }, + "tags": [ + "Rancher" + ], + "x-badges": [ + { + "color": "green", + "label": "Stable production version" + } + ], + "x-iam-actions": [ + { + "name": "publicCloudProject:apiovh:rancher/delete", + "required": true + } + ] + }, + "get": { + "summary": "Get a managed Rancher service", + "security": [ + { + "oAuth2AuthCode": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "projectId", + "description": "Project ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "rancherId", + "description": "Rancher ID", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicCloud.rancher.Rancher" + }, + "examples": { + "Example": { + "value": { + "createdAt": "2020-12-31T07:39:19Z", + "currentState": { + "iamAuthEnabled": false, + "ipRestrictions": [ + { + "cidrBlock": "198.51.100.1/32", + "description": "My IP restriction" + } + ], + "name": "my_rancher", + "networking": { + "egressCidrBlocks": [ + "203.0.113.0/24" + ] + }, + "plan": "OVHCLOUD_EDITION", + "region": "EU_WEST_RBX", + "url": "https://aaaaaa.bbbb.rancher.ovhcloud.example", + "usage": { + "datetime": "2020-12-31T20:00:00Z", + "orchestratedVcpus": 16 + }, + "version": "1.0.0" + }, + "id": "d6b6579e-8d60-4487-bf08-8b4ddf98f7d3", + "resourceStatus": "READY", + "targetSpec": { + "iamAuthEnabled": false, + "ipRestrictions": [ + { + "cidrBlock": "198.51.100.1/32", + "description": "My IP restriction" + } + ], + "name": "my_rancher", + "plan": "OVHCLOUD_EDITION", + "version": "1.0.0" + }, + "updatedAt": "2020-12-31T07:39:19Z" + }, + "summary": "Example" + } + } + } + } + }, + "500": { + "description": "Error 500 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "examples": { + "Server::InternalServerError::Maintenance": { + "value": { + "class": "Server::InternalServerError::Maintenance", + "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." + } + } + } + } + } + } + }, + "tags": [ + "Rancher" + ], + "x-badges": [ + { + "color": "green", + "label": "Stable production version" + } + ], + "x-iam-actions": [ + { + "name": "publicCloudProject:apiovh:rancher/get", + "required": true + } + ], + "x-response-identifier": "id" + }, + "put": { + "summary": "Update an existing managed Rancher service", + "security": [ + { + "oAuth2AuthCode": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "projectId", + "description": "Project ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "rancherId", + "description": "Rancher ID", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicCloud.rancher.RancherUpdate" + }, + "examples": { + "Update rancher to plan STANDARD": { + "value": { + "targetSpec": { + "iamAuthEnabled": false, + "name": "my_rancher", + "plan": "STANDARD", + "version": "1.0.0" + } + }, + "summary": "Request body when updating plan to STANDARD" + } + } + } + } + }, + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicCloud.rancher.Rancher" + }, + "examples": { + "Update the version of a managed Rancher version": { + "value": { + "createdAt": "2020-12-31T07:39:19Z", + "currentState": { + "iamAuthEnabled": false, + "ipRestrictions": [], + "name": "my_rancher", + "networking": { + "egressCidrBlocks": [ + "203.0.113.0/24" + ] + }, + "plan": "OVHCLOUD_EDITION", + "region": "EU_WEST_RBX", + "url": "https://aaaaaa.bbbb.rancher.ovhcloud.example", + "usage": { + "datetime": "2020-12-31T09:00:00Z", + "orchestratedVcpus": 16 + }, + "version": "1.0.0" + }, + "currentTasks": [ + { + "id": "aad7c39d-ed0e-44c3-9624-096a0ef569f2", + "link": "/v2/publicCloud/project/a755273a123456788da6d6fcc71a95f3/rancher/d6b6579e-8d60-4487-bf08-8b4ddf98f7d3/task/aad7c39d-ed0e-44c3-9624-096a0ef569f2", + "type": "RANCHER_UPDATE" + } + ], + "id": "d6b6579e-8d60-4487-bf08-8b4ddf98f7d3", + "resourceStatus": "UPDATING", + "targetSpec": { + "iamAuthEnabled": false, + "ipRestrictions": [], + "name": "my_rancher", + "plan": "OVHCLOUD_EDITION", + "version": "1.1.0" + }, + "updatedAt": "2020-12-31T09:14:19Z" + }, + "summary": "Response body when updating the version of a managed Rancher" + } + } + } + } + }, + "500": { + "description": "Error 500 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "examples": { + "Server::InternalServerError::Maintenance": { + "value": { + "class": "Server::InternalServerError::Maintenance", + "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." + } + } + } + } + } + } + }, + "tags": [ + "Rancher" + ], + "x-badges": [ + { + "color": "green", + "label": "Stable production version" + } + ], + "x-iam-actions": [ + { + "name": "publicCloudProject:apiovh:rancher/edit", + "required": true + } + ] + } + }, + "/publicCloud/project/{projectId}/rancher/{rancherId}/adminCredentials": { + "post": { + "summary": "Reset the admin password", + "security": [ + { + "oAuth2AuthCode": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "projectId", + "description": "Project ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "rancherId", + "description": "Rancher ID", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicCloud.rancher.Credentials" + }, + "examples": { + "Example": { + "value": { + "password": "u}m.ZBA'>g?!D3DD", + "username": "admin" + }, + "summary": "Example" + } + } + } + } + }, + "500": { + "description": "Error 500 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "examples": { + "Server::InternalServerError::Maintenance": { + "value": { + "class": "Server::InternalServerError::Maintenance", + "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." + } + } + } + } + } + } + }, + "tags": [ + "Rancher" + ], + "x-badges": [ + { + "color": "green", + "label": "Stable production version" + } + ], + "x-iam-actions": [ + { + "name": "publicCloudProject:apiovh:rancher/adminCredentials/reset", + "required": true + } + ] + } + }, + "/publicCloud/project/{projectId}/rancher/{rancherId}/capabilities/plan": { + "get": { + "summary": "List available and current plans for the given managed Rancher service", + "security": [ + { + "oAuth2AuthCode": [] + } + ], + "parameters": [ + { + "in": "header", + "name": "X-Pagination-Cursor", + "description": "Pagination cursor", + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "X-Pagination-Size", + "description": "Pagination size", + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "projectId", + "description": "Project ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "rancherId", + "description": "Rancher ID", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/publicCloud.rancher.PlanCapability" + } + }, + "examples": { + "Get plans - can switch to another plan": { + "value": [ + { + "name": "OVHCLOUD_EDITION", + "status": "CURRENT" + }, + { + "name": "STANDARD", + "status": "AVAILABLE" + } + ], + "summary": "Response body when listing plans for a specific rancher that can switch to another plan" + }, + "Get plans - cannot switch to another plan": { + "value": [ + { + "cause": "CANNOT_DOWNGRADE_USING_HIGHER_FEATURES", + "message": "You are currently using STANDARD plan features and cannot downgrade to OVHCLOUD_EDITION plan.", + "name": "OVHCLOUD_EDITION", + "status": "UNAVAILABLE" + }, + { + "name": "STANDARD", + "status": "CURRENT" + } + ], + "summary": "Response body when listing plans for a specific rancher that cannot switch to another plan" + } + } + } + } + }, + "500": { + "description": "Error 500 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "examples": { + "Server::InternalServerError::Maintenance": { + "value": { + "class": "Server::InternalServerError::Maintenance", + "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." + } + } + } + } + } + } + }, + "tags": [ + "Rancher" + ], + "x-badges": [ + { + "color": "green", + "label": "Stable production version" + } + ], + "x-iam-actions": [ + { + "name": "publicCloudProject:apiovh:rancher/capabilities/plan/get", + "required": true + } + ] + } + }, + "/publicCloud/project/{projectId}/rancher/{rancherId}/capabilities/version": { + "get": { + "summary": "List available and current versions for the given managed Rancher service", + "security": [ + { + "oAuth2AuthCode": [] + } + ], + "parameters": [ + { + "in": "header", + "name": "X-Pagination-Cursor", + "description": "Pagination cursor", + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "X-Pagination-Size", + "description": "Pagination size", + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "projectId", + "description": "Project ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "rancherId", + "description": "Rancher ID", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/publicCloud.rancher.VersionCapability" + } + }, + "examples": { + "Example": { + "value": [ + { + "changelogUrl": "https://github.com/rancher/rancher/releases/tag/v1.0.0", + "name": "1.0.0", + "status": "AVAILABLE" + }, + { + "changelogUrl": "https://github.com/rancher/rancher/releases/tag/v1.1.0", + "name": "1.1.0", + "status": "AVAILABLE" + }, + { + "cause": "CANNOT_UPGRADE_MULTIPLE_VERSIONS", + "changelogUrl": "https://github.com/rancher/rancher/releases/tag/v1.2.0", + "message": "You cannot upgrade directly to this version, please upgrade to the next minor first.", + "name": "1.2.0", + "status": "UNAVAILABLE" + } + ], + "summary": "Example" + } + } + } + } + }, + "500": { + "description": "Error 500 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "examples": { + "Server::InternalServerError::Maintenance": { + "value": { + "class": "Server::InternalServerError::Maintenance", + "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." + } + } + } + } + } + } + }, + "tags": [ + "Rancher" + ], + "x-badges": [ + { + "color": "green", + "label": "Stable production version" + } + ], + "x-iam-actions": [ + { + "name": "publicCloudProject:apiovh:rancher/capabilities/version/get", + "required": true + } + ] + } + }, + "/publicCloud/project/{projectId}/rancher/{rancherId}/event": { + "get": { + "summary": "List all events related to the managed Rancher service", + "security": [ + { + "oAuth2AuthCode": [] + } + ], + "parameters": [ + { + "in": "header", + "name": "X-Pagination-Cursor", + "description": "Pagination cursor", + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "X-Pagination-Size", + "description": "Pagination size", + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "projectId", + "description": "Project ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "rancherId", + "description": "Rancher ID", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/common.Event" + } + }, + "examples": { + "Example": { + "value": [ + { + "createdAt": "2020-12-31T20:10:01Z", + "kind": "RANCHER_UPDATE", + "link": "/v2/publicCloud/project/a755273a123456788da6d6fcc71a95f3/rancher/132645az-9c16-4021-b920-dfd22d8848c4/task/8e2478fa-af3b-4576-b344-af3546f52b5b", + "message": "Task started to update Rancher", + "type": "TASK_START" + }, + { + "createdAt": "2020-12-01T20:10:00Z", + "kind": "RANCHER_UPDATE", + "message": "Rancher target spec updated", + "type": "TARGET_SPEC_UPDATE" + } + ], + "summary": "Example" + } + } + } + } + }, + "500": { + "description": "Error 500 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "examples": { + "Server::InternalServerError::Maintenance": { + "value": { + "class": "Server::InternalServerError::Maintenance", + "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." + } + } + } + } + } + } + }, + "tags": [ + "Rancher" + ], + "x-badges": [ + { + "color": "green", + "label": "Stable production version" + } + ], + "x-iam-actions": [ + { + "name": "publicCloudProject:apiovh:rancher/event/get", + "required": true + } + ] + } + }, + "/publicCloud/project/{projectId}/rancher/{rancherId}/task": { + "get": { + "summary": "List all asynchronous operations related to the managed Rancher service", + "security": [ + { + "oAuth2AuthCode": [] + } + ], + "parameters": [ + { + "in": "header", + "name": "X-Pagination-Cursor", + "description": "Pagination cursor", + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "X-Pagination-Size", + "description": "Pagination size", + "schema": { + "type": "integer" + } + }, + { + "in": "path", + "name": "projectId", + "description": "Project ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "rancherId", + "description": "Rancher ID", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/common.Task" + } + }, + "examples": { + "Example": { + "value": [ + { + "createdAt": "2020-12-01T20:00:00Z", + "errors": [], + "id": "6ffe3c08-3b65-4ede-a0e6-8b137e333e54", + "link": "/v2/publicCloud/project/a755273a123456788da6d6fcc71a95f3/rancher/132645az-9c16-4021-b920-dfd22d8848c4", + "message": "Cloud project a755273a123456788da6d6fcc71a95f3: update rancher 132645az-9c16-4021-b920-dfd22d8848c4", + "progress": [ + { + "name": "test", + "status": "RUNNING" + }, + { + "name": "another step", + "status": "DONE" + }, + { + "name": "yet another step", + "status": "PENDING" + } + ], + "startedAt": "2020-12-01T20:01:00Z", + "status": "RUNNING", + "type": "PlanUpdate", + "updatedAt": "2020-12-01T20:02:00Z" + } + ], + "summary": "Example" + } + } + } + } + }, + "500": { + "description": "Error 500 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "examples": { + "Server::InternalServerError::Maintenance": { + "value": { + "class": "Server::InternalServerError::Maintenance", + "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." + } + } + } + } + } + } + }, + "tags": [ + "Rancher" + ], + "x-badges": [ + { + "color": "green", + "label": "Stable production version" + } + ], + "x-iam-actions": [ + { + "name": "publicCloudProject:apiovh:rancher/task/get", + "required": true + } + ], + "x-response-identifier": "id", + "x-expanded-response": "CommonTask" } }, - "securitySchemes": { - "oAuth2AuthCode": { - "type": "oauth2", - "description": "Oauth2", - "x-client-id": "1bb9c7df371741c0", - "x-client-secret": "a5b4de870aca620d10fbf63cd18d205b", - "flows": { - "authorizationCode": { - "authorizationUrl": "https://www.ovh.com/auth/oauth2/authorize", - "tokenUrl": "https://www.ovh.com/auth/oauth2/token", - "scopes": { - "account/all": "Manage your account", - "all": "Manage your whole account and all your services", - "services/all": "Manage your services lifecycle and billing" + "/publicCloud/project/{projectId}/rancher/{rancherId}/task/{taskId}": { + "get": { + "summary": "Get a specific task related to the managed Rancher service", + "security": [ + { + "oAuth2AuthCode": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "projectId", + "description": "Project ID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "rancherId", + "description": "Rancher ID", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "in": "path", + "name": "taskId", + "description": "Task ID", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/common.Task" + }, + "examples": { + "Example": { + "value": { + "createdAt": "2020-12-01T20:00:00Z", + "errors": [], + "id": "6ffe3c08-3b65-4ede-a0e6-8b137e333e54", + "link": "/v2/publicCloud/project/a755273a123456788da6d6fcc71a95f3/rancher/132645az-9c16-4021-b920-dfd22d8848c4", + "message": "Cloud project a755273a123456788da6d6fcc71a95f3: update rancher 132645az-9c16-4021-b920-dfd22d8848c4", + "progress": [ + { + "name": "test", + "status": "RUNNING" + }, + { + "name": "another step", + "status": "DONE" + }, + { + "name": "yet another step", + "status": "PENDING" + } + ], + "startedAt": "2020-12-01T20:01:00Z", + "status": "RUNNING", + "type": "RANCHER_UPDATE", + "updatedAt": "2020-12-01T20:02:00Z" + }, + "summary": "Example" + } + } + } + } + }, + "500": { + "description": "Error 500 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "examples": { + "Server::InternalServerError::Maintenance": { + "value": { + "class": "Server::InternalServerError::Maintenance", + "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." + } + } + } + } } } - } + }, + "tags": [ + "Rancher" + ], + "x-badges": [ + { + "color": "green", + "label": "Stable production version" + } + ], + "x-iam-actions": [ + { + "name": "publicCloudProject:apiovh:rancher/task/get", + "required": true + } + ], + "x-response-identifier": "id" } - } - }, - "paths": { - "/publicCloud/project": { + }, + "/publicCloud/project/{projectId}/reference/rancher/plan": { "get": { - "summary": "List all Public Cloud projects", + "summary": "List available plans for creating a managed Rancher service", "security": [ { "oAuth2AuthCode": [] @@ -2218,17 +4759,12 @@ } }, { - "in": "query", - "name": "iamTags", - "description": "Filter resources on IAM tags", + "in": "path", + "name": "projectId", + "description": "Project ID", + "required": true, "schema": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "$ref": "#/components/schemas/iam.resource.TagFilter" - } - } + "type": "string" } } ], @@ -2240,13 +4776,32 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/publicCloud.project.ProjectAsyncWithIAM" + "$ref": "#/components/schemas/publicCloud.rancher.PlanReference" + } + }, + "examples": { + "Example": { + "value": [ + { + "name": "OVHCLOUD_EDITION", + "status": "AVAILABLE" + }, + { + "name": "STANDARD", + "status": "AVAILABLE" + } + ], + "summary": "Example" } } } } } }, + "tags": [ + "Rancher", + "Reference" + ], "x-badges": [ { "color": "green", @@ -2255,22 +4810,37 @@ ], "x-iam-actions": [ { - "name": "publicCloudProject:apiovh:get", + "name": "publicCloudProject:apiovh:reference/rancher/plan/get", "required": true } - ], - "x-expanded-response": "PublicCloudProjectProjectAsyncWithIAM" + ] } }, - "/publicCloud/project/{projectId}": { + "/publicCloud/project/{projectId}/reference/rancher/version": { "get": { - "summary": "Get details on a Public Cloud project", + "summary": "List available versions for creating a managed Rancher service", "security": [ { "oAuth2AuthCode": [] } ], "parameters": [ + { + "in": "header", + "name": "X-Pagination-Cursor", + "description": "Pagination cursor", + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "X-Pagination-Size", + "description": "Pagination size", + "schema": { + "type": "integer" + } + }, { "in": "path", "name": "projectId", @@ -2287,12 +4857,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/publicCloud.project.ProjectAsyncWithIAM" + "type": "array", + "items": { + "$ref": "#/components/schemas/publicCloud.rancher.VersionReference" + } + }, + "examples": { + "Example": { + "value": [ + { + "changelogUrl": "https://github.com/rancher/rancher/releases/tag/v1.0.0", + "name": "1.0.0", + "status": "AVAILABLE" + }, + { + "changelogUrl": "https://github.com/rancher/rancher/releases/tag/v1.1.0", + "name": "1.1.0", + "status": "AVAILABLE" + } + ], + "summary": "Example" + } } } } } }, + "tags": [ + "Rancher", + "Reference" + ], "x-badges": [ { "color": "green", @@ -2301,15 +4895,19 @@ ], "x-iam-actions": [ { - "name": "publicCloudProject:apiovh:get", + "name": "publicCloudProject:apiovh:reference/rancher/version/get", "required": true } ] } }, - "/publicCloud/project/{projectId}/rancher": { + "/publicCloud/reference/rancher/plan": { "get": { - "summary": "List managed Rancher services", + "summary": "List available plans for creating a managed Rancher service", + "deprecated": true, + "x-deprecation-date": "2024-05-20T00:00:00Z", + "x-deletion-date": "2024-09-01T00:00:00Z", + "x-replacement-route": "/v2/publicCloud/project/{projectId}/reference/rancher", "security": [ { "oAuth2AuthCode": [] @@ -2331,15 +4929,6 @@ "schema": { "type": "integer" } - }, - { - "in": "path", - "name": "projectId", - "description": "Project ID", - "required": true, - "schema": { - "type": "string" - } } ], "responses": { @@ -2350,82 +4939,19 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/publicCloud.rancher.Rancher" + "$ref": "#/components/schemas/publicCloud.rancher.PlanReference" } }, "examples": { "Example": { "value": [ { - "createdAt": "2020-12-31T07:39:19Z", - "currentState": { - "iamAuthEnabled": false, - "ipRestrictions": [ - { - "cidrBlock": "198.51.100.1/32", - "description": "My IP restriction" - } - ], - "name": "my_rancher", - "networking": { - "egressCidrBlocks": [ - "203.0.113.0/24" - ] - }, - "plan": "OVHCLOUD_EDITION", - "region": "EU_WEST_RBX", - "url": "https://aaaaaa.bbbb.rancher.ovhcloud.example", - "usage": { - "datetime": "2020-12-31T13:00:00Z", - "orchestratedVcpus": 16 - }, - "version": "1.0.0" - }, - "currentTasks": [], - "id": "d6b6579e-8d60-4487-bf08-8b4ddf98f7d3", - "resourceStatus": "READY", - "targetSpec": { - "iamAuthEnabled": false, - "ipRestrictions": [ - { - "cidrBlock": "198.51.100.1/32", - "description": "My IP restriction" - } - ], - "name": "my_rancher", - "plan": "OVHCLOUD_EDITION", - "version": "1.0.0" - }, - "updatedAt": "2020-12-31T07:39:19Z" + "name": "OVHCLOUD_EDITION", + "status": "AVAILABLE" }, { - "createdAt": "2020-12-31T13:37:46Z", - "currentState": { - "iamAuthEnabled": false, - "ipRestrictions": [], - "name": "rancher2", - "plan": "STANDARD", - "region": "EU_WEST_RBX", - "url": "https://cccccc.bbbb.rancher.ovhcloud.example", - "version": "1.0.0" - }, - "currentTasks": [ - { - "id": "30017036-ddb2-40a8-ad56-6d765b059aab", - "link": "/v2/publicCloud/project/a755273a123456788da6d6fcc71a95f3/rancher/222ce105-a3f7-44c4-a7d3-dbb5983c045d/task/30017036-ddb2-40a8-ad56-6d765b059aab", - "type": "RANCHER_UPDATE" - } - ], - "id": "222ce105-a3f7-44c4-a7d3-dbb5983c045d", - "resourceStatus": "UPDATING", - "targetSpec": { - "iamAuthEnabled": false, - "ipRestrictions": [], - "name": "rancher2", - "plan": "STANDARD", - "version": "1.1.0" - }, - "updatedAt": "2020-12-31T13:40:46Z" + "name": "STANDARD", + "status": "AVAILABLE" } ], "summary": "Example" @@ -2433,31 +4959,75 @@ } } } + } + }, + "tags": [ + "Reference" + ], + "x-badges": [ + { + "color": "red", + "label": "Deprecated, will be removed" + } + ] + } + }, + "/publicCloud/reference/rancher/version": { + "get": { + "summary": "List available versions for creating a managed Rancher service", + "deprecated": true, + "x-deprecation-date": "2024-05-20T00:00:00Z", + "x-deletion-date": "2024-09-01T00:00:00Z", + "x-replacement-route": "/v2/publicCloud/project/{projectId}/reference/rancher", + "security": [ + { + "oAuth2AuthCode": [] + } + ], + "parameters": [ + { + "in": "header", + "name": "X-Pagination-Cursor", + "description": "Pagination cursor", + "schema": { + "type": "string" + } }, - "500": { - "description": "Error 500 response", + { + "in": "header", + "name": "X-Pagination-Size", + "description": "Pagination size", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "successful operation", "content": { "application/json": { - "schema": { - "type": "object", - "description": "Common error model", - "properties": { - "class": { - "type": "string", - "description": "Class of the error" - }, - "message": { - "type": "string", - "description": "Error message" - } + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/publicCloud.rancher.VersionReference" } }, "examples": { - "Server::InternalServerError::Maintenance": { - "value": { - "class": "Server::InternalServerError::Maintenance", - "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." - } + "Example": { + "value": [ + { + "changelogUrl": "https://github.com/rancher/rancher/releases/tag/v1.0.0", + "name": "1.0.0", + "status": "AVAILABLE" + }, + { + "changelogUrl": "https://github.com/rancher/rancher/releases/tag/v1.1.0", + "name": "1.1.0", + "status": "AVAILABLE" + } + ], + "summary": "Example" } } } @@ -2465,31 +5035,41 @@ } }, "tags": [ - "Rancher" + "Reference" ], "x-badges": [ { - "color": "green", - "label": "Stable production version" - } - ], - "x-iam-actions": [ - { - "name": "publicCloudProject:apiovh:rancher/get", - "required": true + "color": "red", + "label": "Deprecated, will be removed" } - ], - "x-response-identifier": "id", - "x-expanded-response": "PublicCloudRancherRancher" - }, - "post": { - "summary": "Create a new managed Rancher service", + ] + } + }, + "/publicCloud/project/{projectId}/sshKey": { + "get": { + "summary": "List SSH keys", "security": [ { "oAuth2AuthCode": [] } ], "parameters": [ + { + "in": "header", + "name": "X-Pagination-Cursor", + "description": "Pagination cursor", + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "X-Pagination-Size", + "description": "Pagination size", + "schema": { + "type": "integer" + } + }, { "in": "path", "name": "projectId", @@ -2500,108 +5080,15 @@ } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/publicCloud.rancher.RancherCreation" - }, - "examples": { - "Create a STANDARD managed Rancher on the latest version": { - "value": { - "targetSpec": { - "iamAuthEnabled": false, - "name": "my_rancher", - "plan": "STANDARD" - } - }, - "summary": "Request body for creating a managed Rancher on plan STANDARD" - }, - "Create an OVHCLOUD_EDITION managed Rancher on a specific version": { - "value": { - "targetSpec": { - "iamAuthEnabled": false, - "name": "my_rancher", - "plan": "OVHCLOUD_EDITION", - "version": "1.0.0" - } - }, - "summary": "Request body for creating a managed Rancher on plan OVHCLOUD_EDITION with a specific version" - } - } - } - } - }, "responses": { "200": { "description": "successful operation", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/publicCloud.rancher.Rancher" - }, - "examples": { - "Example": { - "value": { - "createdAt": "2020-12-31T07:39:19Z", - "currentState": { - "bootstrapPassword": "jL%IctBOu)-$D@wa", - "iamAuthEnabled": false, - "ipRestrictions": [], - "name": "my_rancher", - "plan": "OVHCLOUD_EDITION", - "region": "EU_WEST_RBX", - "version": "1.0.0" - }, - "currentTasks": [ - { - "id": "aad7c39d-ed0e-44c3-9624-096a0ef569f2", - "link": "/v2/publicCloud/project/a755273a123456788da6d6fcc71a95f3/rancher/d6b6579e-8d60-4487-bf08-8b4ddf98f7d3/task/aad7c39d-ed0e-44c3-9624-096a0ef569f2", - "type": "RANCHER_CREATE" - } - ], - "id": "d6b6579e-8d60-4487-bf08-8b4ddf98f7d3", - "resourceStatus": "CREATING", - "targetSpec": { - "iamAuthEnabled": false, - "ipRestrictions": [], - "name": "my_rancher", - "plan": "OVHCLOUD_EDITION", - "version": "1.0.0" - }, - "updatedAt": "2020-12-31T07:39:19Z" - }, - "summary": "Example" - } - } - } - } - }, - "500": { - "description": "Error 500 response", - "content": { - "application/json": { - "schema": { - "type": "object", - "description": "Common error model", - "properties": { - "class": { - "type": "string", - "description": "Class of the error" - }, - "message": { - "type": "string", - "description": "Error message" - } - } - }, - "examples": { - "Server::InternalServerError::Maintenance": { - "value": { - "class": "Server::InternalServerError::Maintenance", - "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." - } + "type": "array", + "items": { + "$ref": "#/components/schemas/publicCloud.sshKey.SSHKey" } } } @@ -2609,25 +5096,25 @@ } }, "tags": [ - "Rancher" + "Compute" ], "x-badges": [ { - "color": "green", - "label": "Stable production version" + "color": "blue", + "label": "Alpha version" } ], "x-iam-actions": [ { - "name": "publicCloudProject:apiovh:rancher/create", + "name": "publicCloudProject:apiovh:sshKey/get", "required": true } - ] - } - }, - "/publicCloud/project/{projectId}/rancher/{rancherId}": { - "delete": { - "summary": "Delete a managed Rancher service", + ], + "x-response-identifier": "name", + "x-expanded-response": "PublicCloudSshKeySSHKey" + }, + "post": { + "summary": "Create an SSH key", "security": [ { "oAuth2AuthCode": [] @@ -2642,74 +5129,31 @@ "schema": { "type": "string" } - }, - { - "in": "path", - "name": "rancherId", - "description": "Rancher ID", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicCloud.sshKey.SSHKeyCreation" + } + } + } + }, "responses": { "200": { "description": "successful operation", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/publicCloud.rancher.Rancher" - }, - "examples": { - "Example": { - "value": { - "createdAt": "2020-12-31T07:39:19Z", - "currentState": { - "iamAuthEnabled": false, - "ipRestrictions": [], - "name": "my_rancher", - "networking": { - "egressCidrBlocks": [ - "203.0.113.0/24" - ] - }, - "plan": "OVHCLOUD_EDITION", - "region": "EU_WEST_RBX", - "url": "https://aaaaaa.bbbb.rancher.ovhcloud.example", - "usage": { - "datetime": "2020-12-31T09:00:00Z", - "orchestratedVcpus": 16 - }, - "version": "1.0.0" - }, - "currentTasks": [ - { - "id": "aad7c39d-ed0e-44c3-9624-096a0ef569f2", - "link": "/v2/publicCloud/project/a755273a123456788da6d6fcc71a95f3/rancher/d6b6579e-8d60-4487-bf08-8b4ddf98f7d3/task/aad7c39d-ed0e-44c3-9624-096a0ef569f2", - "type": "RANCHER_DELETE" - } - ], - "id": "d6b6579e-8d60-4487-bf08-8b4ddf98f7d3", - "resourceStatus": "DELETING", - "targetSpec": { - "iamAuthEnabled": false, - "ipRestrictions": [], - "name": "my_rancher", - "plan": "OVHCLOUD_EDITION", - "version": "1.0.0" - }, - "updatedAt": "2020-12-31T09:10:19Z" - }, - "summary": "Example" - } + "$ref": "#/components/schemas/publicCloud.sshKey.SSHKey" } } } }, - "500": { - "description": "Error 500 response", + "409": { + "description": "Error 409 response", "content": { "application/json": { "schema": { @@ -2727,10 +5171,10 @@ } }, "examples": { - "Server::InternalServerError::Maintenance": { - "value": { - "class": "Server::InternalServerError::Maintenance", - "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." + "Client::Conflict::NameAlreadyInUse": { + "value": { + "class": "Client::Conflict::NameAlreadyInUse", + "message": "This name is already in use" } } } @@ -2739,23 +5183,25 @@ } }, "tags": [ - "Rancher" + "Compute" ], "x-badges": [ { - "color": "green", - "label": "Stable production version" + "color": "blue", + "label": "Alpha version" } ], "x-iam-actions": [ { - "name": "publicCloudProject:apiovh:rancher/delete", + "name": "publicCloudProject:apiovh:sshKey/create", "required": true } ] - }, - "get": { - "summary": "Get a managed Rancher service", + } + }, + "/publicCloud/project/{projectId}/sshKey/{name}": { + "delete": { + "summary": "Delete an SSH key", "security": [ { "oAuth2AuthCode": [] @@ -2764,8 +5210,8 @@ "parameters": [ { "in": "path", - "name": "projectId", - "description": "Project ID", + "name": "name", + "description": "Name", "required": true, "schema": { "type": "string" @@ -2773,12 +5219,11 @@ }, { "in": "path", - "name": "rancherId", - "description": "Rancher ID", + "name": "projectId", + "description": "Project ID", "required": true, "schema": { - "type": "string", - "format": "uuid" + "type": "string" } } ], @@ -2788,59 +5233,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/publicCloud.rancher.Rancher" - }, - "examples": { - "Example": { - "value": { - "createdAt": "2020-12-31T07:39:19Z", - "currentState": { - "iamAuthEnabled": false, - "ipRestrictions": [ - { - "cidrBlock": "198.51.100.1/32", - "description": "My IP restriction" - } - ], - "name": "my_rancher", - "networking": { - "egressCidrBlocks": [ - "203.0.113.0/24" - ] - }, - "plan": "OVHCLOUD_EDITION", - "region": "EU_WEST_RBX", - "url": "https://aaaaaa.bbbb.rancher.ovhcloud.example", - "usage": { - "datetime": "2020-12-31T20:00:00Z", - "orchestratedVcpus": 16 - }, - "version": "1.0.0" - }, - "id": "d6b6579e-8d60-4487-bf08-8b4ddf98f7d3", - "resourceStatus": "READY", - "targetSpec": { - "iamAuthEnabled": false, - "ipRestrictions": [ - { - "cidrBlock": "198.51.100.1/32", - "description": "My IP restriction" - } - ], - "name": "my_rancher", - "plan": "OVHCLOUD_EDITION", - "version": "1.0.0" - }, - "updatedAt": "2020-12-31T07:39:19Z" - }, - "summary": "Example" - } + "$ref": "#/components/schemas/publicCloud.sshKey.SSHKey" } } } }, - "500": { - "description": "Error 500 response", + "404": { + "description": "Error 404 response", "content": { "application/json": { "schema": { @@ -2858,10 +5257,10 @@ } }, "examples": { - "Server::InternalServerError::Maintenance": { + "Client::NotFound::SSHKeyDoesNotExist": { "value": { - "class": "Server::InternalServerError::Maintenance", - "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." + "class": "Client::NotFound::SSHKeyDoesNotExist", + "message": "SSH key not found" } } } @@ -2870,24 +5269,23 @@ } }, "tags": [ - "Rancher" + "Compute" ], "x-badges": [ { - "color": "green", - "label": "Stable production version" + "color": "blue", + "label": "Alpha version" } ], "x-iam-actions": [ { - "name": "publicCloudProject:apiovh:rancher/get", + "name": "publicCloudProject:apiovh:sshKey/delete", "required": true } - ], - "x-response-identifier": "id" + ] }, - "put": { - "summary": "Update an existing managed Rancher service", + "get": { + "summary": "Get an SSH key", "security": [ { "oAuth2AuthCode": [] @@ -2896,8 +5294,8 @@ "parameters": [ { "in": "path", - "name": "projectId", - "description": "Project ID", + "name": "name", + "description": "Name", "required": true, "schema": { "type": "string" @@ -2905,94 +5303,27 @@ }, { "in": "path", - "name": "rancherId", - "description": "Rancher ID", + "name": "projectId", + "description": "Project ID", "required": true, "schema": { - "type": "string", - "format": "uuid" + "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/publicCloud.rancher.RancherUpdate" - }, - "examples": { - "Update rancher to plan STANDARD": { - "value": { - "targetSpec": { - "iamAuthEnabled": false, - "name": "my_rancher", - "plan": "STANDARD", - "version": "1.0.0" - } - }, - "summary": "Request body when updating plan to STANDARD" - } - } - } - } - }, "responses": { "200": { "description": "successful operation", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/publicCloud.rancher.Rancher" - }, - "examples": { - "Update the version of a managed Rancher version": { - "value": { - "createdAt": "2020-12-31T07:39:19Z", - "currentState": { - "iamAuthEnabled": false, - "ipRestrictions": [], - "name": "my_rancher", - "networking": { - "egressCidrBlocks": [ - "203.0.113.0/24" - ] - }, - "plan": "OVHCLOUD_EDITION", - "region": "EU_WEST_RBX", - "url": "https://aaaaaa.bbbb.rancher.ovhcloud.example", - "usage": { - "datetime": "2020-12-31T09:00:00Z", - "orchestratedVcpus": 16 - }, - "version": "1.0.0" - }, - "currentTasks": [ - { - "id": "aad7c39d-ed0e-44c3-9624-096a0ef569f2", - "link": "/v2/publicCloud/project/a755273a123456788da6d6fcc71a95f3/rancher/d6b6579e-8d60-4487-bf08-8b4ddf98f7d3/task/aad7c39d-ed0e-44c3-9624-096a0ef569f2", - "type": "RANCHER_UPDATE" - } - ], - "id": "d6b6579e-8d60-4487-bf08-8b4ddf98f7d3", - "resourceStatus": "UPDATING", - "targetSpec": { - "iamAuthEnabled": false, - "ipRestrictions": [], - "name": "my_rancher", - "plan": "OVHCLOUD_EDITION", - "version": "1.1.0" - }, - "updatedAt": "2020-12-31T09:14:19Z" - }, - "summary": "Response body when updating the version of a managed Rancher" - } + "$ref": "#/components/schemas/publicCloud.sshKey.SSHKey" } } } }, - "500": { - "description": "Error 500 response", + "404": { + "description": "Error 404 response", "content": { "application/json": { "schema": { @@ -3010,10 +5341,10 @@ } }, "examples": { - "Server::InternalServerError::Maintenance": { + "Client::NotFound::SSHKeyDoesNotExist": { "value": { - "class": "Server::InternalServerError::Maintenance", - "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." + "class": "Client::NotFound::SSHKeyDoesNotExist", + "message": "SSH key not found" } } } @@ -3022,25 +5353,27 @@ } }, "tags": [ - "Rancher" + "Compute" ], "x-badges": [ { - "color": "green", - "label": "Stable production version" + "color": "blue", + "label": "Alpha version" } ], "x-iam-actions": [ { - "name": "publicCloudProject:apiovh:rancher/edit", + "name": "publicCloudProject:apiovh:sshKey/get", "required": true } - ] + ], + "x-response-identifier": "name" } }, - "/publicCloud/project/{projectId}/rancher/{rancherId}/adminCredentials": { - "post": { - "summary": "Reset the admin password", + "/publicCloud/project/{projectId}/quota": { + "get": { + "summary": "Get the project quota", + "description": "Get the project quota. When the `region` query parameter is set, the response narrows `targetSpec.regions` and `currentState.regions` to that single region. Omit it to get all regions.", "security": [ { "oAuth2AuthCode": [] @@ -3057,13 +5390,11 @@ } }, { - "in": "path", - "name": "rancherId", - "description": "Rancher ID", - "required": true, + "in": "query", + "name": "region", + "description": "Optional region filter", "schema": { - "type": "string", - "format": "uuid" + "type": "string" } } ], @@ -3073,22 +5404,42 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/publicCloud.rancher.Credentials" + "$ref": "#/components/schemas/publicCloud.quota.Quota" + } + } + } + }, + "400": { + "description": "Error 400 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } + } }, "examples": { - "Example": { + "Client::BadRequest::ServiceNotAvailableInRegion": { "value": { - "password": "u}m.ZBA'>g?!D3DD", - "username": "admin" - }, - "summary": "Example" + "class": "Client::BadRequest::ServiceNotAvailableInRegion", + "message": "This service is not available in the selected region" + } } } } } }, - "500": { - "description": "Error 500 response", + "409": { + "description": "Error 409 response", "content": { "application/json": { "schema": { @@ -3106,10 +5457,10 @@ } }, "examples": { - "Server::InternalServerError::Maintenance": { + "Client::Conflict::ResourceInInvalidState": { "value": { - "class": "Server::InternalServerError::Maintenance", - "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." + "class": "Client::Conflict::ResourceInInvalidState", + "message": "Resource cannot be modified in its current state" } } } @@ -3118,47 +5469,31 @@ } }, "tags": [ - "Rancher" + "Quota" ], "x-badges": [ { - "color": "green", - "label": "Stable production version" + "color": "blue", + "label": "Alpha version" } ], "x-iam-actions": [ { - "name": "publicCloudProject:apiovh:rancher/adminCredentials/reset", + "name": "publicCloudProject:apiovh:quota/get", "required": true } - ] - } - }, - "/publicCloud/project/{projectId}/rancher/{rancherId}/capabilities/plan": { - "get": { - "summary": "List available and current plans for the given managed Rancher service", + ], + "x-response-identifier": "id" + }, + "put": { + "summary": "Update the project quota", + "description": "Update the project quota. Regions omitted from `targetSpec.regions` are left unchanged. `preventAutomaticQuotaUpgrade` is required.", "security": [ { "oAuth2AuthCode": [] } ], "parameters": [ - { - "in": "header", - "name": "X-Pagination-Cursor", - "description": "Pagination cursor", - "schema": { - "type": "string" - } - }, - { - "in": "header", - "name": "X-Pagination-Size", - "description": "Pagination size", - "schema": { - "type": "integer" - } - }, { "in": "path", "name": "projectId", @@ -3167,64 +5502,66 @@ "schema": { "type": "string" } - }, - { - "in": "path", - "name": "rancherId", - "description": "Rancher ID", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicCloud.quota.QuotaUpdate" + } + } + } + }, "responses": { "200": { "description": "successful operation", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/publicCloud.rancher.PlanCapability" + "$ref": "#/components/schemas/publicCloud.quota.Quota" + } + } + } + }, + "400": { + "description": "Error 400 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } } }, "examples": { - "Get plans - can switch to another plan": { - "value": [ - { - "name": "OVHCLOUD_EDITION", - "status": "CURRENT" - }, - { - "name": "STANDARD", - "status": "AVAILABLE" - } - ], - "summary": "Response body when listing plans for a specific rancher that can switch to another plan" + "Client::BadRequest::InvalidParameter": { + "value": { + "class": "Client::BadRequest::InvalidParameter", + "message": "Invalid parameter in the request" + } }, - "Get plans - cannot switch to another plan": { - "value": [ - { - "cause": "CANNOT_DOWNGRADE_USING_HIGHER_FEATURES", - "message": "You are currently using STANDARD plan features and cannot downgrade to OVHCLOUD_EDITION plan.", - "name": "OVHCLOUD_EDITION", - "status": "UNAVAILABLE" - }, - { - "name": "STANDARD", - "status": "CURRENT" - } - ], - "summary": "Response body when listing plans for a specific rancher that cannot switch to another plan" + "Client::BadRequest::ServiceNotAvailableInRegion": { + "value": { + "class": "Client::BadRequest::ServiceNotAvailableInRegion", + "message": "This service is not available in the selected region" + } } } } } }, - "500": { - "description": "Error 500 response", + "409": { + "description": "Error 409 response", "content": { "application/json": { "schema": { @@ -3242,10 +5579,16 @@ } }, "examples": { - "Server::InternalServerError::Maintenance": { + "Client::Conflict::ChecksumMismatch": { "value": { - "class": "Server::InternalServerError::Maintenance", - "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." + "class": "Client::Conflict::ChecksumMismatch", + "message": "Checksum mismatch — a concurrent update was detected. Refresh the resource and retry" + } + }, + "Client::Conflict::ResourceInInvalidState": { + "value": { + "class": "Client::Conflict::ResourceInInvalidState", + "message": "Resource cannot be modified in its current state" } } } @@ -3254,25 +5597,25 @@ } }, "tags": [ - "Rancher" + "Quota" ], "x-badges": [ { - "color": "green", - "label": "Stable production version" + "color": "blue", + "label": "Alpha version" } ], "x-iam-actions": [ { - "name": "publicCloudProject:apiovh:rancher/capabilities/plan/get", + "name": "publicCloudProject:apiovh:quota/edit", "required": true } ] } }, - "/publicCloud/project/{projectId}/rancher/{rancherId}/capabilities/version": { + "/publicCloud/project/{projectId}/storage/file/network": { "get": { - "summary": "List available and current versions for the given managed Rancher service", + "summary": "List Public Cloud file storage share networks", "security": [ { "oAuth2AuthCode": [] @@ -3303,16 +5646,6 @@ "schema": { "type": "string" } - }, - { - "in": "path", - "name": "rancherId", - "description": "Rancher ID", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } } ], "responses": { @@ -3323,60 +5656,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/publicCloud.rancher.VersionCapability" - } - }, - "examples": { - "Example": { - "value": [ - { - "changelogUrl": "https://github.com/rancher/rancher/releases/tag/v1.0.0", - "name": "1.0.0", - "status": "AVAILABLE" - }, - { - "changelogUrl": "https://github.com/rancher/rancher/releases/tag/v1.1.0", - "name": "1.1.0", - "status": "AVAILABLE" - }, - { - "cause": "CANNOT_UPGRADE_MULTIPLE_VERSIONS", - "changelogUrl": "https://github.com/rancher/rancher/releases/tag/v1.2.0", - "message": "You cannot upgrade directly to this version, please upgrade to the next minor first.", - "name": "1.2.0", - "status": "UNAVAILABLE" - } - ], - "summary": "Example" - } - } - } - } - }, - "500": { - "description": "Error 500 response", - "content": { - "application/json": { - "schema": { - "type": "object", - "description": "Common error model", - "properties": { - "class": { - "type": "string", - "description": "Class of the error" - }, - "message": { - "type": "string", - "description": "Error message" - } - } - }, - "examples": { - "Server::InternalServerError::Maintenance": { - "value": { - "class": "Server::InternalServerError::Maintenance", - "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." - } + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageNetwork" } } } @@ -3384,103 +5664,120 @@ } }, "tags": [ - "Rancher" + "Storage", + "File" ], "x-badges": [ { - "color": "green", - "label": "Stable production version" + "color": "blue", + "label": "Alpha version" } ], "x-iam-actions": [ { - "name": "publicCloudProject:apiovh:rancher/capabilities/version/get", + "name": "publicCloudProject:apiovh:storage/file/network/get", "required": true } - ] - } - }, - "/publicCloud/project/{projectId}/rancher/{rancherId}/event": { - "get": { - "summary": "List all events related to the managed Rancher service", + ], + "x-response-identifier": "id", + "x-expanded-response": "PublicCloudStorageFileFileStorageNetwork" + }, + "post": { + "summary": "Create a new Public Cloud file storage share network", "security": [ { "oAuth2AuthCode": [] } ], "parameters": [ - { - "in": "header", - "name": "X-Pagination-Cursor", - "description": "Pagination cursor", - "schema": { - "type": "string" - } - }, - { - "in": "header", - "name": "X-Pagination-Size", - "description": "Pagination size", - "schema": { - "type": "integer" - } - }, { "in": "path", "name": "projectId", "description": "Project ID", "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "rancherId", - "description": "Rancher ID", - "required": true, - "schema": { - "type": "string", - "format": "uuid" + "schema": { + "type": "string" } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageNetworkCreation" + }, + "examples": { + "Create share network": { + "value": { + "targetSpec": { + "description": "Share network for production", + "location": { + "region": "GRA1" + }, + "name": "my-share-network", + "network": { + "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901" + }, + "subnet": { + "id": "c3d4e5f6-a7b8-9012-cdef-234567890abc" + } + } + }, + "summary": "Create a share network backed by a private network and subnet" + } + } + } + } + }, "responses": { "200": { "description": "successful operation", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/common.Event" + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageNetwork" + } + } + } + }, + "400": { + "description": "Error 400 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } } }, "examples": { - "Example": { - "value": [ - { - "createdAt": "2020-12-31T20:10:01Z", - "kind": "RANCHER_UPDATE", - "link": "/v2/publicCloud/project/a755273a123456788da6d6fcc71a95f3/rancher/132645az-9c16-4021-b920-dfd22d8848c4/task/8e2478fa-af3b-4576-b344-af3546f52b5b", - "message": "Task started to update Rancher", - "type": "TASK_START" - }, - { - "createdAt": "2020-12-01T20:10:00Z", - "kind": "RANCHER_UPDATE", - "message": "Rancher target spec updated", - "type": "TARGET_SPEC_UPDATE" - } - ], - "summary": "Example" + "Client::BadRequest::InvalidParameter": { + "value": { + "class": "Client::BadRequest::InvalidParameter", + "message": "Invalid parameter in the request" + } + }, + "Client::BadRequest::ServiceNotAvailableInRegion": { + "value": { + "class": "Client::BadRequest::ServiceNotAvailableInRegion", + "message": "This service is not available in the selected region" + } } } } } }, - "500": { - "description": "Error 500 response", + "409": { + "description": "Error 409 response", "content": { "application/json": { "schema": { @@ -3498,10 +5795,10 @@ } }, "examples": { - "Server::InternalServerError::Maintenance": { + "Client::Conflict::RegionInMaintenance": { "value": { - "class": "Server::InternalServerError::Maintenance", - "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." + "class": "Client::Conflict::RegionInMaintenance", + "message": "This region is currently in maintenance" } } } @@ -3510,25 +5807,26 @@ } }, "tags": [ - "Rancher" + "Storage", + "File" ], "x-badges": [ { - "color": "green", - "label": "Stable production version" + "color": "blue", + "label": "Alpha version" } ], "x-iam-actions": [ { - "name": "publicCloudProject:apiovh:rancher/event/get", + "name": "publicCloudProject:apiovh:storage/file/network/create", "required": true } ] } }, - "/publicCloud/project/{projectId}/rancher/{rancherId}/task": { - "get": { - "summary": "List all asynchronous operations related to the managed Rancher service", + "/publicCloud/project/{projectId}/storage/file/network/{networkId}": { + "delete": { + "summary": "Delete a Public Cloud file storage share network", "security": [ { "oAuth2AuthCode": [] @@ -3536,19 +5834,13 @@ ], "parameters": [ { - "in": "header", - "name": "X-Pagination-Cursor", - "description": "Pagination cursor", - "schema": { - "type": "string" - } - }, - { - "in": "header", - "name": "X-Pagination-Size", - "description": "Pagination size", + "in": "path", + "name": "networkId", + "description": "Network ID", + "required": true, "schema": { - "type": "integer" + "type": "string", + "format": "uuid" } }, { @@ -3559,16 +5851,6 @@ "schema": { "type": "string" } - }, - { - "in": "path", - "name": "rancherId", - "description": "Rancher ID", - "required": true, - "schema": { - "type": "string", - "format": "uuid" - } } ], "responses": { @@ -3577,48 +5859,13 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/common.Task" - } - }, - "examples": { - "Example": { - "value": [ - { - "createdAt": "2020-12-01T20:00:00Z", - "errors": [], - "id": "6ffe3c08-3b65-4ede-a0e6-8b137e333e54", - "link": "/v2/publicCloud/project/a755273a123456788da6d6fcc71a95f3/rancher/132645az-9c16-4021-b920-dfd22d8848c4", - "message": "Cloud project a755273a123456788da6d6fcc71a95f3: update rancher 132645az-9c16-4021-b920-dfd22d8848c4", - "progress": [ - { - "name": "test", - "status": "RUNNING" - }, - { - "name": "another step", - "status": "DONE" - }, - { - "name": "yet another step", - "status": "PENDING" - } - ], - "startedAt": "2020-12-01T20:01:00Z", - "status": "RUNNING", - "type": "PlanUpdate", - "updatedAt": "2020-12-01T20:02:00Z" - } - ], - "summary": "Example" - } + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageNetwork" } } } }, - "500": { - "description": "Error 500 response", + "409": { + "description": "Error 409 response", "content": { "application/json": { "schema": { @@ -3636,10 +5883,16 @@ } }, "examples": { - "Server::InternalServerError::Maintenance": { + "Client::Conflict::ResourceAlreadyBeingDeleted": { "value": { - "class": "Server::InternalServerError::Maintenance", - "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." + "class": "Client::Conflict::ResourceAlreadyBeingDeleted", + "message": "Resource is already being deleted" + } + }, + "Client::Conflict::ResourceInInvalidState": { + "value": { + "class": "Client::Conflict::ResourceInInvalidState", + "message": "Resource cannot be modified in its current state" } } } @@ -3648,27 +5901,24 @@ } }, "tags": [ - "Rancher" + "Storage", + "File" ], "x-badges": [ { - "color": "green", - "label": "Stable production version" + "color": "blue", + "label": "Alpha version" } ], "x-iam-actions": [ { - "name": "publicCloudProject:apiovh:rancher/task/get", + "name": "publicCloudProject:apiovh:storage/file/network/delete", "required": true } - ], - "x-response-identifier": "id", - "x-expanded-response": "CommonTask" - } - }, - "/publicCloud/project/{projectId}/rancher/{rancherId}/task/{taskId}": { + ] + }, "get": { - "summary": "Get a specific task related to the managed Rancher service", + "summary": "Get a Public Cloud file storage share network", "security": [ { "oAuth2AuthCode": [] @@ -3677,17 +5927,8 @@ "parameters": [ { "in": "path", - "name": "projectId", - "description": "Project ID", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "rancherId", - "description": "Rancher ID", + "name": "networkId", + "description": "Network ID", "required": true, "schema": { "type": "string", @@ -3696,12 +5937,11 @@ }, { "in": "path", - "name": "taskId", - "description": "Task ID", + "name": "projectId", + "description": "Project ID", "required": true, "schema": { - "type": "string", - "format": "uuid" + "type": "string" } } ], @@ -3711,92 +5951,74 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/common.Task" + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageNetwork" }, "examples": { "Example": { "value": { - "createdAt": "2020-12-01T20:00:00Z", - "errors": [], - "id": "6ffe3c08-3b65-4ede-a0e6-8b137e333e54", - "link": "/v2/publicCloud/project/a755273a123456788da6d6fcc71a95f3/rancher/132645az-9c16-4021-b920-dfd22d8848c4", - "message": "Cloud project a755273a123456788da6d6fcc71a95f3: update rancher 132645az-9c16-4021-b920-dfd22d8848c4", - "progress": [ - { - "name": "test", - "status": "RUNNING" + "checksum": "c3d4e5f6a7b8c9d0e1f2a3b4c5d6a7b8", + "createdAt": "2026-02-10T16:00:00Z", + "currentState": { + "description": "Share network for production", + "location": { + "availabilityZone": "eu-west-gra-a", + "region": "GRA1" }, - { - "name": "another step", - "status": "DONE" + "name": "my-share-network", + "network": { + "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901" }, - { - "name": "yet another step", - "status": "PENDING" + "subnet": { + "id": "c3d4e5f6-a7b8-9012-cdef-234567890abc" } - ], - "startedAt": "2020-12-01T20:01:00Z", - "status": "RUNNING", - "type": "RANCHER_UPDATE", - "updatedAt": "2020-12-01T20:02:00Z" + }, + "currentTasks": null, + "id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890", + "resourceStatus": "READY", + "targetSpec": { + "description": "Share network for production", + "location": { + "region": "GRA1" + }, + "name": "my-share-network", + "network": { + "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901" + }, + "subnet": { + "id": "c3d4e5f6-a7b8-9012-cdef-234567890abc" + } + }, + "updatedAt": "2026-02-10T16:05:00Z" }, "summary": "Example" } } } } - }, - "500": { - "description": "Error 500 response", - "content": { - "application/json": { - "schema": { - "type": "object", - "description": "Common error model", - "properties": { - "class": { - "type": "string", - "description": "Class of the error" - }, - "message": { - "type": "string", - "description": "Error message" - } - } - }, - "examples": { - "Server::InternalServerError::Maintenance": { - "value": { - "class": "Server::InternalServerError::Maintenance", - "message": "The Managed Rancher Service API is in maintenance mode. Only GET endpoints are available." - } - } - } - } - } } }, "tags": [ - "Rancher" + "Storage", + "File" ], "x-badges": [ { - "color": "green", - "label": "Stable production version" + "color": "blue", + "label": "Alpha version" } ], "x-iam-actions": [ { - "name": "publicCloudProject:apiovh:rancher/task/get", + "name": "publicCloudProject:apiovh:storage/file/network/get", "required": true } ], "x-response-identifier": "id" } }, - "/publicCloud/project/{projectId}/reference/rancher/plan": { + "/publicCloud/project/{projectId}/storage/file/share": { "get": { - "summary": "List available plans for creating a managed Rancher service", + "summary": "List Public Cloud file storages", "security": [ { "oAuth2AuthCode": [] @@ -3837,22 +6059,156 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/publicCloud.rancher.PlanReference" + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorage" + } + } + } + } + } + }, + "tags": [ + "Storage", + "File" + ], + "x-badges": [ + { + "color": "blue", + "label": "Alpha version" + } + ], + "x-iam-actions": [ + { + "name": "publicCloudProject:apiovh:share/get", + "required": true + } + ], + "x-response-identifier": "id", + "x-expanded-response": "PublicCloudStorageFileFileStorage" + }, + "post": { + "summary": "Create a new Public Cloud file storage", + "security": [ + { + "oAuth2AuthCode": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "projectId", + "description": "Project ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageCreation" + }, + "examples": { + "Create file storage": { + "value": { + "targetSpec": { + "accessRules": [ + { + "accessLevel": "READ_WRITE", + "accessTo": "10.0.0.42" + } + ], + "description": "Production data share", + "location": { + "region": "GRA1" + }, + "name": "my-share", + "protocol": "NFS", + "shareNetwork": { + "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901" + }, + "shareType": "STANDARD_1AZ", + "size": 100 + } + }, + "summary": "Create an NFS file storage with access rules" + } + } + } + } + }, + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorage" + } + } + } + }, + "400": { + "description": "Error 400 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } } }, "examples": { - "Example": { - "value": [ - { - "name": "OVHCLOUD_EDITION", - "status": "AVAILABLE" - }, - { - "name": "STANDARD", - "status": "AVAILABLE" - } - ], - "summary": "Example" + "Client::BadRequest::InvalidParameter": { + "value": { + "class": "Client::BadRequest::InvalidParameter", + "message": "Invalid parameter in the request" + } + }, + "Client::BadRequest::ServiceNotAvailableInRegion": { + "value": { + "class": "Client::BadRequest::ServiceNotAvailableInRegion", + "message": "This service is not available in the selected region" + } + } + } + } + } + }, + "409": { + "description": "Error 409 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "examples": { + "Client::Conflict::RegionInMaintenance": { + "value": { + "class": "Client::Conflict::RegionInMaintenance", + "message": "This region is currently in maintenance" + } } } } @@ -3860,26 +6216,26 @@ } }, "tags": [ - "Rancher", - "Reference" + "Storage", + "File" ], "x-badges": [ { - "color": "green", - "label": "Stable production version" + "color": "blue", + "label": "Alpha version" } ], "x-iam-actions": [ { - "name": "publicCloudProject:apiovh:reference/rancher/plan/get", + "name": "publicCloudProject:apiovh:share/create", "required": true } ] } }, - "/publicCloud/project/{projectId}/reference/rancher/version": { - "get": { - "summary": "List available versions for creating a managed Rancher service", + "/publicCloud/project/{projectId}/storage/file/share/{fileStorageId}": { + "delete": { + "summary": "Delete a Public Cloud file storage", "security": [ { "oAuth2AuthCode": [] @@ -3887,19 +6243,13 @@ ], "parameters": [ { - "in": "header", - "name": "X-Pagination-Cursor", - "description": "Pagination cursor", - "schema": { - "type": "string" - } - }, - { - "in": "header", - "name": "X-Pagination-Size", - "description": "Pagination size", + "in": "path", + "name": "fileStorageId", + "description": "File storage ID", + "required": true, "schema": { - "type": "integer" + "type": "string", + "format": "uuid" } }, { @@ -3918,26 +6268,70 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/publicCloud.rancher.VersionReference" + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorage" + } + } + } + }, + "404": { + "description": "Error 404 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } } }, "examples": { - "Example": { - "value": [ - { - "changelogUrl": "https://github.com/rancher/rancher/releases/tag/v1.0.0", - "name": "1.0.0", - "status": "AVAILABLE" - }, - { - "changelogUrl": "https://github.com/rancher/rancher/releases/tag/v1.1.0", - "name": "1.1.0", - "status": "AVAILABLE" - } - ], - "summary": "Example" + "Client::NotFound::ShareDoesNotExist": { + "value": { + "class": "Client::NotFound::ShareDoesNotExist", + "message": "File share not found" + } + } + } + } + } + }, + "409": { + "description": "Error 409 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "examples": { + "Client::Conflict::ResourceAlreadyBeingDeleted": { + "value": { + "class": "Client::Conflict::ResourceAlreadyBeingDeleted", + "message": "Resource is already being deleted" + } + }, + "Client::Conflict::ResourceInInvalidState": { + "value": { + "class": "Client::Conflict::ResourceInInvalidState", + "message": "Resource cannot be modified in its current state" + } } } } @@ -3945,30 +6339,24 @@ } }, "tags": [ - "Rancher", - "Reference" + "Storage", + "File" ], "x-badges": [ { - "color": "green", - "label": "Stable production version" + "color": "blue", + "label": "Alpha version" } ], "x-iam-actions": [ { - "name": "publicCloudProject:apiovh:reference/rancher/version/get", + "name": "publicCloudProject:apiovh:share/delete", "required": true } ] - } - }, - "/publicCloud/reference/rancher/plan": { - "get": { - "summary": "List available plans for creating a managed Rancher service", - "deprecated": true, - "x-deprecation-date": "2024-05-20T00:00:00Z", - "x-deletion-date": "2024-09-01T00:00:00Z", - "x-replacement-route": "/v2/publicCloud/project/{projectId}/reference/rancher", + }, + "get": { + "summary": "Get a Public Cloud file storage", "security": [ { "oAuth2AuthCode": [] @@ -3976,19 +6364,22 @@ ], "parameters": [ { - "in": "header", - "name": "X-Pagination-Cursor", - "description": "Pagination cursor", + "in": "path", + "name": "fileStorageId", + "description": "File storage ID", + "required": true, "schema": { - "type": "string" + "type": "string", + "format": "uuid" } }, { - "in": "header", - "name": "X-Pagination-Size", - "description": "Pagination size", + "in": "path", + "name": "projectId", + "description": "Project ID", + "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -3998,48 +6389,121 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/publicCloud.rancher.PlanReference" - } + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorage" }, "examples": { "Example": { - "value": [ - { - "name": "OVHCLOUD_EDITION", - "status": "AVAILABLE" + "value": { + "checksum": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6", + "createdAt": "2026-02-10T14:30:00Z", + "currentState": { + "accessRules": [ + { + "accessLevel": "READ_WRITE", + "accessTo": "10.0.0.42", + "createdAt": "2026-02-10T14:32:00Z", + "id": "e5f6a7b8-c901-2345-def6-789012abcdef", + "state": "ACTIVE" + } + ], + "description": "Production data share", + "exportLocations": [ + { + "path": "10.0.0.1:/shares/share-abc123", + "preferred": true + } + ], + "location": { + "region": "GRA1" + }, + "name": "my-share", + "protocol": "NFS", + "shareNetwork": { + "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901" + }, + "shareType": "STANDARD_1AZ", + "size": 100 }, - { - "name": "STANDARD", - "status": "AVAILABLE" - } - ], + "currentTasks": null, + "id": "d4e5f6a7-b890-1234-cdef-567890abcdef", + "resourceStatus": "READY", + "targetSpec": { + "accessRules": [ + { + "accessLevel": "READ_WRITE", + "accessTo": "10.0.0.42" + } + ], + "description": "Production data share", + "location": { + "region": "GRA1" + }, + "name": "my-share", + "protocol": "NFS", + "shareNetwork": { + "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901" + }, + "shareType": "STANDARD_1AZ", + "size": 100 + }, + "updatedAt": "2026-02-10T14:35:00Z" + }, "summary": "Example" } } } } + }, + "404": { + "description": "Error 404 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "examples": { + "Client::NotFound::ShareDoesNotExist": { + "value": { + "class": "Client::NotFound::ShareDoesNotExist", + "message": "File share not found" + } + } + } + } + } } }, "tags": [ - "Reference" + "Storage", + "File" ], "x-badges": [ { - "color": "red", - "label": "Deprecated, will be removed" + "color": "blue", + "label": "Alpha version" } - ] - } - }, - "/publicCloud/reference/rancher/version": { - "get": { - "summary": "List available versions for creating a managed Rancher service", - "deprecated": true, - "x-deprecation-date": "2024-05-20T00:00:00Z", - "x-deletion-date": "2024-09-01T00:00:00Z", - "x-replacement-route": "/v2/publicCloud/project/{projectId}/reference/rancher", + ], + "x-iam-actions": [ + { + "name": "publicCloudProject:apiovh:share/get", + "required": true + } + ], + "x-response-identifier": "id" + }, + "put": { + "summary": "Update an existing Public Cloud file storage", "security": [ { "oAuth2AuthCode": [] @@ -4047,48 +6511,156 @@ ], "parameters": [ { - "in": "header", - "name": "X-Pagination-Cursor", - "description": "Pagination cursor", + "in": "path", + "name": "fileStorageId", + "description": "File storage ID", + "required": true, "schema": { - "type": "string" + "type": "string", + "format": "uuid" } }, { - "in": "header", - "name": "X-Pagination-Size", - "description": "Pagination size", + "in": "path", + "name": "projectId", + "description": "Project ID", + "required": true, "schema": { - "type": "integer" + "type": "string" } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageUpdate" + }, + "examples": { + "Update file storage": { + "value": { + "checksum": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6", + "targetSpec": { + "accessRules": [ + { + "accessLevel": "READ_WRITE", + "accessTo": "10.0.0.42" + }, + { + "accessLevel": "READ_ONLY", + "accessTo": "10.0.0.43" + } + ], + "name": "my-share-renamed", + "size": 200 + } + }, + "summary": "Update name, extend size, or modify access rules" + } + } + } + } + }, "responses": { "200": { "description": "successful operation", "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/publicCloud.rancher.VersionReference" + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorage" + } + } + } + }, + "400": { + "description": "Error 400 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } } }, "examples": { - "Example": { - "value": [ - { - "changelogUrl": "https://github.com/rancher/rancher/releases/tag/v1.0.0", - "name": "1.0.0", - "status": "AVAILABLE" - }, - { - "changelogUrl": "https://github.com/rancher/rancher/releases/tag/v1.1.0", - "name": "1.1.0", - "status": "AVAILABLE" - } - ], - "summary": "Example" + "Client::BadRequest::InvalidParameter": { + "value": { + "class": "Client::BadRequest::InvalidParameter", + "message": "Invalid parameter in the request" + } + } + } + } + } + }, + "404": { + "description": "Error 404 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "examples": { + "Client::NotFound::ShareDoesNotExist": { + "value": { + "class": "Client::NotFound::ShareDoesNotExist", + "message": "File share not found" + } + } + } + } + } + }, + "409": { + "description": "Error 409 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "examples": { + "Client::Conflict::ChecksumMismatch": { + "value": { + "class": "Client::Conflict::ChecksumMismatch", + "message": "Checksum mismatch — a concurrent update was detected. Refresh the resource and retry" + } + }, + "Client::Conflict::ResourceInInvalidState": { + "value": { + "class": "Client::Conflict::ResourceInInvalidState", + "message": "Resource cannot be modified in its current state" + } } } } @@ -4096,19 +6668,26 @@ } }, "tags": [ - "Reference" + "Storage", + "File" ], "x-badges": [ { - "color": "red", - "label": "Deprecated, will be removed" + "color": "blue", + "label": "Alpha version" + } + ], + "x-iam-actions": [ + { + "name": "publicCloudProject:apiovh:share/edit", + "required": true } ] } }, - "/publicCloud/project/{projectId}/sshKey": { + "/publicCloud/project/{projectId}/storage/file/snapshot": { "get": { - "summary": "List SSH keys", + "summary": "List Public Cloud file storage snapshots", "security": [ { "oAuth2AuthCode": [] @@ -4149,7 +6728,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/components/schemas/publicCloud.sshKey.SSHKey" + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageSnapshot" } } } @@ -4157,7 +6736,8 @@ } }, "tags": [ - "Compute" + "Storage", + "File" ], "x-badges": [ { @@ -4167,15 +6747,15 @@ ], "x-iam-actions": [ { - "name": "publicCloudProject:apiovh:sshKey/get", + "name": "publicCloudProject:apiovh:storage/file/snapshot/get", "required": true } ], - "x-response-identifier": "name", - "x-expanded-response": "PublicCloudSshKeySSHKey" + "x-response-identifier": "id", + "x-expanded-response": "PublicCloudStorageFileFileStorageSnapshot" }, "post": { - "summary": "Create an SSH key", + "summary": "Create a new Public Cloud file storage snapshot", "security": [ { "oAuth2AuthCode": [] @@ -4197,7 +6777,21 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/publicCloud.sshKey.SSHKeyCreation" + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageSnapshotCreation" + }, + "examples": { + "Create snapshot": { + "value": { + "targetSpec": { + "description": "Daily backup snapshot", + "name": "my-share-snapshot", + "share": { + "id": "d4e5f6a7-b890-1234-cdef-567890abcdef" + } + } + }, + "summary": "Create a snapshot of a file storage" + } } } } @@ -4208,13 +6802,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/publicCloud.sshKey.SSHKey" + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageSnapshot" } } } }, - "409": { - "description": "Error 409 response", + "400": { + "description": "Error 400 response", "content": { "application/json": { "schema": { @@ -4232,75 +6826,47 @@ } }, "examples": { - "Client::Conflict::NameAlreadyInUse": { + "Client::BadRequest::ServiceNotAvailableInRegion": { "value": { - "class": "Client::Conflict::NameAlreadyInUse", - "message": "This name is already in use" + "class": "Client::BadRequest::ServiceNotAvailableInRegion", + "message": "This service is not available in the selected region" } } } } } - } - }, - "tags": [ - "Compute" - ], - "x-badges": [ - { - "color": "blue", - "label": "Alpha version" - } - ], - "x-iam-actions": [ - { - "name": "publicCloudProject:apiovh:sshKey/create", - "required": true - } - ] - } - }, - "/publicCloud/project/{projectId}/sshKey/{name}": { - "delete": { - "summary": "Delete an SSH key", - "security": [ - { - "oAuth2AuthCode": [] - } - ], - "parameters": [ - { - "in": "path", - "name": "name", - "description": "Name", - "required": true, - "schema": { - "type": "string" - } }, - { - "in": "path", - "name": "projectId", - "description": "Project ID", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "successful operation", + "404": { + "description": "Error 404 response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/publicCloud.sshKey.SSHKey" + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "examples": { + "Client::NotFound::ShareDoesNotExist": { + "value": { + "class": "Client::NotFound::ShareDoesNotExist", + "message": "File share not found" + } + } } } } }, - "404": { - "description": "Error 404 response", + "409": { + "description": "Error 409 response", "content": { "application/json": { "schema": { @@ -4318,10 +6884,10 @@ } }, "examples": { - "Client::NotFound::SSHKeyDoesNotExist": { + "Client::Conflict::RegionInMaintenance": { "value": { - "class": "Client::NotFound::SSHKeyDoesNotExist", - "message": "SSH key not found" + "class": "Client::Conflict::RegionInMaintenance", + "message": "This region is currently in maintenance" } } } @@ -4330,7 +6896,8 @@ } }, "tags": [ - "Compute" + "Storage", + "File" ], "x-badges": [ { @@ -4340,13 +6907,15 @@ ], "x-iam-actions": [ { - "name": "publicCloudProject:apiovh:sshKey/delete", + "name": "publicCloudProject:apiovh:storage/file/snapshot/create", "required": true } ] - }, - "get": { - "summary": "Get an SSH key", + } + }, + "/publicCloud/project/{projectId}/storage/file/snapshot/{snapshotId}": { + "delete": { + "summary": "Delete a Public Cloud file storage snapshot", "security": [ { "oAuth2AuthCode": [] @@ -4355,8 +6924,8 @@ "parameters": [ { "in": "path", - "name": "name", - "description": "Name", + "name": "projectId", + "description": "Project ID", "required": true, "schema": { "type": "string" @@ -4364,11 +6933,12 @@ }, { "in": "path", - "name": "projectId", - "description": "Project ID", + "name": "snapshotId", + "description": "Snapshot ID", "required": true, "schema": { - "type": "string" + "type": "string", + "format": "uuid" } } ], @@ -4378,7 +6948,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/publicCloud.sshKey.SSHKey" + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageSnapshot" } } } @@ -4402,10 +6972,51 @@ } }, "examples": { - "Client::NotFound::SSHKeyDoesNotExist": { + "Client::NotFound::ShareDoesNotExist": { "value": { - "class": "Client::NotFound::SSHKeyDoesNotExist", - "message": "SSH key not found" + "class": "Client::NotFound::ShareDoesNotExist", + "message": "File share not found" + } + }, + "Client::NotFound::SnapshotDoesNotExist": { + "value": { + "class": "Client::NotFound::SnapshotDoesNotExist", + "message": "Snapshot not found" + } + } + } + } + } + }, + "409": { + "description": "Error 409 response", + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Common error model", + "properties": { + "class": { + "type": "string", + "description": "Class of the error" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "examples": { + "Client::Conflict::ResourceAlreadyBeingDeleted": { + "value": { + "class": "Client::Conflict::ResourceAlreadyBeingDeleted", + "message": "Resource is already being deleted" + } + }, + "Client::Conflict::ResourceInInvalidState": { + "value": { + "class": "Client::Conflict::ResourceInInvalidState", + "message": "Resource cannot be modified in its current state" } } } @@ -4414,7 +7025,8 @@ } }, "tags": [ - "Compute" + "Storage", + "File" ], "x-badges": [ { @@ -4424,17 +7036,13 @@ ], "x-iam-actions": [ { - "name": "publicCloudProject:apiovh:sshKey/get", + "name": "publicCloudProject:apiovh:storage/file/snapshot/delete", "required": true } - ], - "x-response-identifier": "name" - } - }, - "/publicCloud/project/{projectId}/quota": { + ] + }, "get": { - "summary": "Get the project quota", - "description": "Get the project quota. When the `region` query parameter is set, the response narrows `targetSpec.regions` and `currentState.regions` to that single region. Omit it to get all regions.", + "summary": "Get a Public Cloud file storage snapshot", "security": [ { "oAuth2AuthCode": [] @@ -4451,11 +7059,13 @@ } }, { - "in": "query", - "name": "region", - "description": "Optional region filter", + "in": "path", + "name": "snapshotId", + "description": "Snapshot ID", + "required": true, "schema": { - "type": "string" + "type": "string", + "format": "uuid" } } ], @@ -4465,42 +7075,44 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/publicCloud.quota.Quota" - } - } - } - }, - "400": { - "description": "Error 400 response", - "content": { - "application/json": { - "schema": { - "type": "object", - "description": "Common error model", - "properties": { - "class": { - "type": "string", - "description": "Class of the error" - }, - "message": { - "type": "string", - "description": "Error message" - } - } + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageSnapshot" }, "examples": { - "Client::BadRequest::ServiceNotAvailableInRegion": { + "Example": { "value": { - "class": "Client::BadRequest::ServiceNotAvailableInRegion", - "message": "This service is not available in the selected region" - } + "checksum": "b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6a7", + "createdAt": "2026-02-10T15:00:00Z", + "currentState": { + "description": "Daily backup snapshot", + "location": { + "region": "GRA1" + }, + "name": "my-share-snapshot", + "share": { + "id": "d4e5f6a7-b890-1234-cdef-567890abcdef" + }, + "size": 1 + }, + "currentTasks": null, + "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + "resourceStatus": "READY", + "targetSpec": { + "description": "Daily backup snapshot", + "name": "my-share-snapshot", + "share": { + "id": "d4e5f6a7-b890-1234-cdef-567890abcdef" + } + }, + "updatedAt": "2026-02-10T15:05:00Z" + }, + "summary": "Example" } } } } }, - "409": { - "description": "Error 409 response", + "404": { + "description": "Error 404 response", "content": { "application/json": { "schema": { @@ -4518,10 +7130,16 @@ } }, "examples": { - "Client::Conflict::ResourceInInvalidState": { + "Client::NotFound::ShareDoesNotExist": { "value": { - "class": "Client::Conflict::ResourceInInvalidState", - "message": "Resource cannot be modified in its current state" + "class": "Client::NotFound::ShareDoesNotExist", + "message": "File share not found" + } + }, + "Client::NotFound::SnapshotDoesNotExist": { + "value": { + "class": "Client::NotFound::SnapshotDoesNotExist", + "message": "Snapshot not found" } } } @@ -4530,7 +7148,8 @@ } }, "tags": [ - "Quota" + "Storage", + "File" ], "x-badges": [ { @@ -4540,15 +7159,14 @@ ], "x-iam-actions": [ { - "name": "publicCloudProject:apiovh:quota/get", + "name": "publicCloudProject:apiovh:storage/file/snapshot/get", "required": true } ], "x-response-identifier": "id" }, "put": { - "summary": "Update the project quota", - "description": "Update the project quota. Regions omitted from `targetSpec.regions` are left unchanged. `preventAutomaticQuotaUpgrade` is required.", + "summary": "Update an existing Public Cloud file storage snapshot", "security": [ { "oAuth2AuthCode": [] @@ -4563,6 +7181,16 @@ "schema": { "type": "string" } + }, + { + "in": "path", + "name": "snapshotId", + "description": "Snapshot ID", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } } ], "requestBody": { @@ -4570,7 +7198,19 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/publicCloud.quota.QuotaUpdate" + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageSnapshotUpdate" + }, + "examples": { + "Update snapshot": { + "value": { + "checksum": "b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6a7", + "targetSpec": { + "description": "Updated backup snapshot", + "name": "my-share-snapshot-renamed" + } + }, + "summary": "Update snapshot name and description" + } } } } @@ -4581,13 +7221,13 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/publicCloud.quota.Quota" + "$ref": "#/components/schemas/publicCloud.storage.file.FileStorageSnapshot" } } } }, - "400": { - "description": "Error 400 response", + "404": { + "description": "Error 404 response", "content": { "application/json": { "schema": { @@ -4605,16 +7245,16 @@ } }, "examples": { - "Client::BadRequest::InvalidParameter": { + "Client::NotFound::ShareDoesNotExist": { "value": { - "class": "Client::BadRequest::InvalidParameter", - "message": "Invalid parameter in the request" + "class": "Client::NotFound::ShareDoesNotExist", + "message": "File share not found" } }, - "Client::BadRequest::ServiceNotAvailableInRegion": { + "Client::NotFound::SnapshotDoesNotExist": { "value": { - "class": "Client::BadRequest::ServiceNotAvailableInRegion", - "message": "This service is not available in the selected region" + "class": "Client::NotFound::SnapshotDoesNotExist", + "message": "Snapshot not found" } } } @@ -4658,7 +7298,8 @@ } }, "tags": [ - "Quota" + "Storage", + "File" ], "x-badges": [ { @@ -4668,7 +7309,7 @@ ], "x-iam-actions": [ { - "name": "publicCloudProject:apiovh:quota/edit", + "name": "publicCloudProject:apiovh:storage/file/snapshot/edit", "required": true } ] diff --git a/internal/cmd/cloud_storage_file.go b/internal/cmd/cloud_storage_file.go index b183182b..fdb71782 100644 --- a/internal/cmd/cloud_storage_file.go +++ b/internal/cmd/cloud_storage_file.go @@ -6,6 +6,7 @@ package cmd import ( "github.com/ovh/ovhcloud-cli/internal/assets" + "github.com/ovh/ovhcloud-cli/internal/flags" "github.com/ovh/ovhcloud-cli/internal/services/cloud" "github.com/spf13/cobra" ) @@ -13,12 +14,18 @@ import ( func initCloudStorageFileCommand(cloudCmd *cobra.Command) { storageFileCmd := &cobra.Command{ Use: "file", - Short: "Manage file storage shares in the given cloud project", + Short: "Manage file storage in the given cloud project", } storageFileCmd.PersistentFlags().StringVar(&cloud.CloudProject, "cloud-project", "", "Cloud project ID") - storageFileCmd.PersistentFlags().StringVar(&cloud.ShareRegion, "region", "", "Region (skip region discovery if set)") - // Share commands + initCloudStorageFileShareCommand(storageFileCmd) + initCloudStorageFileSnapshotCommand(storageFileCmd) + initCloudStorageFileNetworkCommand(storageFileCmd) + + cloudCmd.AddCommand(storageFileCmd) +} + +func initCloudStorageFileShareCommand(storageFileCmd *cobra.Command) { shareCmd := &cobra.Command{ Use: "share", Short: "Manage file storage shares", @@ -28,141 +35,171 @@ func initCloudStorageFileCommand(cloudCmd *cobra.Command) { shareListCmd := &cobra.Command{ Use: "list", Aliases: []string{"ls"}, - Short: "List shares", + Short: "List file storage shares", Run: cloud.ListShares, } shareCmd.AddCommand(withFilterFlag(shareListCmd)) shareCmd.AddCommand(&cobra.Command{ Use: "get ", - Short: "Get a specific share", + Short: "Get a specific file storage share", Run: cloud.GetShare, Args: cobra.ExactArgs(1), }) shareCmd.AddCommand(getShareCreateCmd()) - - shareEditCmd := &cobra.Command{ - Use: "edit ", - Short: "Edit the given share", - Run: cloud.EditShare, - Args: cobra.ExactArgs(1), - } - shareEditCmd.Flags().StringVar(&cloud.ShareEditSpec.Description, "description", "", "Share description") - shareEditCmd.Flags().StringVar(&cloud.ShareEditSpec.Name, "name", "", "Share name") - shareEditCmd.Flags().IntVar(&cloud.ShareEditSpec.NewSize, "new-size", 0, "New share size in GB") - addInteractiveEditorFlag(shareEditCmd) - shareCmd.AddCommand(shareEditCmd) + shareCmd.AddCommand(getShareEditCmd()) shareCmd.AddCommand(&cobra.Command{ Use: "delete ", - Short: "Delete the given share", + Short: "Delete the given file storage share", Run: cloud.DeleteShare, Args: cobra.ExactArgs(1), }) +} - // ACL subcommands - aclCmd := &cobra.Command{ - Use: "acl", - Short: "Manage share access control lists", - } - shareCmd.AddCommand(aclCmd) - - aclListCmd := &cobra.Command{ - Use: "list ", - Aliases: []string{"ls"}, - Short: "List ACLs for the given share", - Run: cloud.ListShareACLs, - Args: cobra.ExactArgs(1), +func getShareCreateCmd() *cobra.Command { + shareCreateCmd := &cobra.Command{ + Use: "create", + Short: "Create a new file storage share", + Run: cloud.CreateShare, } - aclCmd.AddCommand(withFilterFlag(aclListCmd)) + shareCreateCmd.Flags().StringVar(&cloud.ShareSpec.TargetSpec.Name, "name", "", "Name of the file storage share") + shareCreateCmd.Flags().StringVar(&cloud.ShareSpec.TargetSpec.Description, "description", "", "Description of the file storage share") + shareCreateCmd.Flags().StringVar(&cloud.ShareSpec.TargetSpec.Protocol, "protocol", "", "File sharing protocol (NFS)") + shareCreateCmd.Flags().StringVar(&cloud.ShareSpec.TargetSpec.ShareType, "share-type", "", "File storage type / performance tier (STANDARD_1AZ)") + shareCreateCmd.Flags().IntVar(&cloud.ShareSpec.TargetSpec.Size, "size", 0, "Size of the file storage share in GB") + shareCreateCmd.Flags().StringVar(&cloud.ShareLocationRegion, "region", "", "Region where the share is created") + shareCreateCmd.Flags().StringVar(&cloud.ShareLocationAvailabilityZone, "availability-zone", "", "Availability zone within the region") + shareCreateCmd.Flags().StringVar(&cloud.ShareNetworkID, "share-network-id", "", "ID of the share network to attach the share to") + shareCreateCmd.Flags().BoolVar(&flags.WaitForTask, "wait", false, "Wait for the share to be ready before exiting") + + addParameterFileFlags(shareCreateCmd, false, assets.CloudV2OpenapiSchema, "/publicCloud/project/{projectId}/storage/file/share", "post", cloud.FileStorageShareCreateExample, nil) + addInteractiveEditorFlag(shareCreateCmd) + markFlagsMutuallyExclusive(shareCreateCmd, "from-file", "editor") - aclCmd.AddCommand(&cobra.Command{ - Use: "get ", - Short: "Get a specific ACL for the given share", - Run: cloud.GetShareACL, - Args: cobra.ExactArgs(2), - }) + return shareCreateCmd +} - aclCreateCmd := &cobra.Command{ - Use: "create ", - Short: "Create an ACL for the given share", - Run: cloud.CreateShareACL, +func getShareEditCmd() *cobra.Command { + shareEditCmd := &cobra.Command{ + Use: "edit ", + Short: "Edit the given file storage share", + Run: cloud.EditShare, Args: cobra.ExactArgs(1), } - aclCreateCmd.Flags().StringVar(&cloud.ShareACLSpec.AccessLevel, "access-level", "", "Access level (ro, rw)") - aclCreateCmd.Flags().StringVar(&cloud.ShareACLSpec.AccessTo, "access-to", "", "Access target (IP address or CIDR)") - aclCmd.AddCommand(aclCreateCmd) - - aclCmd.AddCommand(&cobra.Command{ - Use: "delete ", - Short: "Delete an ACL from the given share", - Run: cloud.DeleteShareACL, - Args: cobra.ExactArgs(2), - }) + shareEditCmd.Flags().StringVar(&cloud.ShareEditSpec.TargetSpec.Name, "name", "", "Name of the file storage share") + shareEditCmd.Flags().StringVar(&cloud.ShareEditSpec.TargetSpec.Description, "description", "", "Description of the file storage share") + shareEditCmd.Flags().IntVar(&cloud.ShareEditSpec.TargetSpec.Size, "size", 0, "New size of the file storage share in GB") + + addParameterFileFlags(shareEditCmd, true, assets.CloudV2OpenapiSchema, "/publicCloud/project/{projectId}/storage/file/share/{fileStorageId}", "put", "", nil) + addInteractiveEditorFlag(shareEditCmd) + markFlagsMutuallyExclusive(shareEditCmd, "from-file", "editor") + + return shareEditCmd +} - // Snapshot subcommands +func initCloudStorageFileSnapshotCommand(storageFileCmd *cobra.Command) { snapshotCmd := &cobra.Command{ Use: "snapshot", - Short: "Manage share snapshots", + Short: "Manage file storage snapshots", } - shareCmd.AddCommand(snapshotCmd) + storageFileCmd.AddCommand(snapshotCmd) snapshotListCmd := &cobra.Command{ - Use: "list ", + Use: "list", Aliases: []string{"ls"}, - Short: "List snapshots for the given share", - Run: cloud.ListShareSnapshots, - Args: cobra.ExactArgs(1), + Short: "List file storage snapshots", + Run: cloud.ListFileStorageSnapshots, } snapshotCmd.AddCommand(withFilterFlag(snapshotListCmd)) snapshotCmd.AddCommand(&cobra.Command{ - Use: "get ", - Short: "Get a specific snapshot for the given share", - Run: cloud.GetShareSnapshot, - Args: cobra.ExactArgs(2), + Use: "get ", + Short: "Get a specific file storage snapshot", + Run: cloud.GetFileStorageSnapshot, + Args: cobra.ExactArgs(1), }) snapshotCreateCmd := &cobra.Command{ - Use: "create ", - Short: "Create a snapshot of the given share", - Run: cloud.CreateShareSnapshot, - Args: cobra.ExactArgs(1), + Use: "create", + Short: "Create a new file storage snapshot", + Run: cloud.CreateFileStorageSnapshot, } - snapshotCreateCmd.Flags().StringVar(&cloud.ShareSnapshotSpec.Description, "description", "", "Snapshot description") - snapshotCreateCmd.Flags().StringVar(&cloud.ShareSnapshotSpec.Name, "name", "", "Snapshot name") + snapshotCreateCmd.Flags().StringVar(&cloud.SnapshotSpec.TargetSpec.Name, "name", "", "Name of the snapshot") + snapshotCreateCmd.Flags().StringVar(&cloud.SnapshotSpec.TargetSpec.Description, "description", "", "Description of the snapshot") + snapshotCreateCmd.Flags().StringVar(&cloud.SnapshotShareID, "share-id", "", "ID of the file storage share to snapshot") + snapshotCreateCmd.Flags().BoolVar(&flags.WaitForTask, "wait", false, "Wait for the snapshot to be ready before exiting") snapshotCmd.AddCommand(snapshotCreateCmd) + snapshotEditCmd := &cobra.Command{ + Use: "edit ", + Short: "Edit the given file storage snapshot", + Run: cloud.EditFileStorageSnapshot, + Args: cobra.ExactArgs(1), + } + snapshotEditCmd.Flags().StringVar(&cloud.SnapshotEditSpec.TargetSpec.Name, "name", "", "Name of the snapshot") + snapshotEditCmd.Flags().StringVar(&cloud.SnapshotEditSpec.TargetSpec.Description, "description", "", "Description of the snapshot") + addInteractiveEditorFlag(snapshotEditCmd) + snapshotCmd.AddCommand(snapshotEditCmd) + snapshotCmd.AddCommand(&cobra.Command{ - Use: "delete ", - Short: "Delete a snapshot from the given share", - Run: cloud.DeleteShareSnapshot, - Args: cobra.ExactArgs(2), + Use: "delete ", + Short: "Delete the given file storage snapshot", + Run: cloud.DeleteFileStorageSnapshot, + Args: cobra.ExactArgs(1), }) - - cloudCmd.AddCommand(storageFileCmd) } -func getShareCreateCmd() *cobra.Command { - shareCreateCmd := &cobra.Command{ - Use: "create ", - Short: "Create a new share", - Run: cloud.CreateShare, - Args: cobra.ExactArgs(1), +func initCloudStorageFileNetworkCommand(storageFileCmd *cobra.Command) { + networkCmd := &cobra.Command{ + Use: "network", + Short: "Manage file storage share networks", } - shareCreateCmd.Flags().StringVar(&cloud.ShareSpec.AvailabilityZone, "availability-zone", "", "Availability zone (required in 3AZ regions)") - shareCreateCmd.Flags().StringVar(&cloud.ShareSpec.Description, "description", "", "Share description") - shareCreateCmd.Flags().StringVar(&cloud.ShareSpec.Name, "name", "", "Share name") - shareCreateCmd.Flags().StringVar(&cloud.ShareSpec.NetworkId, "network-id", "", "Network ID") - shareCreateCmd.Flags().IntVar(&cloud.ShareSpec.Size, "size", 0, "Share size in GB") - shareCreateCmd.Flags().StringVar(&cloud.ShareSpec.SnapshotId, "snapshot-id", "", "Snapshot ID to create the share from") - shareCreateCmd.Flags().StringVar(&cloud.ShareSpec.SubnetId, "subnet-id", "", "Subnet ID") - shareCreateCmd.Flags().StringVar(&cloud.ShareSpec.Type, "type", "", "Share type") - - addParameterFileFlags(shareCreateCmd, false, assets.CloudOpenapiSchema, "/cloud/project/{serviceName}/region/{regionName}/share", "post", cloud.ShareCreateExample, nil) - addInteractiveEditorFlag(shareCreateCmd) - markFlagsMutuallyExclusive(shareCreateCmd, "from-file", "editor") + storageFileCmd.AddCommand(networkCmd) - return shareCreateCmd + networkListCmd := &cobra.Command{ + Use: "list", + Aliases: []string{"ls"}, + Short: "List file storage share networks", + Run: cloud.ListFileStorageNetworks, + } + networkCmd.AddCommand(withFilterFlag(networkListCmd)) + + networkCmd.AddCommand(&cobra.Command{ + Use: "get ", + Short: "Get a specific file storage share network", + Run: cloud.GetFileStorageNetwork, + Args: cobra.ExactArgs(1), + }) + + networkCmd.AddCommand(getFileStorageNetworkCreateCmd()) + + networkCmd.AddCommand(&cobra.Command{ + Use: "delete ", + Short: "Delete the given file storage share network", + Run: cloud.DeleteFileStorageNetwork, + Args: cobra.ExactArgs(1), + }) +} + +func getFileStorageNetworkCreateCmd() *cobra.Command { + networkCreateCmd := &cobra.Command{ + Use: "create", + Short: "Create a new file storage share network", + Run: cloud.CreateFileStorageNetwork, + } + networkCreateCmd.Flags().StringVar(&cloud.NetworkSpec.TargetSpec.Name, "name", "", "Name of the share network") + networkCreateCmd.Flags().StringVar(&cloud.NetworkSpec.TargetSpec.Description, "description", "", "Description of the share network") + networkCreateCmd.Flags().StringVar(&cloud.NetworkLocationRegion, "region", "", "Region where the share network is created") + networkCreateCmd.Flags().StringVar(&cloud.NetworkLocationAvailabilityZone, "availability-zone", "", "Availability zone within the region") + networkCreateCmd.Flags().StringVar(&cloud.NetworkNetworkID, "network-id", "", "ID of the private network to back the share network") + networkCreateCmd.Flags().StringVar(&cloud.NetworkSubnetID, "subnet-id", "", "ID of the subnet to back the share network") + networkCreateCmd.Flags().BoolVar(&flags.WaitForTask, "wait", false, "Wait for the share network to be ready before exiting") + + addParameterFileFlags(networkCreateCmd, false, assets.CloudV2OpenapiSchema, "/publicCloud/project/{projectId}/storage/file/network", "post", cloud.FileStorageNetworkCreateExample, nil) + addInteractiveEditorFlag(networkCreateCmd) + markFlagsMutuallyExclusive(networkCreateCmd, "from-file", "editor") + + return networkCreateCmd } diff --git a/internal/cmd/cloud_storage_file_test.go b/internal/cmd/cloud_storage_file_test.go new file mode 100644 index 00000000..4f0b82d9 --- /dev/null +++ b/internal/cmd/cloud_storage_file_test.go @@ -0,0 +1,138 @@ +// SPDX-FileCopyrightText: 2025 OVH SAS +// +// SPDX-License-Identifier: Apache-2.0 + +package cmd_test + +import ( + "net/http" + + "github.com/jarcoal/httpmock" + "github.com/maxatome/go-testdeep/td" + "github.com/maxatome/tdhttpmock" + "github.com/ovh/ovhcloud-cli/internal/cmd" +) + +func (ms *MockSuite) TestCloudStorageFileShareListCmd(assert, require *td.T) { + httpmock.RegisterResponder(http.MethodGet, + "https://eu.api.ovh.com/v2/publicCloud/project/fakeProjectID/storage/file/share", + httpmock.NewStringResponder(200, `[ + { + "id": "share-1234", + "resourceStatus": "READY", + "currentState": { + "name": "my-share", + "protocol": "NFS", + "size": 100, + "location": {"region": "GRA1"} + } + } + ]`), + ) + + out, err := cmd.Execute("cloud", "storage", "file", "share", "list", "--cloud-project", "fakeProjectID") + require.CmpNoError(err) + assert.Cmp(out, td.Contains("my-share")) + assert.Cmp(out, td.Contains("GRA1")) +} + +func (ms *MockSuite) TestCloudStorageFileShareCreateCmd(assert, require *td.T) { + httpmock.RegisterMatcherResponder(http.MethodPost, + "https://eu.api.ovh.com/v2/publicCloud/project/fakeProjectID/storage/file/share", + tdhttpmock.JSONBody(td.JSON(` + { + "targetSpec": { + "name": "my-share", + "protocol": "NFS", + "shareType": "STANDARD_1AZ", + "size": 100, + "location": {"region": "GRA1"} + } + }`), + ), + httpmock.NewStringResponder(200, `{"id": "share-1234"}`), + ) + + out, err := cmd.Execute("cloud", "storage", "file", "share", "create", + "--cloud-project", "fakeProjectID", + "--name", "my-share", + "--protocol", "NFS", + "--share-type", "STANDARD_1AZ", + "--size", "100", + "--region", "GRA1", + ) + require.CmpNoError(err) + assert.Cmp(out, td.Contains("share-1234")) +} + +func (ms *MockSuite) TestCloudStorageFileShareCreateCmdError(assert, require *td.T) { + httpmock.RegisterResponder(http.MethodPost, + "https://eu.api.ovh.com/v2/publicCloud/project/fakeProjectID/storage/file/share", + httpmock.NewStringResponder(400, `{"class": "Client::BadRequest::InvalidParameter", "message": "Invalid parameter in the request"}`), + ) + + _, err := cmd.Execute("cloud", "storage", "file", "share", "create", + "--cloud-project", "fakeProjectID", + "--name", "my-share", + "--protocol", "NFS", + "--share-type", "STANDARD_1AZ", + "--size", "100", + "--region", "GRA1", + ) + assert.CmpError(err) + assert.Cmp(err.Error(), td.Contains("failed to create file storage share")) +} + +func (ms *MockSuite) TestCloudStorageFileSnapshotCreateCmd(assert, require *td.T) { + httpmock.RegisterMatcherResponder(http.MethodPost, + "https://eu.api.ovh.com/v2/publicCloud/project/fakeProjectID/storage/file/snapshot", + tdhttpmock.JSONBody(td.JSON(` + { + "targetSpec": { + "name": "my-snapshot", + "share": {"id": "share-1234"} + } + }`), + ), + httpmock.NewStringResponder(200, `{"id": "snapshot-5678"}`), + ) + + out, err := cmd.Execute("cloud", "storage", "file", "snapshot", "create", + "--cloud-project", "fakeProjectID", + "--name", "my-snapshot", + "--share-id", "share-1234", + ) + require.CmpNoError(err) + assert.Cmp(out, td.Contains("snapshot-5678")) +} + +func (ms *MockSuite) TestCloudStorageFileNetworkGetCmd(assert, require *td.T) { + httpmock.RegisterResponder(http.MethodGet, + "https://eu.api.ovh.com/v2/publicCloud/project/fakeProjectID/storage/file/network/network-9012", + httpmock.NewStringResponder(200, `{ + "id": "network-9012", + "resourceStatus": "READY", + "currentState": { + "name": "my-share-network", + "location": {"region": "GRA1"}, + "network": {"id": "priv-net-1"}, + "subnet": {"id": "subnet-1"} + } + }`), + ) + + out, err := cmd.Execute("cloud", "storage", "file", "network", "get", "network-9012", "--cloud-project", "fakeProjectID") + require.CmpNoError(err) + assert.Cmp(out, td.Contains("my-share-network")) +} + +func (ms *MockSuite) TestCloudStorageFileNetworkDeleteCmd(assert, require *td.T) { + httpmock.RegisterResponder(http.MethodDelete, + "https://eu.api.ovh.com/v2/publicCloud/project/fakeProjectID/storage/file/network/network-9012", + httpmock.NewStringResponder(204, ``), + ) + + out, err := cmd.Execute("cloud", "storage", "file", "network", "delete", "network-9012", "--cloud-project", "fakeProjectID") + require.CmpNoError(err) + assert.Cmp(out, td.Contains("network-9012")) +} diff --git a/internal/services/cloud/cloud_storage_file.go b/internal/services/cloud/cloud_storage_file.go index 49b9938e..606927bb 100644 --- a/internal/services/cloud/cloud_storage_file.go +++ b/internal/services/cloud/cloud_storage_file.go @@ -8,10 +8,10 @@ import ( _ "embed" "fmt" "net/url" + "time" "github.com/ovh/ovhcloud-cli/internal/assets" "github.com/ovh/ovhcloud-cli/internal/display" - filtersLib "github.com/ovh/ovhcloud-cli/internal/filters" "github.com/ovh/ovhcloud-cli/internal/flags" httpLib "github.com/ovh/ovhcloud-cli/internal/http" "github.com/ovh/ovhcloud-cli/internal/services/common" @@ -19,83 +19,123 @@ import ( ) var ( - shareColumnsToDisplay = []string{"id", "name", "region", "protocol", "size", "status"} - shareSnapshotColumnsToDisplay = []string{"id", "name", "shareId", "size", "status"} - shareACLColumnsToDisplay = []string{"id", "accessLevel", "accessTo", "accessType", "status"} + fileStorageShareColumnsToDisplay = []string{ + "id", + "currentState.name name", + "currentState.location.region region", + "currentState.protocol protocol", + "currentState.size size", + "resourceStatus", + } + fileStorageSnapshotColumnsToDisplay = []string{ + "id", + "currentState.name name", + "currentState.share.id shareId", + "currentState.size size", + "resourceStatus", + } + fileStorageNetworkColumnsToDisplay = []string{ + "id", + "currentState.name name", + "currentState.location.region region", + "currentState.network.id networkId", + "resourceStatus", + } //go:embed templates/cloud_storage_file_share.tmpl - shareTemplate string + fileStorageShareTemplate string + + //go:embed templates/cloud_storage_file_snapshot.tmpl + fileStorageSnapshotTemplate string - //go:embed templates/cloud_storage_file_share_snapshot.tmpl - shareSnapshotTemplate string + //go:embed templates/cloud_storage_file_network.tmpl + fileStorageNetworkTemplate string //go:embed parameter-samples/storage-file-share-create.json - ShareCreateExample string + FileStorageShareCreateExample string + + //go:embed parameter-samples/storage-file-snapshot-create.json + FileStorageSnapshotCreateExample string + + //go:embed parameter-samples/storage-file-network-create.json + FileStorageNetworkCreateExample string + + // Nested objects are built from these scalar flags before the request is sent. + ShareLocationRegion string + ShareLocationAvailabilityZone string + ShareNetworkID string + + SnapshotShareID string + + NetworkLocationRegion string + NetworkLocationAvailabilityZone string + NetworkNetworkID string + NetworkSubnetID string ShareSpec struct { - AvailabilityZone string `json:"availabilityZone,omitempty"` - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` - NetworkId string `json:"networkId,omitempty"` - Size int `json:"size,omitempty"` - SnapshotId string `json:"snapshotId,omitempty"` - SubnetId string `json:"subnetId,omitempty"` - Type string `json:"type,omitempty"` + TargetSpec struct { + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + Protocol string `json:"protocol,omitempty"` + ShareType string `json:"shareType,omitempty"` + Size int `json:"size,omitempty"` + Location *FileStorageLocation `json:"location,omitempty"` + ShareNetwork *FileStorageRef `json:"shareNetwork,omitempty"` + AccessRules []FileStorageAccessRule `json:"accessRules,omitempty"` + } `json:"targetSpec"` } ShareEditSpec struct { - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` - NewSize int `json:"newSize,omitempty"` + TargetSpec struct { + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + Size int `json:"size,omitempty"` + } `json:"targetSpec"` } - ShareSnapshotSpec struct { - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` + SnapshotSpec struct { + TargetSpec struct { + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + Share *FileStorageRef `json:"share,omitempty"` + } `json:"targetSpec"` } - ShareACLSpec struct { - AccessLevel string `json:"accessLevel,omitempty"` - AccessTo string `json:"accessTo,omitempty"` + SnapshotEditSpec struct { + TargetSpec struct { + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + } `json:"targetSpec"` } - ShareRegion string -) - -// getShareRegions returns a single-element slice if --region is set, -// otherwise discovers all regions with the share feature available. -func getShareRegions(projectID string) ([]any, error) { - if ShareRegion != "" { - return []any{ShareRegion}, nil + NetworkSpec struct { + TargetSpec struct { + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + Location *FileStorageLocation `json:"location,omitempty"` + Network *FileStorageRef `json:"network,omitempty"` + Subnet *FileStorageRef `json:"subnet,omitempty"` + } `json:"targetSpec"` } - return getCloudRegionsWithFeatureAvailable(projectID, "share") -} +) -// findShare searches for a share across all regions and returns its endpoint and data. -func findShare(shareID string) (string, map[string]any, error) { - projectID, err := getConfiguredCloudProject() - if err != nil { - return "", nil, err +type ( + FileStorageLocation struct { + Region string `json:"region,omitempty"` + AvailabilityZone string `json:"availabilityZone,omitempty"` } - regions, err := getShareRegions(projectID) - if err != nil { - return "", nil, fmt.Errorf("failed to fetch regions with share feature available: %w", err) + FileStorageRef struct { + ID string `json:"id,omitempty"` } - for _, region := range regions { - var ( - share map[string]any - endpoint = fmt.Sprintf("/v1/cloud/project/%s/region/%s/share/%s", - projectID, url.PathEscape(region.(string)), url.PathEscape(shareID)) - ) - if err := httpLib.Client.Get(endpoint, &share); err == nil { - return endpoint, share, nil - } + FileStorageAccessRule struct { + AccessLevel string `json:"accessLevel,omitempty"` + AccessTo string `json:"accessTo,omitempty"` } +) - return "", nil, fmt.Errorf("no share found with ID %s", shareID) -} +// File storage shares func ListShares(_ *cobra.Command, _ []string) { projectID, err := getConfiguredCloudProject() @@ -104,70 +144,78 @@ func ListShares(_ *cobra.Command, _ []string) { return } - regions, err := getShareRegions(projectID) - if err != nil { - display.OutputError(&flags.OutputFormatConfig, "failed to fetch regions with share feature available: %s", err) - return - } - - endpoint := fmt.Sprintf("/v1/cloud/project/%s/region", projectID) - shares, err := httpLib.FetchObjectsParallel[[]map[string]any](endpoint+"/%s/share", regions, true) - if err != nil { - display.OutputError(&flags.OutputFormatConfig, "failed to fetch shares: %s", err) - return - } - - var allShares []map[string]any - for _, regionShares := range shares { - allShares = append(allShares, regionShares...) - } - - allShares, err = filtersLib.FilterLines(allShares, flags.GenericFilters) - if err != nil { - display.OutputError(&flags.OutputFormatConfig, "failed to filter results: %s", err) - return - } - - display.RenderTable(allShares, shareColumnsToDisplay, &flags.OutputFormatConfig) + common.ManageListRequestNoExpand( + fmt.Sprintf("/v2/publicCloud/project/%s/storage/file/share", projectID), + fileStorageShareColumnsToDisplay, + flags.GenericFilters, + ) } func GetShare(_ *cobra.Command, args []string) { - _, share, err := findShare(args[0]) + projectID, err := getConfiguredCloudProject() if err != nil { display.OutputError(&flags.OutputFormatConfig, "%s", err) return } - display.OutputObject(share, args[0], shareTemplate, &flags.OutputFormatConfig) + common.ManageObjectRequest( + fmt.Sprintf("/v2/publicCloud/project/%s/storage/file/share", projectID), + args[0], + fileStorageShareTemplate, + ) } -func CreateShare(cmd *cobra.Command, args []string) { +func CreateShare(cmd *cobra.Command, _ []string) { projectID, err := getConfiguredCloudProject() if err != nil { display.OutputError(&flags.OutputFormatConfig, "%s", err) return } - endpoint := fmt.Sprintf("/v1/cloud/project/%s/region/%s/share", projectID, url.PathEscape(args[0])) - task, err := common.CreateResource( + ShareSpec.TargetSpec.Location = nil + if ShareLocationRegion != "" || ShareLocationAvailabilityZone != "" { + ShareSpec.TargetSpec.Location = &FileStorageLocation{ + Region: ShareLocationRegion, + AvailabilityZone: ShareLocationAvailabilityZone, + } + } + ShareSpec.TargetSpec.ShareNetwork = nil + if ShareNetworkID != "" { + ShareSpec.TargetSpec.ShareNetwork = &FileStorageRef{ID: ShareNetworkID} + } + + endpoint := fmt.Sprintf("/v2/publicCloud/project/%s/storage/file/share", projectID) + share, err := common.CreateResource( cmd, - "/cloud/project/{serviceName}/region/{regionName}/share", + "/publicCloud/project/{projectId}/storage/file/share", endpoint, - ShareCreateExample, + FileStorageShareCreateExample, ShareSpec, - assets.CloudOpenapiSchema, - []string{"type"}, + assets.CloudV2OpenapiSchema, + []string{"targetSpec"}, ) if err != nil { - display.OutputError(&flags.OutputFormatConfig, "%s", err) + display.OutputError(&flags.OutputFormatConfig, "failed to create file storage share: %s", err) return } - display.OutputInfo(&flags.OutputFormatConfig, task, "✅ Share creation started successfully (operation ID: %s)", task["id"]) + shareID, _ := share["id"].(string) + + if !flags.WaitForTask { + display.OutputInfo(&flags.OutputFormatConfig, share, "⚡️ File storage share creation started successfully (id: %s)", shareID) + return + } + + if err := waitForCloudResourceReady(fmt.Sprintf("%s/%s", endpoint, url.PathEscape(shareID)), 30*time.Minute); err != nil { + display.OutputError(&flags.OutputFormatConfig, "failed to wait for file storage share to be ready: %s", err) + return + } + + display.OutputInfo(&flags.OutputFormatConfig, share, "✅ File storage share %s created successfully", shareID) } func EditShare(cmd *cobra.Command, args []string) { - endpoint, _, err := findShare(args[0]) + projectID, err := getConfiguredCloudProject() if err != nil { display.OutputError(&flags.OutputFormatConfig, "%s", err) return @@ -175,10 +223,10 @@ func EditShare(cmd *cobra.Command, args []string) { if err := common.EditResource( cmd, - "/cloud/project/{serviceName}/region/{regionName}/share/{shareId}", - endpoint, + "/publicCloud/project/{projectId}/storage/file/share/{fileStorageId}", + fmt.Sprintf("/v2/publicCloud/project/%s/storage/file/share/%s", projectID, url.PathEscape(args[0])), ShareEditSpec, - assets.CloudOpenapiSchema, + assets.CloudV2OpenapiSchema, ); err != nil { display.OutputError(&flags.OutputFormatConfig, "%s", err) return @@ -186,160 +234,223 @@ func EditShare(cmd *cobra.Command, args []string) { } func DeleteShare(_ *cobra.Command, args []string) { - endpoint, _, err := findShare(args[0]) + projectID, err := getConfiguredCloudProject() if err != nil { display.OutputError(&flags.OutputFormatConfig, "%s", err) return } - var task map[string]any - if err := httpLib.Client.Delete(endpoint, &task); err != nil { - display.OutputError(&flags.OutputFormatConfig, "failed to delete share: %s", err) + endpoint := fmt.Sprintf("/v2/publicCloud/project/%s/storage/file/share/%s", projectID, url.PathEscape(args[0])) + if err := httpLib.Client.Delete(endpoint, nil); err != nil { + display.OutputError(&flags.OutputFormatConfig, "failed to delete file storage share: %s", err) return } - display.OutputInfo(&flags.OutputFormatConfig, task, "✅ Share %s deletion started successfully (operation ID: %s)", args[0], task["id"]) - + display.OutputInfo(&flags.OutputFormatConfig, nil, "✅ File storage share %s is being deleted…", args[0]) } -// ACL commands +// File storage snapshots -func ListShareACLs(_ *cobra.Command, args []string) { - endpoint, _, err := findShare(args[0]) +func ListFileStorageSnapshots(_ *cobra.Command, _ []string) { + projectID, err := getConfiguredCloudProject() if err != nil { display.OutputError(&flags.OutputFormatConfig, "%s", err) return } - var acls []map[string]any - if err := httpLib.Client.Get(endpoint+"/acl", &acls); err != nil { - display.OutputError(&flags.OutputFormatConfig, "failed to fetch share ACLs: %s", err) - return - } + common.ManageListRequestNoExpand( + fmt.Sprintf("/v2/publicCloud/project/%s/storage/file/snapshot", projectID), + fileStorageSnapshotColumnsToDisplay, + flags.GenericFilters, + ) +} - acls, err = filtersLib.FilterLines(acls, flags.GenericFilters) +func GetFileStorageSnapshot(_ *cobra.Command, args []string) { + projectID, err := getConfiguredCloudProject() if err != nil { - display.OutputError(&flags.OutputFormatConfig, "failed to filter results: %s", err) + display.OutputError(&flags.OutputFormatConfig, "%s", err) return } - display.RenderTable(acls, shareACLColumnsToDisplay, &flags.OutputFormatConfig) + common.ManageObjectRequest( + fmt.Sprintf("/v2/publicCloud/project/%s/storage/file/snapshot", projectID), + args[0], + fileStorageSnapshotTemplate, + ) } -func GetShareACL(_ *cobra.Command, args []string) { - endpoint, _, err := findShare(args[0]) +func CreateFileStorageSnapshot(cmd *cobra.Command, _ []string) { + projectID, err := getConfiguredCloudProject() if err != nil { display.OutputError(&flags.OutputFormatConfig, "%s", err) return } - var acl map[string]any - if err := httpLib.Client.Get(fmt.Sprintf("%s/acl/%s", endpoint, url.PathEscape(args[1])), &acl); err != nil { - display.OutputError(&flags.OutputFormatConfig, "failed to fetch share ACL: %s", err) + SnapshotSpec.TargetSpec.Share = nil + if SnapshotShareID != "" { + SnapshotSpec.TargetSpec.Share = &FileStorageRef{ID: SnapshotShareID} + } + + endpoint := fmt.Sprintf("/v2/publicCloud/project/%s/storage/file/snapshot", projectID) + snapshot, err := common.CreateResource( + cmd, + "/publicCloud/project/{projectId}/storage/file/snapshot", + endpoint, + FileStorageSnapshotCreateExample, + SnapshotSpec, + assets.CloudV2OpenapiSchema, + []string{"targetSpec"}, + ) + if err != nil { + display.OutputError(&flags.OutputFormatConfig, "failed to create file storage snapshot: %s", err) + return + } + + snapshotID, _ := snapshot["id"].(string) + + if !flags.WaitForTask { + display.OutputInfo(&flags.OutputFormatConfig, snapshot, "⚡️ File storage snapshot creation started successfully (id: %s)", snapshotID) return } - display.OutputObject(acl, args[1], "", &flags.OutputFormatConfig) + if err := waitForCloudResourceReady(fmt.Sprintf("%s/%s", endpoint, url.PathEscape(snapshotID)), 30*time.Minute); err != nil { + display.OutputError(&flags.OutputFormatConfig, "failed to wait for file storage snapshot to be ready: %s", err) + return + } + + display.OutputInfo(&flags.OutputFormatConfig, snapshot, "✅ File storage snapshot %s created successfully", snapshotID) } -func CreateShareACL(_ *cobra.Command, args []string) { - endpoint, _, err := findShare(args[0]) +func EditFileStorageSnapshot(cmd *cobra.Command, args []string) { + projectID, err := getConfiguredCloudProject() if err != nil { display.OutputError(&flags.OutputFormatConfig, "%s", err) return } - var response map[string]any - if err := httpLib.Client.Post(endpoint+"/acl", ShareACLSpec, &response); err != nil { - display.OutputError(&flags.OutputFormatConfig, "failed to create share ACL: %s", err) + if err := common.EditResource( + cmd, + "/publicCloud/project/{projectId}/storage/file/snapshot/{snapshotId}", + fmt.Sprintf("/v2/publicCloud/project/%s/storage/file/snapshot/%s", projectID, url.PathEscape(args[0])), + SnapshotEditSpec, + assets.CloudV2OpenapiSchema, + ); err != nil { + display.OutputError(&flags.OutputFormatConfig, "%s", err) return } - - display.OutputInfo(&flags.OutputFormatConfig, response, "✅ ACL created successfully for share %s (id: %s)", args[0], response["id"]) } -func DeleteShareACL(_ *cobra.Command, args []string) { - endpoint, _, err := findShare(args[0]) +func DeleteFileStorageSnapshot(_ *cobra.Command, args []string) { + projectID, err := getConfiguredCloudProject() if err != nil { display.OutputError(&flags.OutputFormatConfig, "%s", err) return } - if err := httpLib.Client.Delete(fmt.Sprintf("%s/acl/%s", endpoint, url.PathEscape(args[1])), nil); err != nil { - display.OutputError(&flags.OutputFormatConfig, "failed to delete share ACL: %s", err) + endpoint := fmt.Sprintf("/v2/publicCloud/project/%s/storage/file/snapshot/%s", projectID, url.PathEscape(args[0])) + if err := httpLib.Client.Delete(endpoint, nil); err != nil { + display.OutputError(&flags.OutputFormatConfig, "failed to delete file storage snapshot: %s", err) return } - display.OutputInfo(&flags.OutputFormatConfig, nil, "✅ ACL %s deleted successfully from share %s", args[1], args[0]) + display.OutputInfo(&flags.OutputFormatConfig, nil, "✅ File storage snapshot %s is being deleted…", args[0]) } -// Snapshot commands +// File storage share networks -func ListShareSnapshots(_ *cobra.Command, args []string) { - endpoint, _, err := findShare(args[0]) +func ListFileStorageNetworks(_ *cobra.Command, _ []string) { + projectID, err := getConfiguredCloudProject() if err != nil { display.OutputError(&flags.OutputFormatConfig, "%s", err) return } - var snapshots []map[string]any - if err := httpLib.Client.Get(endpoint+"/snapshot", &snapshots); err != nil { - display.OutputError(&flags.OutputFormatConfig, "failed to fetch share snapshots: %s", err) - return - } + common.ManageListRequestNoExpand( + fmt.Sprintf("/v2/publicCloud/project/%s/storage/file/network", projectID), + fileStorageNetworkColumnsToDisplay, + flags.GenericFilters, + ) +} - snapshots, err = filtersLib.FilterLines(snapshots, flags.GenericFilters) +func GetFileStorageNetwork(_ *cobra.Command, args []string) { + projectID, err := getConfiguredCloudProject() if err != nil { - display.OutputError(&flags.OutputFormatConfig, "failed to filter results: %s", err) + display.OutputError(&flags.OutputFormatConfig, "%s", err) return } - display.RenderTable(snapshots, shareSnapshotColumnsToDisplay, &flags.OutputFormatConfig) + common.ManageObjectRequest( + fmt.Sprintf("/v2/publicCloud/project/%s/storage/file/network", projectID), + args[0], + fileStorageNetworkTemplate, + ) } -func GetShareSnapshot(_ *cobra.Command, args []string) { - endpoint, _, err := findShare(args[0]) +func CreateFileStorageNetwork(cmd *cobra.Command, _ []string) { + projectID, err := getConfiguredCloudProject() if err != nil { display.OutputError(&flags.OutputFormatConfig, "%s", err) return } - var snapshot map[string]any - if err := httpLib.Client.Get(fmt.Sprintf("%s/snapshot/%s", endpoint, url.PathEscape(args[1])), &snapshot); err != nil { - display.OutputError(&flags.OutputFormatConfig, "failed to fetch share snapshot: %s", err) + NetworkSpec.TargetSpec.Location = nil + if NetworkLocationRegion != "" || NetworkLocationAvailabilityZone != "" { + NetworkSpec.TargetSpec.Location = &FileStorageLocation{ + Region: NetworkLocationRegion, + AvailabilityZone: NetworkLocationAvailabilityZone, + } + } + NetworkSpec.TargetSpec.Network = nil + if NetworkNetworkID != "" { + NetworkSpec.TargetSpec.Network = &FileStorageRef{ID: NetworkNetworkID} + } + NetworkSpec.TargetSpec.Subnet = nil + if NetworkSubnetID != "" { + NetworkSpec.TargetSpec.Subnet = &FileStorageRef{ID: NetworkSubnetID} + } + + endpoint := fmt.Sprintf("/v2/publicCloud/project/%s/storage/file/network", projectID) + network, err := common.CreateResource( + cmd, + "/publicCloud/project/{projectId}/storage/file/network", + endpoint, + FileStorageNetworkCreateExample, + NetworkSpec, + assets.CloudV2OpenapiSchema, + []string{"targetSpec"}, + ) + if err != nil { + display.OutputError(&flags.OutputFormatConfig, "failed to create file storage share network: %s", err) return } - display.OutputObject(snapshot, args[1], shareSnapshotTemplate, &flags.OutputFormatConfig) -} + networkID, _ := network["id"].(string) -func CreateShareSnapshot(_ *cobra.Command, args []string) { - endpoint, _, err := findShare(args[0]) - if err != nil { - display.OutputError(&flags.OutputFormatConfig, "%s", err) + if !flags.WaitForTask { + display.OutputInfo(&flags.OutputFormatConfig, network, "⚡️ File storage share network creation started successfully (id: %s)", networkID) return } - var response map[string]any - if err := httpLib.Client.Post(endpoint+"/snapshot", ShareSnapshotSpec, &response); err != nil { - display.OutputError(&flags.OutputFormatConfig, "failed to create share snapshot: %s", err) + if err := waitForCloudResourceReady(fmt.Sprintf("%s/%s", endpoint, url.PathEscape(networkID)), 30*time.Minute); err != nil { + display.OutputError(&flags.OutputFormatConfig, "failed to wait for file storage share network to be ready: %s", err) return } - display.OutputInfo(&flags.OutputFormatConfig, response, "✅ Snapshot created successfully for share %s (id: %s)", args[0], response["id"]) + display.OutputInfo(&flags.OutputFormatConfig, network, "✅ File storage share network %s created successfully", networkID) } -func DeleteShareSnapshot(_ *cobra.Command, args []string) { - endpoint, _, err := findShare(args[0]) +func DeleteFileStorageNetwork(_ *cobra.Command, args []string) { + projectID, err := getConfiguredCloudProject() if err != nil { display.OutputError(&flags.OutputFormatConfig, "%s", err) return } - if err := httpLib.Client.Delete(fmt.Sprintf("%s/snapshot/%s", endpoint, url.PathEscape(args[1])), nil); err != nil { - display.OutputError(&flags.OutputFormatConfig, "failed to delete share snapshot: %s", err) + endpoint := fmt.Sprintf("/v2/publicCloud/project/%s/storage/file/network/%s", projectID, url.PathEscape(args[0])) + if err := httpLib.Client.Delete(endpoint, nil); err != nil { + display.OutputError(&flags.OutputFormatConfig, "failed to delete file storage share network: %s", err) return } - display.OutputInfo(&flags.OutputFormatConfig, nil, "✅ Snapshot %s deleted successfully from share %s", args[1], args[0]) + display.OutputInfo(&flags.OutputFormatConfig, nil, "✅ File storage share network %s is being deleted…", args[0]) } diff --git a/internal/services/cloud/parameter-samples/storage-file-network-create.json b/internal/services/cloud/parameter-samples/storage-file-network-create.json new file mode 100644 index 00000000..254bf749 --- /dev/null +++ b/internal/services/cloud/parameter-samples/storage-file-network-create.json @@ -0,0 +1,15 @@ +{ + "targetSpec": { + "name": "my-share-network", + "description": "Share network for production", + "location": { + "region": "GRA1" + }, + "network": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "subnet": { + "id": "00000000-0000-0000-0000-000000000000" + } + } +} diff --git a/internal/services/cloud/parameter-samples/storage-file-share-create.json b/internal/services/cloud/parameter-samples/storage-file-share-create.json index 8f00f996..ef16dee0 100644 --- a/internal/services/cloud/parameter-samples/storage-file-share-create.json +++ b/internal/services/cloud/parameter-samples/storage-file-share-create.json @@ -1,8 +1,21 @@ { - "name": "my-share", - "description": "My file share", - "size": 150, - "type": "standard-1az", - "networkId": "00000000-0000-0000-0000-000000000000", - "subnetId": "00000000-0000-0000-0000-000000000000" -} \ No newline at end of file + "targetSpec": { + "name": "my-share", + "description": "Production data share", + "protocol": "NFS", + "shareType": "STANDARD_1AZ", + "size": 100, + "location": { + "region": "GRA1" + }, + "shareNetwork": { + "id": "00000000-0000-0000-0000-000000000000" + }, + "accessRules": [ + { + "accessLevel": "READ_WRITE", + "accessTo": "10.0.0.42" + } + ] + } +} diff --git a/internal/services/cloud/parameter-samples/storage-file-snapshot-create.json b/internal/services/cloud/parameter-samples/storage-file-snapshot-create.json new file mode 100644 index 00000000..55df18e0 --- /dev/null +++ b/internal/services/cloud/parameter-samples/storage-file-snapshot-create.json @@ -0,0 +1,9 @@ +{ + "targetSpec": { + "name": "my-share-snapshot", + "description": "Daily backup snapshot", + "share": { + "id": "00000000-0000-0000-0000-000000000000" + } + } +} diff --git a/internal/services/cloud/templates/cloud_storage_file_network.tmpl b/internal/services/cloud/templates/cloud_storage_file_network.tmpl new file mode 100644 index 00000000..f7360ffc --- /dev/null +++ b/internal/services/cloud/templates/cloud_storage_file_network.tmpl @@ -0,0 +1,22 @@ +🌐 File Storage Share Network {{.ServiceName}} +======= + +_{{index .Result "currentState" "name"}}_ + +## General information + +**ID**: {{index .Result "id"}} +**Status**: {{index .Result "resourceStatus"}} +**Creation date**: {{index .Result "createdAt"}} +**Update date**: {{index .Result "updatedAt"}} + +## Current state +{{with index .Result "currentState"}} +**Name**: {{index . "name"}} +{{if index . "location"}}**Region**: {{index . "location" "region"}}{{end}} +{{if index . "network"}}**Network ID**: {{index . "network" "id"}}{{end}} +{{if index . "subnet"}}**Subnet ID**: {{index . "subnet" "id"}}{{end}} +{{if index . "description"}}**Description**: {{index . "description"}}{{end}} +{{end}} + +💡 Use option -o json or -o yaml to get the raw output with all information diff --git a/internal/services/cloud/templates/cloud_storage_file_share.tmpl b/internal/services/cloud/templates/cloud_storage_file_share.tmpl index d245032d..2bcca425 100644 --- a/internal/services/cloud/templates/cloud_storage_file_share.tmpl +++ b/internal/services/cloud/templates/cloud_storage_file_share.tmpl @@ -1,20 +1,38 @@ -🚀 Share {{.ServiceName}} +📁 File Storage Share {{.ServiceName}} ======= -_{{index .Result "description"}}_ +_{{index .Result "currentState" "name"}}_ ## General information -**Name**: {{index .Result "name"}} -**Region**: {{index .Result "region"}} -**Availability zone**: {{index .Result "availabilityZone"}} -**Protocol**: {{index .Result "protocol"}} -**Type**: {{index .Result "type"}} -**Status**: {{index .Result "status"}} -**Size**: {{index .Result "size"}}GB -**Public**: {{index .Result "isPublic"}} -**Network ID**: {{index .Result "networkId"}} -**Subnet ID**: {{index .Result "subnetId"}} -**Created at**: {{index .Result "createdAt"}} - -💡 Use option -o json or -o yaml to get the raw output with all information \ No newline at end of file +**ID**: {{index .Result "id"}} +**Status**: {{index .Result "resourceStatus"}} +**Creation date**: {{index .Result "createdAt"}} +**Update date**: {{index .Result "updatedAt"}} + +## Current state +{{with index .Result "currentState"}} +**Name**: {{index . "name"}} +**Protocol**: {{index . "protocol"}} +**Type**: {{index . "shareType"}} +**Size**: {{index . "size"}} GB +{{if index . "location"}}**Region**: {{index . "location" "region"}}{{end}} +{{if index . "description"}}**Description**: {{index . "description"}}{{end}} + +{{if index . "accessRules"}} +### Access rules + +| Access level | Access to | +| --- | --- | +{{range index . "accessRules"}}| {{.accessLevel}} | {{.accessTo}} | +{{end}} +{{end}} +{{if index . "exportLocations"}} +### Export locations + +{{range index . "exportLocations"}}- {{.}} +{{end}} +{{end}} +{{end}} + +💡 Use option -o json or -o yaml to get the raw output with all information diff --git a/internal/services/cloud/templates/cloud_storage_file_share_snapshot.tmpl b/internal/services/cloud/templates/cloud_storage_file_share_snapshot.tmpl deleted file mode 100644 index 4fefa633..00000000 --- a/internal/services/cloud/templates/cloud_storage_file_share_snapshot.tmpl +++ /dev/null @@ -1,16 +0,0 @@ -🚀 Share Snapshot {{.ServiceName}} -======= - -_{{index .Result "description"}}_ - -## General information - -**Name**: {{index .Result "name"}} -**Share ID**: {{index .Result "shareId"}} -**Share protocol**: {{index .Result "shareProtocol"}} -**Share size**: {{index .Result "shareSize"}}GB -**Size**: {{index .Result "size"}}GB -**Status**: {{index .Result "status"}} -**Created at**: {{index .Result "createdAt"}} - -💡 Use option -o json or -o yaml to get the raw output with all information \ No newline at end of file diff --git a/internal/services/cloud/templates/cloud_storage_file_snapshot.tmpl b/internal/services/cloud/templates/cloud_storage_file_snapshot.tmpl new file mode 100644 index 00000000..becca951 --- /dev/null +++ b/internal/services/cloud/templates/cloud_storage_file_snapshot.tmpl @@ -0,0 +1,22 @@ +📸 File Storage Snapshot {{.ServiceName}} +======= + +_{{index .Result "currentState" "name"}}_ + +## General information + +**ID**: {{index .Result "id"}} +**Status**: {{index .Result "resourceStatus"}} +**Creation date**: {{index .Result "createdAt"}} +**Update date**: {{index .Result "updatedAt"}} + +## Current state +{{with index .Result "currentState"}} +**Name**: {{index . "name"}} +**Size**: {{index . "size"}} GB +{{if index . "share"}}**Share ID**: {{index . "share" "id"}}{{end}} +{{if index . "location"}}**Region**: {{index . "location" "region"}}{{end}} +{{if index . "description"}}**Description**: {{index . "description"}}{{end}} +{{end}} + +💡 Use option -o json or -o yaml to get the raw output with all information diff --git a/internal/services/cloud/utils.go b/internal/services/cloud/utils.go index 3e376f63..3cbbe3de 100644 --- a/internal/services/cloud/utils.go +++ b/internal/services/cloud/utils.go @@ -116,6 +116,53 @@ func runFlavorSelector(projectID string, region string) (string, string, error) return selectedFlavor, selectedID, nil } +// waitForCloudResourceReady polls a Cloud API v2 resource endpoint until its +// resourceStatus reaches "READY". Tasks reported in error in currentTasks are +// logged but do not abort the wait: only the resource's own resourceStatus +// becoming "ERROR" is fatal. It gives up after retryDuration. +func waitForCloudResourceReady(endpoint string, retryDuration time.Duration) error { + ctx, cancel := context.WithTimeout(context.Background(), retryDuration) + defer cancel() + + ticker := time.NewTicker(5 * time.Second) + defer ticker.Stop() + + for { + var resource struct { + ResourceStatus string `json:"resourceStatus"` + CurrentTasks []struct { + Id string `json:"id"` + Type string `json:"type"` + Status string `json:"status"` + } `json:"currentTasks"` + } + if err := httpLib.Client.Get(endpoint, &resource); err != nil { + return fmt.Errorf("error fetching resource: %w", err) + } + + switch resource.ResourceStatus { + case "READY": + return nil + case "ERROR": + return errors.New("resource ended in error state") + } + + for _, task := range resource.CurrentTasks { + if task.Status == "ERROR" { + log.Printf("⚠️ Task %s (%s) is in error, still waiting for resource to become ready…", task.Id, task.Type) + } + } + + select { + case <-ctx.Done(): + return errors.New("timeout waiting for resource to be ready") + case <-ticker.C: + log.Printf("Still waiting for resource to be ready (status=%s)…", resource.ResourceStatus) + continue + } + } +} + func waitForCloudOperation(projectID, operationID, action string, retryDuration time.Duration) (string, error) { endpoint := fmt.Sprintf("/v1/cloud/project/%s/operation/%s", url.PathEscape(projectID), url.PathEscape(operationID)) resourceID := ""