Skip to main content

region_shares

Creates, updates, deletes, gets or lists a region_shares resource.

Overview​

Nameregion_shares
TypeResource
Idovh.cloud_storage.region_shares

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstring (uuid)Share ID
namestringShare name
network_idstring (uuid)Private network ID (wire: networkId)
share_network_idstring (uuid)Share network ID (wire: shareNetworkId)
subnet_idstring (uuid)Subnet ID (wire: subnetId)
availability_zonestringAvailability zone (wire: availabilityZone)
capabilitiesarrayShare capabilities
created_atstring (date-time)The date and timestamp when the resource was created (wire: createdAt)
descriptionstringShare description
encryptionobjectEncryption settings, null when the share is not encrypted
export_locationsarrayShare export locations (wire: exportLocations)
is_publicbooleanWhether the share is public (wire: isPublic)
protocolstringShare protocol (NFS)
regionstringRegion
sizeintegerShare size in GB
statusstringShare status (available, awaiting_transfer, backup_creating, backup_restoring, backup_restoring_error, creating, creating_from_snapshot, deleted, deleting, error, error_deleting, extending, extending_error, inactive, manage_error, manage_starting, migrating, migrating_to, replication_change, reverting, reverting_error, shrinking, shrinking_error, shrinking_possible_data_loss_error, unmanage_error, unmanage_starting, unmanaged)
typestringShare type (standard-1az, standard-1az-luks)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectregion_name, share_id, service_nameGet share
listselectregion_name, service_nameGet shares
createinsertregion_name, service_name, typeCreate Share
updateupdateregion_name, share_id, service_nameUpdate Share
deletedeleteregion_name, share_id, service_nameDelete Share

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
region_namestringRegion name (wire: regionName)
service_namestringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
share_idstring (uuid)Share ID (wire: shareId)

SELECT examples​

Get share

SELECT
id,
name,
network_id,
share_network_id,
subnet_id,
availability_zone,
capabilities,
created_at,
description,
encryption,
export_locations,
is_public,
protocol,
region,
size,
status,
type
FROM ovh.cloud_storage.region_shares
WHERE region_name = '{{ region_name }}' -- required
AND share_id = '{{ share_id }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;

INSERT examples​

Create Share

INSERT INTO ovh.cloud_storage.region_shares (
availability_zone,
description,
encryption,
name,
network_id,
share_network_id,
size,
snapshot_id,
subnet_id,
type,
region_name,
service_name
)
SELECT
'{{ availability_zone }}',
'{{ description }}',
'{{ encryption }}',
'{{ name }}',
'{{ network_id }}',
'{{ share_network_id }}',
{{ size }},
'{{ snapshot_id }}',
'{{ subnet_id }}',
'{{ type }}' /* required */,
'{{ region_name }}',
'{{ service_name }}'
RETURNING
id,
resource_id,
action,
completed_at,
created_at,
progress,
regions,
started_at,
status,
sub_operations
;

UPDATE examples​

Update Share

UPDATE ovh.cloud_storage.region_shares
SET
description = '{{ description }}',
name = '{{ name }}',
new_size = {{ new_size }}
WHERE
region_name = '{{ region_name }}' --required
AND share_id = '{{ share_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
RETURNING
id,
resource_id,
action,
completed_at,
created_at,
progress,
regions,
started_at,
status,
sub_operations;

DELETE examples​

Delete Share

DELETE FROM ovh.cloud_storage.region_shares
WHERE region_name = '{{ region_name }}' --required
AND share_id = '{{ share_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;