diff options
| author | unicell <unicell@gmail.com> | 2012-08-13 20:19:54 +0800 |
|---|---|---|
| committer | unicell <unicell@gmail.com> | 2012-08-27 23:45:05 +0800 |
| commit | 34c012c709cc5ae577330c7d67ba060293158210 (patch) | |
| tree | e04765cbb3e09e9047c51aa9e03d4b1db15ac80c /bin | |
| parent | 5e012d8d45935b68a5ce5d50ed043d4bb8066cf8 (diff) | |
| download | nova-34c012c709cc5ae577330c7d67ba060293158210.tar.gz nova-34c012c709cc5ae577330c7d67ba060293158210.tar.xz nova-34c012c709cc5ae577330c7d67ba060293158210.zip | |
Implement project specific flavors API
blueprint project-specific-flavors
This change implements API extension to manage project specific flavor
types, so that non-public flavor type can only see by projects with
access rights.
Change-Id: Ie2d2c605065b0c76897f843a4548a0c984a05f1a
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/nova-manage | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bin/nova-manage b/bin/nova-manage index 264c13426..7b3769629 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -828,11 +828,12 @@ class InstanceTypeCommands(object): def _print_instance_types(self, name, val): deleted = ('', ', inactive')[val["deleted"] == 1] + is_public = ('private', 'public')[val["is_public"] == 1] print ("%s: Memory: %sMB, VCPUS: %s, Root: %sGB, Ephemeral: %sGb, " - "FlavorID: %s, Swap: %sMB, RXTX Factor: %s, ExtraSpecs %s") % ( + "FlavorID: %s, Swap: %sMB, RXTX Factor: %s, %s, ExtraSpecs %s") % ( name, val["memory_mb"], val["vcpus"], val["root_gb"], val["ephemeral_gb"], val["flavorid"], val["swap"], - val["rxtx_factor"], val["extra_specs"]) + val["rxtx_factor"], is_public, val["extra_specs"]) @args('--name', dest='name', metavar='<name>', help='Name of instance type/flavor') @@ -848,12 +849,15 @@ class InstanceTypeCommands(object): @args('--swap', dest='swap', metavar='<swap>', help='Swap') @args('--rxtx_factor', dest='rxtx_factor', metavar='<rxtx_factor>', help='rxtx_factor') + @args('--is_public', dest="is_public", metavar='<is_public>', + help='Make flavor accessible to the public') def create(self, name, memory, vcpus, root_gb, ephemeral_gb, flavorid, - swap=0, rxtx_factor=1): + swap=0, rxtx_factor=1, is_public=True): """Creates instance types / flavors""" try: instance_types.create(name, memory, vcpus, root_gb, - ephemeral_gb, flavorid, swap, rxtx_factor) + ephemeral_gb, flavorid, swap, rxtx_factor, + is_public) except exception.InvalidInput, e: print "Must supply valid parameters to create instance_type" print e |
