Files
openstacksdk/openstack/shared_file_system/v2/share.py
Ashley Rodriguez df5f987c1e Add share resource to shared file system
Introduce Shares class with basic methods
including list, create, delete, get and update to
shared file system storage service.

[1] https://tree.taiga.io/project/ashrod98-openstacksdk-manila-support/us/11?kanban-status=2360120

Change-Id: Ia7d7c88eb55307296336e2f04a00e92bdca6f8ae
2021-07-12 19:51:05 +00:00

103 lines
4.5 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from openstack import resource
class Share(resource.Resource):
resource_key = "share"
resources_key = "shares"
base_path = "/shares"
# capabilities
allow_create = True
allow_fetch = True
allow_commit = True
allow_delete = True
allow_list = True
allow_head = False
#: Properties
#: The share instance access rules status. A valid value is active,
#: error, or syncing.
access_rules_status = resource.Body("access_rules_status", type=str)
#: The availability zone.
availability_zone = resource.Body("availability_zone", type=str)
#: The date and time stamp when the resource was created within the
#: services database.
created_at = resource.Body("created_at", type=str)
#: The user defined description of the resource.
description = resource.Body("description", type=str)
#: The share host name.
host = resource.Body("host", type=str)
#: The level of visibility for the share.
is_public = resource.Body("is_public", type=bool)
#: Whether or not this share supports snapshots that can be
#: cloned into new shares.
is_creating_new_share_from_snapshot_supported = resource.Body(
"create_share_from_snapshot_support", type=bool)
#: Whether the share's snapshots can be mounted directly and access
#: controlled independently or not.
is_mounting_snapshot_supported = resource.Body(
"mount_snapshot_support", type=bool)
#: Whether the share can be reverted to its latest snapshot or not.
is_reverting_to_snapshot_supported = resource.Body(
"revert_to_snapshot_support", type=bool)
#: An extra specification that filters back ends by whether the share
#: supports snapshots or not.
is_snapshot_supported = resource.Body(
"snapshot_support", type=bool)
#: Indicates whether the share has replicas or not.
is_replicated = resource.Body("has_replicas", type=bool)
#: One or more metadata key and value pairs as a dictionary of strings.
metadata = resource.Body("metadata", type=dict)
#: The progress of the share creation.
progress = resource.Body("progress", type=str)
#: The ID of the project that owns the resource.
project_id = resource.Body("project_id", type=str)
#: The share replication type. Valid values are none, readable,
#: writable and dr.
replication_type = resource.Body("replication_type", type=str)
#: The UUID of the share group that this shares belongs to.
share_group_id = resource.Body("share_group_id", type=str)
#: The share network ID.
share_network_id = resource.Body("share_network_id", type=str)
#: The Shared File Systems protocol. A valid value is NFS,
#: CIFS, GlusterFS, HDFS, CephFS, MAPRFS
share_protocol = resource.Body("share_proto", type=str)
#: The UUID of the share server.
share_server_id = resource.Body("share_server_id", type=str)
#: The UUID of the share type. In minor versions, this parameter is a
#: share type name, as a string.
share_type = resource.Body("share_type", type=str)
#: Name of the share type.
share_type_name = resource.Body("share_type_name", type=str)
#: The share size, in GiBs.
size = resource.Body("size", type=int)
#: The UUID of the snapshot that was used to create the
#: share.
snapshot_id = resource.Body("snapshot_id", type=str)
#: The ID of the group snapshot instance that was used to create
#: this share.
source_share_group_snapshot_member_id = resource.Body(
"source_share_group_snapshot_member_id", type=str)
#: The share status
status = resource.Body("status", type=str)
#: For the share migration, the migration task state.
task_state = resource.Body("task_state", type=str)
#: ID of the user that the share was created by.
user_id = resource.Body("user_id", type=str)
#: Display name for updating name
display_name = resource.Body("display_name", type=str)
#: Display description for updating description
display_description = resource.Body("display_description", type=str)