renamed service_type to share

This commit is contained in:
Yulia Portnova 2013-09-05 13:45:47 +03:00
parent e69f2bea62
commit 9a3e8e15af
5 changed files with 85 additions and 95 deletions

View File

@ -4,11 +4,6 @@ from manilaclient.v1 import quota_classes
from manilaclient.v1 import quotas
from manilaclient.v1 import shares
from manilaclient.v1 import share_snapshots
from manilaclient.v1 import volumes
from manilaclient.v1 import volume_snapshots
from manilaclient.v1 import volume_types
from manilaclient.v1 import volume_backups
from manilaclient.v1 import volume_backups_restore
class Client(object):
@ -21,7 +16,7 @@ class Client(object):
Then call methods on its managers::
>>> client.volumes.list()
>>> client.shares.list()
...
"""
@ -40,13 +35,8 @@ class Client(object):
self.limits = limits.LimitsManager(self)
# extensions
self.volumes = volumes.VolumeManager(self)
self.volume_snapshots = volume_snapshots.SnapshotManager(self)
self.volume_types = volume_types.VolumeTypeManager(self)
self.quota_classes = quota_classes.QuotaClassSetManager(self)
self.quotas = quotas.QuotaSetManager(self)
self.backups = volume_backups.VolumeBackupManager(self)
self.restores = volume_backups_restore.VolumeBackupRestoreManager(self)
self.shares = shares.ShareManager(self)
self.share_snapshots = share_snapshots.ShareSnapshotManager(self)

View File

@ -37,7 +37,7 @@ class ListExtManager(base.Manager):
return self._list("/extensions", 'extensions')
@utils.service_type('volume')
@utils.service_type('share')
def do_list_extensions(client, _args):
"""
List all the os-api extensions that are available.

View File

@ -158,7 +158,7 @@ def _extract_metadata(args):
metavar='<status>',
default=None,
help='Filter results by status')
@utils.service_type('volume')
@utils.service_type('share')
def do_list(cs, args):
"""List all the volumes."""
all_tenants = int(os.environ.get("ALL_TENANTS", args.all_tenants))
@ -179,7 +179,7 @@ def do_list(cs, args):
@utils.arg('volume', metavar='<volume>', help='ID of the volume.')
@utils.service_type('volume')
@utils.service_type('share')
def do_show(cs, args):
"""Show details about a volume."""
volume = _find_volume(cs, args.volume)
@ -252,7 +252,7 @@ def do_show(cs, args):
metavar='<key=value>',
help='Metadata key=value pairs (Optional, Default=None)',
default=None)
@utils.service_type('volume')
@utils.service_type('share')
def do_create(cs, args):
"""Add a new volume."""
volume_metadata = None
@ -272,7 +272,7 @@ def do_create(cs, args):
@utils.arg('volume', metavar='<volume>', help='ID of the volume to delete.')
@utils.service_type('volume')
@utils.service_type('share')
def do_delete(cs, args):
"""Remove a volume."""
volume = _find_volume(cs, args.volume)
@ -280,7 +280,7 @@ def do_delete(cs, args):
@utils.arg('volume', metavar='<volume>', help='ID of the volume to delete.')
@utils.service_type('volume')
@utils.service_type('share')
def do_force_delete(cs, args):
"""Attempt forced removal of a volume, regardless of its state."""
volume = _find_volume(cs, args.volume)
@ -293,7 +293,7 @@ def do_force_delete(cs, args):
@utils.arg('--display-description', metavar='<display-description>',
help='Optional volume description. (Default=None)',
default=None)
@utils.service_type('volume')
@utils.service_type('share')
def do_rename(cs, args):
"""Rename a volume."""
kwargs = {}
@ -316,7 +316,7 @@ def do_rename(cs, args):
nargs='+',
default=[],
help='Metadata to set/unset (only key is necessary on unset)')
@utils.service_type('volume')
@utils.service_type('share')
def do_metadata(cs, args):
"""Set or Delete metadata on a volume."""
volume = _find_volume(cs, args.volume)
@ -358,7 +358,7 @@ def do_metadata(cs, args):
metavar='<volume-id>',
default=None,
help='Filter results by volume-id')
@utils.service_type('volume')
@utils.service_type('share')
def do_snapshot_list(cs, args):
"""List all the snapshots."""
all_tenants = int(os.environ.get("ALL_TENANTS", args.all_tenants))
@ -377,7 +377,7 @@ def do_snapshot_list(cs, args):
@utils.arg('snapshot', metavar='<snapshot>', help='ID of the snapshot.')
@utils.service_type('volume')
@utils.service_type('share')
def do_snapshot_show(cs, args):
"""Show details about a snapshot."""
snapshot = _find_volume_snapshot(cs, args.snapshot)
@ -409,7 +409,7 @@ def do_snapshot_show(cs, args):
@utils.arg(
'--display_description',
help=argparse.SUPPRESS)
@utils.service_type('volume')
@utils.service_type('share')
def do_snapshot_create(cs, args):
"""Add a new snapshot."""
snapshot = cs.volume_snapshots.create(args.volume_id,
@ -422,7 +422,7 @@ def do_snapshot_create(cs, args):
@utils.arg('snapshot_id',
metavar='<snapshot-id>',
help='ID of the snapshot to delete.')
@utils.service_type('volume')
@utils.service_type('share')
def do_snapshot_delete(cs, args):
"""Remove a snapshot."""
snapshot = _find_volume_snapshot(cs, args.snapshot_id)
@ -435,7 +435,7 @@ def do_snapshot_delete(cs, args):
@utils.arg('--display-description', metavar='<display-description>',
help='Optional snapshot description. (Default=None)',
default=None)
@utils.service_type('volume')
@utils.service_type('share')
def do_snapshot_rename(cs, args):
"""Rename a snapshot."""
kwargs = {}
@ -455,14 +455,14 @@ def _print_type_and_extra_specs_list(vtypes):
utils.print_list(vtypes, ['ID', 'Name', 'extra_specs'], formatters)
@utils.service_type('volume')
@utils.service_type('share')
def do_type_list(cs, args):
"""Print a list of available 'volume types'."""
vtypes = cs.volume_types.list()
_print_volume_type_list(vtypes)
@utils.service_type('volume')
@utils.service_type('share')
def do_extra_specs_list(cs, args):
"""Print a list of current 'volume types and extra specs' (Admin Only)."""
vtypes = cs.volume_types.list()
@ -472,7 +472,7 @@ def do_extra_specs_list(cs, args):
@utils.arg('name',
metavar='<name>',
help="Name of the new volume type")
@utils.service_type('volume')
@utils.service_type('share')
def do_type_create(cs, args):
"""Create a new volume type."""
vtype = cs.volume_types.create(args.name)
@ -482,7 +482,7 @@ def do_type_create(cs, args):
@utils.arg('id',
metavar='<id>',
help="Unique ID of the volume type to delete")
@utils.service_type('volume')
@utils.service_type('share')
def do_type_delete(cs, args):
"""Delete a specific volume type"""
cs.volume_types.delete(args.id)
@ -500,7 +500,7 @@ def do_type_delete(cs, args):
nargs='*',
default=None,
help='Extra_specs to set/unset (only key is necessary on unset)')
@utils.service_type('volume')
@utils.service_type('share')
def do_type_key(cs, args):
"Set or unset extra_spec for a volume type."""
vtype = _find_volume_type(cs, args.vtype)
@ -550,7 +550,7 @@ def _quota_update(manager, identifier, args):
@utils.arg('tenant', metavar='<tenant_id>',
help='UUID of tenant to list the quotas for.')
@utils.service_type('volume')
@utils.service_type('share')
def do_quota_show(cs, args):
"""List the quotas for a tenant."""
@ -559,7 +559,7 @@ def do_quota_show(cs, args):
@utils.arg('tenant', metavar='<tenant_id>',
help='UUID of tenant to list the default quotas for.')
@utils.service_type('volume')
@utils.service_type('share')
def do_quota_defaults(cs, args):
"""List the default quotas for a tenant."""
@ -580,7 +580,7 @@ def do_quota_defaults(cs, args):
metavar='<gigabytes>',
type=int, default=None,
help='New value for the "gigabytes" quota.')
@utils.service_type('volume')
@utils.service_type('share')
def do_quota_update(cs, args):
"""Update the quotas for a tenant."""
@ -589,7 +589,7 @@ def do_quota_update(cs, args):
@utils.arg('class_name', metavar='<class>',
help='Name of quota class to list the quotas for.')
@utils.service_type('volume')
@utils.service_type('share')
def do_quota_class_show(cs, args):
"""List the quotas for a quota class."""
@ -610,14 +610,14 @@ def do_quota_class_show(cs, args):
metavar='<gigabytes>',
type=int, default=None,
help='New value for the "gigabytes" quota.')
@utils.service_type('volume')
@utils.service_type('share')
def do_quota_class_update(cs, args):
"""Update the quotas for a quota class."""
_quota_update(cs.quota_classes, args.class_name, args)
@utils.service_type('volume')
@utils.service_type('share')
def do_absolute_limits(cs, args):
"""Print a list of absolute limits for a user"""
limits = cs.limits.get().absolute
@ -625,7 +625,7 @@ def do_absolute_limits(cs, args):
utils.print_list(limits, columns)
@utils.service_type('volume')
@utils.service_type('share')
def do_rate_limits(cs, args):
"""Print a list of rate limits for a user"""
limits = cs.limits.get().rate
@ -667,7 +667,7 @@ def _find_volume_type(cs, vtype):
@utils.arg('image_name',
metavar='<image-name>',
help='Name for created image')
@utils.service_type('volume')
@utils.service_type('share')
def do_upload_to_image(cs, args):
"""Upload volume to image service as image."""
volume = _find_volume(cs, args.volume_id)
@ -688,7 +688,7 @@ def do_upload_to_image(cs, args):
@utils.arg('--display-description', metavar='<display-description>',
help='Optional backup description. (Default=None)',
default=None)
@utils.service_type('volume')
@utils.service_type('share')
def do_backup_create(cs, args):
"""Creates a backup."""
cs.backups.create(args.volume,
@ -698,7 +698,7 @@ def do_backup_create(cs, args):
@utils.arg('backup', metavar='<backup>', help='ID of the backup.')
@utils.service_type('volume')
@utils.service_type('share')
def do_backup_show(cs, args):
"""Show details about a backup."""
backup = _find_backup(cs, args.backup)
@ -711,7 +711,7 @@ def do_backup_show(cs, args):
utils.print_dict(info)
@utils.service_type('volume')
@utils.service_type('share')
def do_backup_list(cs, args):
"""List all the backups."""
backups = cs.backups.list()
@ -722,7 +722,7 @@ def do_backup_list(cs, args):
@utils.arg('backup', metavar='<backup>',
help='ID of the backup to delete.')
@utils.service_type('volume')
@utils.service_type('share')
def do_backup_delete(cs, args):
"""Remove a backup."""
backup = _find_backup(cs, args.backup)
@ -734,7 +734,7 @@ def do_backup_delete(cs, args):
@utils.arg('--volume-id', metavar='<volume-id>',
help='Optional ID of the volume to restore to.',
default=None)
@utils.service_type('volume')
@utils.service_type('share')
def do_backup_restore(cs, args):
"""Restore a backup."""
cs.restores.restore(args.backup,
@ -772,7 +772,7 @@ def do_backup_restore(cs, args):
@utils.arg(
'--display_description',
help=argparse.SUPPRESS)
@utils.service_type('volume')
@utils.service_type('share')
def do_share_create(cs, args):
"""Creates new NAS storage (NFS or CIFS)."""
share = cs.shares.create(args.share_protocol, args.size, args.snapshot_id,
@ -784,7 +784,7 @@ def do_share_create(cs, args):
'share',
metavar='<share>',
help='ID of the NAS to delete.')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_delete(cs, args):
"""Deletes NAS storage."""
cs.shares.delete(args.share)
@ -794,7 +794,7 @@ def do_share_delete(cs, args):
'share',
metavar='<share>',
help='ID of the NAS share.')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_show(cs, args):
"""Show details about a NAS share."""
share = _find_share(cs, args.share)
@ -813,7 +813,7 @@ def do_share_show(cs, args):
'access_to',
metavar='<access_to>',
help='Value that defines access')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_allow(cs, args):
"""Allow access to the share."""
share = _find_share(cs, args.share)
@ -828,7 +828,7 @@ def do_share_allow(cs, args):
'id',
metavar='<id>',
help='id of the access rule to be deleted.')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_deny(cs, args):
"""Deny access to a share."""
share = _find_share(cs, args.share)
@ -839,7 +839,7 @@ def do_share_deny(cs, args):
'share',
metavar='<share>',
help='ID of the share.')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_access_list(cs, args):
"""Show access list for share."""
share = _find_share(cs, args.share)
@ -866,7 +866,7 @@ def do_share_access_list(cs, args):
metavar='<status>',
default=None,
help='Filter results by status')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_list(cs, args):
"""List all NAS shares."""
all_tenants = int(os.environ.get("ALL_TENANTS", args.all_tenants))
@ -905,7 +905,7 @@ def do_share_list(cs, args):
metavar='<share-id>',
default=None,
help='Filter results by share-id')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_snapshot_list(cs, args):
"""List all the snapshots."""
all_tenants = int(os.environ.get("ALL_TENANTS", args.all_tenants))
@ -925,7 +925,7 @@ def do_share_snapshot_list(cs, args):
'snapshot',
metavar='<snapshot>',
help='ID of the snapshot.')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_snapshot_show(cs, args):
"""Show details about a snapshot."""
snapshot = _find_share_snapshot(cs, args.snapshot)
@ -953,7 +953,7 @@ def do_share_snapshot_show(cs, args):
metavar='<display-description>',
default=None,
help='Optional snapshot description. (Default=None)')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_snapshot_create(cs, args):
"""Add a new snapshot."""
snapshot = cs.share_snapshots.create(args.share_id,
@ -967,7 +967,7 @@ def do_share_snapshot_create(cs, args):
'snapshot_id',
metavar='<snapshot-id>',
help='ID of the snapshot to delete.')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_snapshot_delete(cs, args):
"""Remove a snapshot."""
snapshot = _find_share_snapshot(cs, args.snapshot_id)

View File

@ -37,7 +37,7 @@ class ListExtManager(base.Manager):
return self._list("/extensions", 'extensions')
@utils.service_type('volume')
@utils.service_type('share')
def do_list_extensions(client, _args):
"""
List all the os-api extensions that are available.

View File

@ -148,7 +148,7 @@ def _extract_metadata(args):
metavar='<status>',
default=None,
help='Filter results by status')
@utils.service_type('volume')
@utils.service_type('share')
def do_list(cs, args):
"""List all the volumes."""
# NOTE(thingee): Backwards-compatibility with v1 args
@ -176,7 +176,7 @@ def do_list(cs, args):
@utils.arg('volume',
metavar='<volume>',
help='ID of the volume.')
@utils.service_type('volume')
@utils.service_type('share')
def do_show(cs, args):
"""Show details about a volume."""
info = dict()
@ -245,7 +245,7 @@ def do_show(cs, args):
metavar='<key=value>',
help='Metadata key=value pairs (Optional, Default=None)',
default=None)
@utils.service_type('volume')
@utils.service_type('share')
def do_create(cs, args):
"""Add a new volume."""
# NOTE(thingee): Backwards-compatibility with v1 args
@ -281,7 +281,7 @@ def do_create(cs, args):
@utils.arg('volume',
metavar='<volume>',
help='ID of the volume to delete.')
@utils.service_type('volume')
@utils.service_type('share')
def do_delete(cs, args):
"""Remove a volume."""
volume = _find_volume(cs, args.volume)
@ -291,7 +291,7 @@ def do_delete(cs, args):
@utils.arg('volume',
metavar='<volume>',
help='ID of the volume to delete.')
@utils.service_type('volume')
@utils.service_type('share')
def do_force_delete(cs, args):
"""Attempt forced removal of a volume, regardless of its state."""
volume = _find_volume(cs, args.volume)
@ -312,7 +312,7 @@ def do_force_delete(cs, args):
help=argparse.SUPPRESS)
@utils.arg('--display_description',
help=argparse.SUPPRESS)
@utils.service_type('volume')
@utils.service_type('share')
def do_rename(cs, args):
"""Rename a volume."""
kwargs = {}
@ -340,7 +340,7 @@ def do_rename(cs, args):
action='append',
default=[],
help='Metadata to set/unset (only key is necessary on unset)')
@utils.service_type('volume')
@utils.service_type('share')
def do_metadata(cs, args):
"""Set or Delete metadata on a volume."""
volume = _find_volume(cs, args.volume)
@ -383,7 +383,7 @@ def do_metadata(cs, args):
help='Filter results by volume-id')
@utils.arg('--volume_id',
help=argparse.SUPPRESS)
@utils.service_type('volume')
@utils.service_type('share')
def do_snapshot_list(cs, args):
"""List all the snapshots."""
all_tenants = int(os.environ.get("ALL_TENANTS", args.all_tenants))
@ -407,7 +407,7 @@ def do_snapshot_list(cs, args):
@utils.arg('snapshot',
metavar='<snapshot>',
help='ID of the snapshot.')
@utils.service_type('volume')
@utils.service_type('share')
def do_snapshot_show(cs, args):
"""Show details about a snapshot."""
snapshot = _find_volume_snapshot(cs, args.snapshot)
@ -439,7 +439,7 @@ def do_snapshot_show(cs, args):
help=argparse.SUPPRESS)
@utils.arg('--display_description',
help=argparse.SUPPRESS)
@utils.service_type('volume')
@utils.service_type('share')
def do_snapshot_create(cs, args):
"""Add a new snapshot."""
if args.display_name is not None:
@ -458,7 +458,7 @@ def do_snapshot_create(cs, args):
@utils.arg('snapshot-id',
metavar='<snapshot-id>',
help='ID of the snapshot to delete.')
@utils.service_type('volume')
@utils.service_type('share')
def do_snapshot_delete(cs, args):
"""Remove a snapshot."""
snapshot = _find_volume_snapshot(cs, args.snapshot_id)
@ -475,7 +475,7 @@ def do_snapshot_delete(cs, args):
help=argparse.SUPPRESS)
@utils.arg('--display_description',
help=argparse.SUPPRESS)
@utils.service_type('volume')
@utils.service_type('share')
def do_snapshot_rename(cs, args):
"""Rename a snapshot."""
kwargs = {}
@ -500,14 +500,14 @@ def _print_type_and_extra_specs_list(vtypes):
utils.print_list(vtypes, ['ID', 'Name', 'extra_specs'], formatters)
@utils.service_type('volume')
@utils.service_type('share')
def do_type_list(cs, args):
"""Print a list of available 'volume types'."""
vtypes = cs.volume_types.list()
_print_volume_type_list(vtypes)
@utils.service_type('volume')
@utils.service_type('share')
def do_extra_specs_list(cs, args):
"""Print a list of current 'volume types and extra specs' (Admin Only)."""
vtypes = cs.volume_types.list()
@ -517,7 +517,7 @@ def do_extra_specs_list(cs, args):
@utils.arg('name',
metavar='<name>',
help="Name of the new volume type")
@utils.service_type('volume')
@utils.service_type('share')
def do_type_create(cs, args):
"""Create a new volume type."""
vtype = cs.volume_types.create(args.name)
@ -527,7 +527,7 @@ def do_type_create(cs, args):
@utils.arg('id',
metavar='<id>',
help="Unique ID of the volume type to delete")
@utils.service_type('volume')
@utils.service_type('share')
def do_type_delete(cs, args):
"""Delete a specific volume type"""
cs.volume_types.delete(args.id)
@ -546,7 +546,7 @@ def do_type_delete(cs, args):
action='append',
default=[],
help='Extra_specs to set/unset (only key is necessary on unset)')
@utils.service_type('volume')
@utils.service_type('share')
def do_type_key(cs, args):
"Set or unset extra_spec for a volume type."""
vtype = _find_volume_type(cs, args.vtype)
@ -595,7 +595,7 @@ def _quota_update(manager, identifier, args):
@utils.arg('tenant',
metavar='<tenant_id>',
help='UUID of tenant to list the quotas for.')
@utils.service_type('volume')
@utils.service_type('share')
def do_quota_show(cs, args):
"""List the quotas for a tenant."""
@ -605,7 +605,7 @@ def do_quota_show(cs, args):
@utils.arg('tenant',
metavar='<tenant_id>',
help='UUID of tenant to list the default quotas for.')
@utils.service_type('volume')
@utils.service_type('share')
def do_quota_defaults(cs, args):
"""List the default quotas for a tenant."""
@ -627,7 +627,7 @@ def do_quota_defaults(cs, args):
metavar='<gigabytes>',
type=int, default=None,
help='New value for the "gigabytes" quota.')
@utils.service_type('volume')
@utils.service_type('share')
def do_quota_update(cs, args):
"""Update the quotas for a tenant."""
@ -637,7 +637,7 @@ def do_quota_update(cs, args):
@utils.arg('class_name',
metavar='<class>',
help='Name of quota class to list the quotas for.')
@utils.service_type('volume')
@utils.service_type('share')
def do_quota_class_show(cs, args):
"""List the quotas for a quota class."""
@ -659,14 +659,14 @@ def do_quota_class_show(cs, args):
metavar='<gigabytes>',
type=int, default=None,
help='New value for the "gigabytes" quota.')
@utils.service_type('volume')
@utils.service_type('share')
def do_quota_class_update(cs, args):
"""Update the quotas for a quota class."""
_quota_update(cs.quota_classes, args.class_name, args)
@utils.service_type('volume')
@utils.service_type('share')
def do_absolute_limits(cs, args):
"""Print a list of absolute limits for a user"""
limits = cs.limits.get().absolute
@ -674,7 +674,7 @@ def do_absolute_limits(cs, args):
utils.print_list(limits, columns)
@utils.service_type('volume')
@utils.service_type('share')
def do_rate_limits(cs, args):
"""Print a list of rate limits for a user"""
limits = cs.limits.get().rate
@ -722,7 +722,7 @@ def _find_volume_type(cs, vtype):
help='Name for created image')
@utils.arg('--image_name',
help=argparse.SUPPRESS)
@utils.service_type('volume')
@utils.service_type('share')
def do_upload_to_image(cs, args):
"""Upload volume to image service as image."""
volume = _find_volume(cs, args.volume_id)
@ -748,7 +748,7 @@ def do_upload_to_image(cs, args):
metavar='<description>',
default=None,
help='Options backup description (Default=None)')
@utils.service_type('volume')
@utils.service_type('share')
def do_backup_create(cs, args):
"""Creates a backup."""
if args.display_name is not None:
@ -764,7 +764,7 @@ def do_backup_create(cs, args):
@utils.arg('backup', metavar='<backup>', help='ID of the backup.')
@utils.service_type('volume')
@utils.service_type('share')
def do_backup_show(cs, args):
"""Show details about a backup."""
backup = _find_backup(cs, args.backup)
@ -777,7 +777,7 @@ def do_backup_show(cs, args):
utils.print_dict(info)
@utils.service_type('volume')
@utils.service_type('share')
def do_backup_list(cs, args):
"""List all the backups."""
backups = cs.backups.list()
@ -788,7 +788,7 @@ def do_backup_list(cs, args):
@utils.arg('backup', metavar='<backup>',
help='ID of the backup to delete.')
@utils.service_type('volume')
@utils.service_type('share')
def do_backup_delete(cs, args):
"""Remove a backup."""
backup = _find_backup(cs, args.backup)
@ -800,7 +800,7 @@ def do_backup_delete(cs, args):
@utils.arg('--volume-id', metavar='<volume-id>',
help='Optional ID of the volume to restore to.',
default=None)
@utils.service_type('volume')
@utils.service_type('share')
def do_backup_restore(cs, args):
"""Restore a backup."""
cs.restores.restore(args.backup,
@ -832,7 +832,7 @@ def do_backup_restore(cs, args):
metavar='<description>',
help='Optional share description. (Default=None)',
default=None)
@utils.service_type('volume')
@utils.service_type('share')
def do_share_create(cs, args):
"""Creates new NAS storage (NFS or CIFS)."""
share = cs.shares.create(args.share_protocol, args.size, args.snapshot_id,
@ -844,7 +844,7 @@ def do_share_create(cs, args):
'share',
metavar='<share>',
help='ID of the NAS to delete.')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_delete(cs, args):
"""Deletes NAS storage."""
cs.shares.delete(args.share)
@ -854,7 +854,7 @@ def do_share_delete(cs, args):
'share',
metavar='<share>',
help='ID of the NAS share.')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_show(cs, args):
"""Show details about a NAS share."""
share = _find_share(cs, args.share)
@ -873,7 +873,7 @@ def do_share_show(cs, args):
'access_to',
metavar='<access_to>',
help='Value that defines access')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_allow(cs, args):
"""Allow access to the share."""
share = _find_share(cs, args.share)
@ -888,7 +888,7 @@ def do_share_allow(cs, args):
'id',
metavar='<id>',
help='id of the access rule to be deleted.')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_deny(cs, args):
"""Deny access to a share."""
share = _find_share(cs, args.share)
@ -899,7 +899,7 @@ def do_share_deny(cs, args):
'share',
metavar='<share>',
help='ID of the share.')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_access_list(cs, args):
"""Show access list for share."""
share = _find_share(cs, args.share)
@ -926,7 +926,7 @@ def do_share_access_list(cs, args):
metavar='<status>',
default=None,
help='Filter results by status')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_list(cs, args):
"""List all NAS shares."""
all_tenants = int(os.environ.get("ALL_TENANTS", args.all_tenants))
@ -965,7 +965,7 @@ def do_share_list(cs, args):
metavar='<share-id>',
default=None,
help='Filter results by share-id')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_snapshot_list(cs, args):
"""List all the snapshots."""
all_tenants = int(os.environ.get("ALL_TENANTS", args.all_tenants))
@ -984,7 +984,7 @@ def do_share_snapshot_list(cs, args):
'snapshot',
metavar='<snapshot>',
help='ID of the snapshot.')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_snapshot_show(cs, args):
"""Show details about a snapshot."""
snapshot = _find_share_snapshot(cs, args.snapshot)
@ -1012,7 +1012,7 @@ def do_share_snapshot_show(cs, args):
metavar='<description>',
default=None,
help='Optional snapshot description. (Default=None)')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_snapshot_create(cs, args):
"""Add a new snapshot."""
snapshot = cs.share_snapshots.create(args.share_id,
@ -1026,7 +1026,7 @@ def do_share_snapshot_create(cs, args):
'snapshot_id',
metavar='<snapshot-id>',
help='ID of the snapshot to delete.')
@utils.service_type('volume')
@utils.service_type('share')
def do_share_snapshot_delete(cs, args):
"""Remove a snapshot."""
snapshot = _find_share_snapshot(cs, args.snapshot_id)