region_shares
Creates, updates, deletes, gets or lists a region_shares resource.
Overview​
| Name | region_shares |
| Type | Resource |
| Id | ovh.cloud_storage.region_shares |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Share ID |
name | string | Share name |
network_id | string (uuid) | Private network ID (wire: networkId) |
share_network_id | string (uuid) | Share network ID (wire: shareNetworkId) |
subnet_id | string (uuid) | Subnet ID (wire: subnetId) |
availability_zone | string | Availability zone (wire: availabilityZone) |
capabilities | array | Share capabilities |
created_at | string (date-time) | The date and timestamp when the resource was created (wire: createdAt) |
description | string | Share description |
encryption | object | Encryption settings, null when the share is not encrypted |
export_locations | array | Share export locations (wire: exportLocations) |
is_public | boolean | Whether the share is public (wire: isPublic) |
protocol | string | Share protocol (NFS) |
region | string | Region |
size | integer | Share size in GB |
status | string | Share 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) |
type | string | Share type (standard-1az, standard-1az-luks) |
Share
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Share ID |
name | string | Share name |
network_id | string (uuid) | Private network ID (wire: networkId) |
share_network_id | string (uuid) | Share network ID (wire: shareNetworkId) |
subnet_id | string (uuid) | Subnet ID (wire: subnetId) |
availability_zone | string | Availability zone (wire: availabilityZone) |
capabilities | array | Share capabilities |
created_at | string (date-time) | The date and timestamp when the resource was created (wire: createdAt) |
description | string | Share description |
encryption | object | Encryption settings, null when the share is not encrypted |
export_locations | array | Share export locations (wire: exportLocations) |
is_public | boolean | Whether the share is public (wire: isPublic) |
protocol | string | Share protocol (NFS) |
region | string | Region |
size | integer | Share size in GB |
status | string | Share 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) |
type | string | Share type (standard-1az, standard-1az-luks) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | region_name, share_id, service_name | Get share | |
list | select | region_name, service_name | Get shares | |
create | insert | region_name, service_name, type | Create Share | |
update | update | region_name, share_id, service_name | Update Share | |
delete | delete | region_name, share_id, service_name | Delete 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.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The 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_name | string | Region name (wire: regionName) |
service_name | string | The Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set. |
share_id | string (uuid) | Share ID (wire: shareId) |
SELECT examples​
- get
- list
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
;
Get shares
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 service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: region_shares
props:
- name: region_name
value: "{{ region_name }}"
description: Required parameter for the region_shares resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the region_shares resource.
- name: availability_zone
value: "{{ availability_zone }}"
description: |
Availability zone for the share (required in 3AZ regions)
- name: description
value: "{{ description }}"
description: |
Share description
- name: encryption
description: |
Optional encryption settings. Omit for an unencrypted share.
value:
encrypted: {{ encrypted }}
- name: name
value: "{{ name }}"
description: |
Share name
- name: network_id
value: "{{ network_id }}"
description: |
Network ID (required unless shareNetworkId is set)
- name: share_network_id
value: "{{ share_network_id }}"
description: |
Existing share network ID (alternative to networkId/subnetId)
- name: size
value: {{ size }}
description: |
Share size in GB
- name: snapshot_id
value: "{{ snapshot_id }}"
description: |
Snapshot ID to create the share from
- name: subnet_id
value: "{{ subnet_id }}"
description: |
Subnet ID (required unless shareNetworkId is set)
- name: type
value: "{{ type }}"
description: |
Share type
valid_values: ['standard-1az', 'standard-1az-luks']
UPDATE examples​
- update
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
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
;