Skip to main content

file_networks

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

Overview​

Namefile_networks
TypeResource
Idovh.public_cloud_storage.file_networks

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstring (uuid)Unique identifier of the share network
checksumstringComputed hash representing the current target specification value
created_atstring (date-time)Creation date of the share network (wire: createdAt)
current_stateobjectCurrent observed state of the share network from the infrastructure (wire: currentState)
current_tasksarrayOngoing asynchronous tasks related to the share network (wire: currentTasks)
resource_statusstringShare network readiness in the system (CREATING, CREATION_PLANNED, DELETING, ERROR, OUT_OF_SYNC, READY, SUSPENDED, UNKNOWN, UPDATING) (wire: resourceStatus)
target_specobjectLast target specification of the share network (wire: targetSpec)
updated_atstring (date-time)Last update date of the share network (wire: updatedAt)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectnetwork_id, project_idReturns the share network and the network and subnet behind it.
listselectproject_idx_pagination_cursor, x_pagination_sizeReturns the share networks of the project.
createinsertproject_id, target_specCreates a share network on a network and subnet of the project. A file storage is attached to a share network at creation.
deletedeletenetwork_id, project_idDeletes the share network. A share network still used by a file storage cannot be deleted.

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"}})
network_idstring (uuid)Network ID (wire: networkId)
project_idstringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
x_pagination_cursorstringPagination cursor (wire: X-Pagination-Cursor)
x_pagination_sizeintegerPagination size (wire: X-Pagination-Size)

SELECT examples​

Returns the share network and the network and subnet behind it.

SELECT
id,
checksum,
created_at,
current_state,
current_tasks,
resource_status,
target_spec,
updated_at
FROM ovh.public_cloud_storage.file_networks
WHERE network_id = '{{ network_id }}' -- required
AND project_id = '{{ project_id }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;

INSERT examples​

Creates a share network on a network and subnet of the project. A file storage is attached to a share network at creation.

INSERT INTO ovh.public_cloud_storage.file_networks (
target_spec,
project_id
)
SELECT
'{{ target_spec }}' /* required */,
'{{ project_id }}'
RETURNING
id,
checksum,
created_at,
current_state,
current_tasks,
resource_status,
target_spec,
updated_at
;

DELETE examples​

Deletes the share network. A share network still used by a file storage cannot be deleted.

DELETE FROM ovh.public_cloud_storage.file_networks
WHERE network_id = '{{ network_id }}' --required
AND project_id = '{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;