Shared File System API

The Shared File System Class

The high-level interface for accessing the shared file systems service API is available through the shared_file_system member of a Connection object. The shared_file_system member will only be added if the service is detected. share is an alias of the shared_file_system member.

Shared File System Availability Zones

Interact with Availability Zones supported by the Shared File Systems service.

class openstack.shared_file_system.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
availability_zones()

Retrieve shared file system availability zones

Returns:

A generator of availability zone resources

Return type:

AvailabilityZone

Shared File System Shares

Interact with Shares supported by the Shared File Systems service.

class openstack.shared_file_system.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
shares(details=True, **query)

Lists all shares with details

Parameters:

query (kwargs) –

Optional query parameters to be sent to limit the shares being returned. Available parameters include:

  • status: Filters by a share status

  • share_server_id: The UUID of the share server.

  • metadata: One or more metadata key and value pairs as a url encoded dictionary of strings.

  • extra_specs: The extra specifications as a set of one or more key-value pairs.

  • share_type_id: The UUID of a share type to query resources by.

  • name: The user defined name of the resource to filter resources by.

  • snapshot_id: The UUID of the share’s base snapshot to filter the request based on.

  • host: The host name of the resource to query with.

  • share_network_id: The UUID of the share network to filter resources by.

  • project_id: The ID of the project that owns the resource.

  • is_public: A boolean query parameter that, when set to true, allows retrieving public resources that belong to all projects.

  • share_group_id: The UUID of a share group to filter resource.

  • export_location_id: The export location UUID that can be used to filter shares or share instances.

  • export_location_path: The export location path that can be used to filter shares or share instances.

  • name~: The name pattern that can be used to filter shares, share snapshots, share networks or share groups.

  • description~: The description pattern that can be used to filter shares, share snapshots, share networks or share groups.

  • with_count: Whether to show count in API response or not, default is False.

  • limit: The maximum number of shares to return.

  • offset: The offset to define start point of share or share group listing.

  • sort_key: The key to sort a list of shares.

  • sort_dir: The direction to sort a list of shares. A valid value is asc, or desc.

Returns:

Details of shares resources

Return type:

Share

get_share(share_id)

Lists details of a single share

Parameters:

share – The ID of the share to get

Returns:

Details of the identified share

Return type:

Share

delete_share(share, ignore_missing=True)

Deletes a single share

Parameters:

share – The ID of the share to delete

Returns:

Result of the delete

Return type:

None

update_share(share_id, **attrs)

Updates details of a single share.

Parameters:
  • share – The ID of the share to update

  • attrs (dict) – The attributes to update on the share

Returns:

the updated share

Return type:

Share

create_share(**attrs)

Creates a share from attributes

Returns:

Details of the new share

Parameters:

attrs (dict) – Attributes which will be used to create a Shares, comprised of the properties on the Shares class. ‘size’ and ‘share’ are required to create a share.

Return type:

Share

revert_share_to_snapshot(share_id, snapshot_id)
Reverts a share to the specified snapshot, which must be

the most recent one known to manila.

Parameters:
  • share_id – The ID of the share to revert

  • snapshot_id – The ID of the snapshot to revert to

Returns:

Result of the revert

Return type:

None

Shared File System Storage Pools

Interact with the storage pool statistics exposed by the Shared File Systems Service.

class openstack.shared_file_system.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
storage_pools(details=True, **query)

Lists all back-end storage pools with details

Parameters:

query (kwargs) –

Optional query parameters to be sent to limit the storage pools being returned. Available parameters include:

  • pool_name: The pool name for the back end.

  • host_name: The host name for the back end.

  • backend_name: The name of the back end.

  • capabilities: The capabilities for the storage back end.

  • share_type: The share type name or UUID.

Returns:

A generator of manila storage pool resources

Return type:

StoragePool

Shared File System User Messages

View and manipulate asynchronous user messages emitted by the Shared File Systems service.

class openstack.shared_file_system.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
user_messages(**query)

List shared file system user messages

Parameters:

query (kwargs) –

Optional query parameters to be sent to limit the messages being returned. Available parameters include:

  • action_id: The ID of the action during which the message was created.

  • detail_id: The ID of the message detail.

  • limit: The maximum number of shares to return.

  • message_level: The message level.

  • offset: The offset to define start point of share or share group listing.

  • sort_key: The key to sort a list of messages.

  • sort_dir: The direction to sort a list of shares.

  • project_id: The ID of the project for which the message was created.

  • request_id: The ID of the request during which the message was created.

  • resource_id: The UUID of the resource for which the message was created.

  • resource_type: The type of the resource for which the message was created.

Returns:

A generator of user message resources

Return type:

UserMessage

get_user_message(message_id)

List details of a single user message

Parameters:

message_id – The ID of the user message

Returns:

Details of the identified user message

Return type:

UserMessage

delete_user_message(message_id, ignore_missing=True)

Deletes a single user message

Parameters:

message_id – The ID of the user message

Returns:

Result of the “delete” on the user message

Return type:

UserMessage

Shared File System Limits

Get absolute limits of resources supported by the Shared File Systems service.

class openstack.shared_file_system.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
limits(**query)

Lists all share limits.

Parameters:

query (kwargs) – Optional query parameters to be sent to limit the share limits being returned.

Returns:

A generator of manila share limits resources

Return type:

Limit

Shared File System Snapshots

Interact with Share Snapshots supported by the Shared File Systems service.

class openstack.shared_file_system.v2._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
share_snapshots(details=True, **query)

Lists all share snapshots with details.

Parameters:

query (kwargs) –

Optional query parameters to be sent to limit the snapshots being returned. Available parameters include:

  • project_id: The ID of the user or service making the API request.

Returns:

A generator of manila share snapshot resources

Return type:

ShareSnapshot

get_share_snapshot(snapshot_id)

Lists details of a single share snapshot

Parameters:

snapshot_id – The ID of the snapshot to get

Returns:

Details of the identified share snapshot

Return type:

ShareSnapshot

create_share_snapshot(**attrs)

Creates a share snapshot from attributes

Returns:

Details of the new share snapshot

Return type:

ShareSnapshot

update_share_snapshot(snapshot_id, **attrs)

Updates details of a single share.

Parameters:

snapshot_id – The ID of the snapshot to update

Pram dict attrs:

The attributes to update on the snapshot

Returns:

the updated share snapshot

Return type:

ShareSnapshot

delete_share_snapshot(snapshot_id, ignore_missing=True)

Deletes a single share snapshot

Parameters:

snapshot_id – The ID of the snapshot to delete

Returns:

Result of the delete

Return type:

None