Merge "Change '_' to '-' in options"
This commit is contained in:
commit
a153f10b2b
52
README.rst
52
README.rst
@ -40,14 +40,14 @@ Installing this package gets you a shell command, ``cinder``, that you
|
|||||||
can use to interact with any Rackspace compatible API (including OpenStack).
|
can use to interact with any Rackspace compatible API (including OpenStack).
|
||||||
|
|
||||||
You'll need to provide your OpenStack username and password. You can do this
|
You'll need to provide your OpenStack username and password. You can do this
|
||||||
with the ``--os_username``, ``--os_password`` and ``--os_tenant_name``
|
with the ``--os-username``, ``--os-password`` and ``--os-tenant-name``
|
||||||
params, but it's easier to just set them as environment variables::
|
params, but it's easier to just set them as environment variables::
|
||||||
|
|
||||||
export OS_USERNAME=openstack
|
export OS_USERNAME=openstack
|
||||||
export OS_PASSWORD=yadayada
|
export OS_PASSWORD=yadayada
|
||||||
export OS_TENANT_NAME=myproject
|
export OS_TENANT_NAME=myproject
|
||||||
|
|
||||||
You will also need to define the authentication url with ``--os_auth_url``
|
You will also need to define the authentication url with ``--os-auth-url``
|
||||||
and the version of the API with ``--version``. Or set them as an environment
|
and the version of the API with ``--version``. Or set them as an environment
|
||||||
variables as well::
|
variables as well::
|
||||||
|
|
||||||
@ -60,19 +60,20 @@ endpoint::
|
|||||||
export OS_AUTH_URL=http://example.com:5000/v2.0/
|
export OS_AUTH_URL=http://example.com:5000/v2.0/
|
||||||
|
|
||||||
Since Keystone can return multiple regions in the Service Catalog, you
|
Since Keystone can return multiple regions in the Service Catalog, you
|
||||||
can specify the one you want with ``--os_region_name`` (or
|
can specify the one you want with ``--os-region-name`` (or
|
||||||
``export OS_REGION_NAME``). It defaults to the first in the list returned.
|
``export OS_REGION_NAME``). It defaults to the first in the list returned.
|
||||||
|
|
||||||
You'll find complete documentation on the shell by running
|
You'll find complete documentation on the shell by running
|
||||||
``cinder help``::
|
``cinder help``::
|
||||||
|
|
||||||
usage: cinder [--debug] [--os_username OS_USERNAME] [--os_password OS_PASSWORD]
|
usage: cinder [--debug] [--os-username <auth-user-name>]
|
||||||
[--os_tenant_name OS_TENANT_NAME] [--os_auth_url OS_AUTH_URL]
|
[--os-password <auth-password>]
|
||||||
[--os_region_name OS_REGION_NAME] [--service_type SERVICE_TYPE]
|
[--os-tenant-name <auth-tenant-name>] [--os-auth-url <auth-url>]
|
||||||
[--service_name SERVICE_NAME] [--endpoint_type ENDPOINT_TYPE]
|
[--os-region-name <region-name>] [--service-type <service-type>]
|
||||||
[--version VERSION] [--username USERNAME]
|
[--service-name <service-name>]
|
||||||
[--region_name REGION_NAME] [--apikey APIKEY]
|
[--volume-service-name <volume-service-name>]
|
||||||
[--projectid PROJECTID] [--url URL]
|
[--endpoint-type <endpoint-type>]
|
||||||
|
[--os-volume-api-version <compute-api-ver>]
|
||||||
<subcommand> ...
|
<subcommand> ...
|
||||||
|
|
||||||
Command-line interface to the OpenStack Nova API.
|
Command-line interface to the OpenStack Nova API.
|
||||||
@ -100,33 +101,26 @@ You'll find complete documentation on the shell by running
|
|||||||
|
|
||||||
Optional arguments:
|
Optional arguments:
|
||||||
--debug Print debugging output
|
--debug Print debugging output
|
||||||
--os_username OS_USERNAME
|
--os-username <auth-user-name>
|
||||||
Defaults to env[OS_USERNAME].
|
Defaults to env[OS_USERNAME].
|
||||||
--os_password OS_PASSWORD
|
--os-password <auth-password>
|
||||||
Defaults to env[OS_PASSWORD].
|
Defaults to env[OS_PASSWORD].
|
||||||
--os_tenant_name OS_TENANT_NAME
|
--os-tenant-name <auth-tenant-name>
|
||||||
Defaults to env[OS_TENANT_NAME].
|
Defaults to env[OS_TENANT_NAME].
|
||||||
--os_auth_url OS_AUTH_URL
|
--os-auth-url <auth-url>
|
||||||
Defaults to env[OS_AUTH_URL].
|
Defaults to env[OS_AUTH_URL].
|
||||||
--os_region_name OS_REGION_NAME
|
--os-region-name <region-name>
|
||||||
Defaults to env[OS_REGION_NAME].
|
Defaults to env[OS_REGION_NAME].
|
||||||
--service_type SERVICE_TYPE
|
--service-type <service-type>
|
||||||
Defaults to compute for most actions
|
Defaults to compute for most actions
|
||||||
--service_name SERVICE_NAME
|
--service-name <service-name>
|
||||||
Defaults to env[CINDER_SERVICE_NAME]
|
Defaults to env[CINDER_SERVICE_NAME]
|
||||||
--endpoint_type ENDPOINT_TYPE
|
--volume-service-name <volume-service-name>
|
||||||
|
Defaults to env[CINDER_VOLUME_SERVICE_NAME]
|
||||||
|
--endpoint-type <endpoint-type>
|
||||||
Defaults to env[CINDER_ENDPOINT_TYPE] or publicURL.
|
Defaults to env[CINDER_ENDPOINT_TYPE] or publicURL.
|
||||||
--os_compute_api_version VERSION
|
--os-volume-api-version <compute-api-ver>
|
||||||
Accepts 1.1, defaults to env[OS_COMPUTE_API_VERSION].
|
Accepts 1, defaults to env[OS_VOLUME_API_VERSION].
|
||||||
--username USERNAME Deprecated
|
|
||||||
--region_name REGION_NAME
|
|
||||||
Deprecated
|
|
||||||
--apikey APIKEY, --password APIKEY
|
|
||||||
Deprecated
|
|
||||||
--projectid PROJECTID, --tenant_name PROJECTID
|
|
||||||
Deprecated
|
|
||||||
--url URL, --auth_url URL
|
|
||||||
Deprecated
|
|
||||||
|
|
||||||
See "cinder help COMMAND" for help on a specific command.
|
See "cinder help COMMAND" for help on a specific command.
|
||||||
|
|
||||||
|
@ -85,53 +85,83 @@ class OpenStackCinderShell(object):
|
|||||||
action='store_true',
|
action='store_true',
|
||||||
help="Print debugging output")
|
help="Print debugging output")
|
||||||
|
|
||||||
parser.add_argument('--os_username',
|
parser.add_argument('--os-username',
|
||||||
|
metavar='<auth-user-name>',
|
||||||
default=utils.env('OS_USERNAME',
|
default=utils.env('OS_USERNAME',
|
||||||
'CINDER_USERNAME'),
|
'CINDER_USERNAME'),
|
||||||
help='Defaults to env[OS_USERNAME].')
|
help='Defaults to env[OS_USERNAME].')
|
||||||
|
parser.add_argument('--os_username',
|
||||||
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
parser.add_argument('--os_password',
|
parser.add_argument('--os-password',
|
||||||
|
metavar='<auth-password>',
|
||||||
default=utils.env('OS_PASSWORD',
|
default=utils.env('OS_PASSWORD',
|
||||||
'CINDER_PASSWORD'),
|
'CINDER_PASSWORD'),
|
||||||
help='Defaults to env[OS_PASSWORD].')
|
help='Defaults to env[OS_PASSWORD].')
|
||||||
|
parser.add_argument('--os_password',
|
||||||
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
parser.add_argument('--os_tenant_name',
|
parser.add_argument('--os-tenant-name',
|
||||||
|
metavar='<auth-tenant-name>',
|
||||||
default=utils.env('OS_TENANT_NAME',
|
default=utils.env('OS_TENANT_NAME',
|
||||||
'CINDER_PROJECT_ID'),
|
'CINDER_PROJECT_ID'),
|
||||||
help='Defaults to env[OS_TENANT_NAME].')
|
help='Defaults to env[OS_TENANT_NAME].')
|
||||||
|
parser.add_argument('--os_tenant_name',
|
||||||
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
parser.add_argument('--os_auth_url',
|
parser.add_argument('--os-auth-url',
|
||||||
|
metavar='<auth-url>',
|
||||||
default=utils.env('OS_AUTH_URL',
|
default=utils.env('OS_AUTH_URL',
|
||||||
'CINDER_URL'),
|
'CINDER_URL'),
|
||||||
help='Defaults to env[OS_AUTH_URL].')
|
help='Defaults to env[OS_AUTH_URL].')
|
||||||
|
parser.add_argument('--os_auth_url',
|
||||||
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
parser.add_argument('--os_region_name',
|
parser.add_argument('--os-region-name',
|
||||||
|
metavar='<region-name>',
|
||||||
default=utils.env('OS_REGION_NAME',
|
default=utils.env('OS_REGION_NAME',
|
||||||
'CINDER_REGION_NAME'),
|
'CINDER_REGION_NAME'),
|
||||||
help='Defaults to env[OS_REGION_NAME].')
|
help='Defaults to env[OS_REGION_NAME].')
|
||||||
|
parser.add_argument('--os_region_name',
|
||||||
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
parser.add_argument('--service_type',
|
parser.add_argument('--service-type',
|
||||||
|
metavar='<service-type>',
|
||||||
help='Defaults to compute for most actions')
|
help='Defaults to compute for most actions')
|
||||||
|
parser.add_argument('--service_type',
|
||||||
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
parser.add_argument('--service_name',
|
parser.add_argument('--service-name',
|
||||||
|
metavar='<service-name>',
|
||||||
default=utils.env('CINDER_SERVICE_NAME'),
|
default=utils.env('CINDER_SERVICE_NAME'),
|
||||||
help='Defaults to env[CINDER_SERVICE_NAME]')
|
help='Defaults to env[CINDER_SERVICE_NAME]')
|
||||||
|
parser.add_argument('--service_name',
|
||||||
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
parser.add_argument('--volume_service_name',
|
parser.add_argument('--volume-service-name',
|
||||||
|
metavar='<volume-service-name>',
|
||||||
default=utils.env('CINDER_VOLUME_SERVICE_NAME'),
|
default=utils.env('CINDER_VOLUME_SERVICE_NAME'),
|
||||||
help='Defaults to env[CINDER_VOLUME_SERVICE_NAME]')
|
help='Defaults to env[CINDER_VOLUME_SERVICE_NAME]')
|
||||||
|
parser.add_argument('--volume_service_name',
|
||||||
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
parser.add_argument('--endpoint_type',
|
parser.add_argument('--endpoint-type',
|
||||||
|
metavar='<endpoint-type>',
|
||||||
default=utils.env('CINDER_ENDPOINT_TYPE',
|
default=utils.env('CINDER_ENDPOINT_TYPE',
|
||||||
default=DEFAULT_CINDER_ENDPOINT_TYPE),
|
default=DEFAULT_CINDER_ENDPOINT_TYPE),
|
||||||
help='Defaults to env[CINDER_ENDPOINT_TYPE] or '
|
help='Defaults to env[CINDER_ENDPOINT_TYPE] or '
|
||||||
+ DEFAULT_CINDER_ENDPOINT_TYPE + '.')
|
+ DEFAULT_CINDER_ENDPOINT_TYPE + '.')
|
||||||
|
parser.add_argument('--endpoint_type',
|
||||||
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
parser.add_argument('--os_volume_api_version',
|
parser.add_argument('--os-volume-api-version',
|
||||||
|
metavar='<compute-api-ver>',
|
||||||
default=utils.env('OS_VOLUME_API_VERSION',
|
default=utils.env('OS_VOLUME_API_VERSION',
|
||||||
default=DEFAULT_OS_VOLUME_API_VERSION),
|
default=DEFAULT_OS_VOLUME_API_VERSION),
|
||||||
help='Accepts 1,defaults '
|
help='Accepts 1,defaults '
|
||||||
'to env[OS_VOLUME_API_VERSION].')
|
'to env[OS_VOLUME_API_VERSION].')
|
||||||
|
parser.add_argument('--os_volume_api_version',
|
||||||
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
parser.add_argument('--insecure',
|
parser.add_argument('--insecure',
|
||||||
default=utils.env('CINDERCLIENT_INSECURE',
|
default=utils.env('CINDERCLIENT_INSECURE',
|
||||||
@ -142,28 +172,28 @@ class OpenStackCinderShell(object):
|
|||||||
# FIXME(dtroyer): The args below are here for diablo compatibility,
|
# FIXME(dtroyer): The args below are here for diablo compatibility,
|
||||||
# remove them in folsum cycle
|
# remove them in folsum cycle
|
||||||
|
|
||||||
# alias for --os_username, left in for backwards compatibility
|
# alias for --os-username, left in for backwards compatibility
|
||||||
parser.add_argument('--username',
|
parser.add_argument('--username',
|
||||||
help='Deprecated')
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
# alias for --os_region_name, left in for backwards compatibility
|
# alias for --os-region_name, left in for backwards compatibility
|
||||||
parser.add_argument('--region_name',
|
parser.add_argument('--region_name',
|
||||||
help='Deprecated')
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
# alias for --os_password, left in for backwards compatibility
|
# alias for --os-password, left in for backwards compatibility
|
||||||
parser.add_argument('--apikey', '--password', dest='apikey',
|
parser.add_argument('--apikey', '--password', dest='apikey',
|
||||||
default=utils.env('CINDER_API_KEY'),
|
default=utils.env('CINDER_API_KEY'),
|
||||||
help='Deprecated')
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
# alias for --os_tenant_name, left in for backward compatibility
|
# alias for --os-tenant-name, left in for backward compatibility
|
||||||
parser.add_argument('--projectid', '--tenant_name', dest='projectid',
|
parser.add_argument('--projectid', '--tenant_name', dest='projectid',
|
||||||
default=utils.env('CINDER_PROJECT_ID'),
|
default=utils.env('CINDER_PROJECT_ID'),
|
||||||
help='Deprecated')
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
# alias for --os_auth_url, left in for backward compatibility
|
# alias for --os-auth-url, left in for backward compatibility
|
||||||
parser.add_argument('--url', '--auth_url', dest='url',
|
parser.add_argument('--url', '--auth_url', dest='url',
|
||||||
default=utils.env('CINDER_URL'),
|
default=utils.env('CINDER_URL'),
|
||||||
help='Deprecated')
|
help=argparse.SUPPRESS)
|
||||||
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
@ -274,7 +304,7 @@ class OpenStackCinderShell(object):
|
|||||||
httplib2.debuglevel = 1
|
httplib2.debuglevel = 1
|
||||||
|
|
||||||
def main(self, argv):
|
def main(self, argv):
|
||||||
# Parse args once to find version
|
# Parse args once to find version and debug settings
|
||||||
parser = self.get_base_parser()
|
parser = self.get_base_parser()
|
||||||
(options, args) = parser.parse_known_args(argv)
|
(options, args) = parser.parse_known_args(argv)
|
||||||
self.setup_debugging(options.debug)
|
self.setup_debugging(options.debug)
|
||||||
@ -330,14 +360,14 @@ class OpenStackCinderShell(object):
|
|||||||
if not username:
|
if not username:
|
||||||
raise exc.CommandError(
|
raise exc.CommandError(
|
||||||
"You must provide a username "
|
"You must provide a username "
|
||||||
"via either --os_username or env[OS_USERNAME]")
|
"via either --os-username or env[OS_USERNAME]")
|
||||||
else:
|
else:
|
||||||
os_username = username
|
os_username = username
|
||||||
|
|
||||||
if not os_password:
|
if not os_password:
|
||||||
if not apikey:
|
if not apikey:
|
||||||
raise exc.CommandError("You must provide a password "
|
raise exc.CommandError("You must provide a password "
|
||||||
"via either --os_password or via "
|
"via either --os-password or via "
|
||||||
"env[OS_PASSWORD]")
|
"env[OS_PASSWORD]")
|
||||||
else:
|
else:
|
||||||
os_password = apikey
|
os_password = apikey
|
||||||
@ -345,7 +375,7 @@ class OpenStackCinderShell(object):
|
|||||||
if not os_tenant_name:
|
if not os_tenant_name:
|
||||||
if not projectid:
|
if not projectid:
|
||||||
raise exc.CommandError("You must provide a tenant name "
|
raise exc.CommandError("You must provide a tenant name "
|
||||||
"via either --os_tenant_name or "
|
"via either --os-tenant-name or "
|
||||||
"env[OS_TENANT_NAME]")
|
"env[OS_TENANT_NAME]")
|
||||||
else:
|
else:
|
||||||
os_tenant_name = projectid
|
os_tenant_name = projectid
|
||||||
@ -354,7 +384,7 @@ class OpenStackCinderShell(object):
|
|||||||
if not url:
|
if not url:
|
||||||
raise exc.CommandError(
|
raise exc.CommandError(
|
||||||
"You must provide an auth url "
|
"You must provide an auth url "
|
||||||
"via either --os_auth_url or env[OS_AUTH_URL]")
|
"via either --os-auth-url or env[OS_AUTH_URL]")
|
||||||
else:
|
else:
|
||||||
os_auth_url = url
|
os_auth_url = url
|
||||||
|
|
||||||
@ -364,12 +394,12 @@ class OpenStackCinderShell(object):
|
|||||||
if not os_tenant_name:
|
if not os_tenant_name:
|
||||||
raise exc.CommandError(
|
raise exc.CommandError(
|
||||||
"You must provide a tenant name "
|
"You must provide a tenant name "
|
||||||
"via either --os_tenant_name or env[OS_TENANT_NAME]")
|
"via either --os-tenant-name or env[OS_TENANT_NAME]")
|
||||||
|
|
||||||
if not os_auth_url:
|
if not os_auth_url:
|
||||||
raise exc.CommandError(
|
raise exc.CommandError(
|
||||||
"You must provide an auth url "
|
"You must provide an auth url "
|
||||||
"via either --os_auth_url or env[OS_AUTH_URL]")
|
"via either --os-auth-url or env[OS_AUTH_URL]")
|
||||||
|
|
||||||
self.cs = client.Client(options.os_volume_api_version, os_username,
|
self.cs = client.Client(options.os_volume_api_version, os_username,
|
||||||
os_password, os_tenant_name, os_auth_url,
|
os_password, os_tenant_name, os_auth_url,
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import argparse
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
@ -101,7 +102,8 @@ def _extract_metadata(arg_list):
|
|||||||
return metadata
|
return metadata
|
||||||
|
|
||||||
|
|
||||||
@utils.arg('--all_tenants',
|
@utils.arg(
|
||||||
|
'--all-tenants',
|
||||||
dest='all_tenants',
|
dest='all_tenants',
|
||||||
metavar='<0|1>',
|
metavar='<0|1>',
|
||||||
nargs='?',
|
nargs='?',
|
||||||
@ -109,6 +111,12 @@ def _extract_metadata(arg_list):
|
|||||||
const=1,
|
const=1,
|
||||||
default=0,
|
default=0,
|
||||||
help='Display information from all tenants (Admin only).')
|
help='Display information from all tenants (Admin only).')
|
||||||
|
@utils.arg(
|
||||||
|
'--all_tenants',
|
||||||
|
nargs='?',
|
||||||
|
type=int,
|
||||||
|
const=1,
|
||||||
|
help=argparse.SUPPRESS)
|
||||||
@utils.service_type('volume')
|
@utils.service_type('volume')
|
||||||
def do_list(cs, args):
|
def do_list(cs, args):
|
||||||
"""List all the volumes."""
|
"""List all the volumes."""
|
||||||
@ -137,33 +145,59 @@ def do_show(cs, args):
|
|||||||
metavar='<size>',
|
metavar='<size>',
|
||||||
type=int,
|
type=int,
|
||||||
help='Size of volume in GB')
|
help='Size of volume in GB')
|
||||||
|
@utils.arg(
|
||||||
|
'--snapshot-id',
|
||||||
|
metavar='<snapshot-id>',
|
||||||
|
default=None,
|
||||||
|
help='Create volume from snapshot id (Optional, Default=None)')
|
||||||
@utils.arg(
|
@utils.arg(
|
||||||
'--snapshot_id',
|
'--snapshot_id',
|
||||||
metavar='<snapshot_id>',
|
help=argparse.SUPPRESS)
|
||||||
help='Optional snapshot id to create the volume from. (Default=None)',
|
@utils.arg(
|
||||||
default=None)
|
'--image-id',
|
||||||
@utils.arg('--image_id',
|
metavar='<image-id>',
|
||||||
metavar='<image_id>',
|
default=None,
|
||||||
help='Optional image id to create the volume from. (Default=None)',
|
help='Create volume from image id (Optional, Default=None)')
|
||||||
default=None)
|
@utils.arg(
|
||||||
@utils.arg('--display_name', metavar='<display_name>',
|
'--image_id',
|
||||||
help='Optional volume name. (Default=None)',
|
help=argparse.SUPPRESS)
|
||||||
default=None)
|
@utils.arg(
|
||||||
@utils.arg('--display_description', metavar='<display_description>',
|
'--display-name',
|
||||||
help='Optional volume description. (Default=None)',
|
metavar='<display-name>',
|
||||||
default=None)
|
default=None,
|
||||||
@utils.arg('--volume_type',
|
help='Volume name (Optional, Default=None)')
|
||||||
metavar='<volume_type>',
|
@utils.arg(
|
||||||
help='Optional volume type. (Default=None)',
|
'--display_name',
|
||||||
default=None)
|
help=argparse.SUPPRESS)
|
||||||
@utils.arg('--availability_zone', metavar='<availability_zone>',
|
@utils.arg(
|
||||||
help='Optional availability zone for volume. (Default=None)',
|
'--display-description',
|
||||||
default=None)
|
metavar='<display-description>',
|
||||||
|
default=None,
|
||||||
|
help='Volume description (Optional, Default=None)')
|
||||||
|
@utils.arg(
|
||||||
|
'--display_description',
|
||||||
|
help=argparse.SUPPRESS)
|
||||||
|
@utils.arg(
|
||||||
|
'--volume-type',
|
||||||
|
metavar='<volume-type>',
|
||||||
|
default=None,
|
||||||
|
help='Volume type (Optional, Default=None)')
|
||||||
|
@utils.arg(
|
||||||
|
'--volume_type',
|
||||||
|
help=argparse.SUPPRESS)
|
||||||
|
@utils.arg(
|
||||||
|
'--availability-zone',
|
||||||
|
metavar='<availability-zone>',
|
||||||
|
default=None,
|
||||||
|
help='Availability zone for volume (Optional, Default=None)')
|
||||||
|
@utils.arg(
|
||||||
|
'--availability_zone',
|
||||||
|
help=argparse.SUPPRESS)
|
||||||
@utils.arg('--metadata',
|
@utils.arg('--metadata',
|
||||||
type=str,
|
type=str,
|
||||||
nargs='*',
|
nargs='*',
|
||||||
metavar='<key=value>',
|
metavar='<key=value>',
|
||||||
help='Optional metadata kv pairs. (Default=None)',
|
help='Metadata key=value pairs (Optional, Default=None)',
|
||||||
default=None)
|
default=None)
|
||||||
@utils.service_type('volume')
|
@utils.service_type('volume')
|
||||||
def do_create(cs, args):
|
def do_create(cs, args):
|
||||||
@ -191,7 +225,8 @@ def do_delete(cs, args):
|
|||||||
volume.delete()
|
volume.delete()
|
||||||
|
|
||||||
|
|
||||||
@utils.arg('--all_tenants',
|
@utils.arg(
|
||||||
|
'--all-tenants',
|
||||||
dest='all_tenants',
|
dest='all_tenants',
|
||||||
metavar='<0|1>',
|
metavar='<0|1>',
|
||||||
nargs='?',
|
nargs='?',
|
||||||
@ -199,6 +234,12 @@ def do_delete(cs, args):
|
|||||||
const=1,
|
const=1,
|
||||||
default=0,
|
default=0,
|
||||||
help='Display information from all tenants (Admin only).')
|
help='Display information from all tenants (Admin only).')
|
||||||
|
@utils.arg(
|
||||||
|
'--all_tenants',
|
||||||
|
nargs='?',
|
||||||
|
type=int,
|
||||||
|
const=1,
|
||||||
|
help=argparse.SUPPRESS)
|
||||||
@utils.service_type('volume')
|
@utils.service_type('volume')
|
||||||
def do_snapshot_list(cs, args):
|
def do_snapshot_list(cs, args):
|
||||||
"""List all the snapshots."""
|
"""List all the snapshots."""
|
||||||
@ -220,7 +261,7 @@ def do_snapshot_show(cs, args):
|
|||||||
|
|
||||||
|
|
||||||
@utils.arg('volume_id',
|
@utils.arg('volume_id',
|
||||||
metavar='<volume_id>',
|
metavar='<volume-id>',
|
||||||
help='ID of the volume to snapshot')
|
help='ID of the volume to snapshot')
|
||||||
@utils.arg('--force',
|
@utils.arg('--force',
|
||||||
metavar='<True|False>',
|
metavar='<True|False>',
|
||||||
@ -228,12 +269,22 @@ def do_snapshot_show(cs, args):
|
|||||||
'to snapshot a volume even if its '
|
'to snapshot a volume even if its '
|
||||||
'attached to an instance. (Default=False)',
|
'attached to an instance. (Default=False)',
|
||||||
default=False)
|
default=False)
|
||||||
@utils.arg('--display_name', metavar='<display_name>',
|
@utils.arg(
|
||||||
help='Optional snapshot name. (Default=None)',
|
'--display-name',
|
||||||
default=None)
|
metavar='<display-name>',
|
||||||
@utils.arg('--display_description', metavar='<display_description>',
|
default=None,
|
||||||
help='Optional snapshot description. (Default=None)',
|
help='Optional snapshot name. (Default=None)')
|
||||||
default=None)
|
@utils.arg(
|
||||||
|
'--display_name',
|
||||||
|
help=argparse.SUPPRESS)
|
||||||
|
@utils.arg(
|
||||||
|
'--display-description',
|
||||||
|
metavar='<display-description>',
|
||||||
|
default=None,
|
||||||
|
help='Optional snapshot description. (Default=None)')
|
||||||
|
@utils.arg(
|
||||||
|
'--display_description',
|
||||||
|
help=argparse.SUPPRESS)
|
||||||
@utils.service_type('volume')
|
@utils.service_type('volume')
|
||||||
def do_snapshot_create(cs, args):
|
def do_snapshot_create(cs, args):
|
||||||
"""Add a new snapshot."""
|
"""Add a new snapshot."""
|
||||||
@ -244,7 +295,7 @@ def do_snapshot_create(cs, args):
|
|||||||
|
|
||||||
|
|
||||||
@utils.arg('snapshot_id',
|
@utils.arg('snapshot_id',
|
||||||
metavar='<snapshot_id>',
|
metavar='<snapshot-id>',
|
||||||
help='ID of the snapshot to delete.')
|
help='ID of the snapshot to delete.')
|
||||||
@utils.service_type('volume')
|
@utils.service_type('volume')
|
||||||
def do_snapshot_delete(cs, args):
|
def do_snapshot_delete(cs, args):
|
||||||
|
@ -11,8 +11,8 @@ First, you'll need an OpenStack Nova account and an API key. You get this
|
|||||||
by using the `cinder-manage` command in OpenStack Nova.
|
by using the `cinder-manage` command in OpenStack Nova.
|
||||||
|
|
||||||
You'll need to provide :program:`cinder` with your OpenStack username and
|
You'll need to provide :program:`cinder` with your OpenStack username and
|
||||||
API key. You can do this with the :option:`--os_username`, :option:`--os_password`
|
API key. You can do this with the :option:`--os-username`, :option:`--os-password`
|
||||||
and :option:`--os_tenant_id` options, but it's easier to just set them as
|
and :option:`--os-tenant-id` options, but it's easier to just set them as
|
||||||
environment variables by setting two environment variables:
|
environment variables by setting two environment variables:
|
||||||
|
|
||||||
.. envvar:: OS_USERNAME
|
.. envvar:: OS_USERNAME
|
||||||
|
Loading…
x
Reference in New Issue
Block a user