Add an API extension for creating+deleting flavors
This extension is a step towards deprecating openstackx for horizon.
Most of the extension code is based on the equivalent in openstackx.
v2:
s/lifecycle/manage/ for all bits
Address Pádraig style issues
Drop purge API option
Adjust now inaccurate comment in DB api
Make extension admin_only
Extend existing /flavors namespace rather than os-flavor-lifecycle
Only allow API access from admin user
v3:
Some pep8 fixes
v4:
Adjust to root_gb, ephemeral_gb changes
Drop admin_only (it's on the way out AIUI)
Change-Id: I3fdfccdd8e7337e1759f5875c3b15fa9954371ef
This commit is contained in:
@@ -30,9 +30,15 @@ FLAGS = flags.FLAGS
|
||||
LOG = logging.getLogger('nova.instance_types')
|
||||
|
||||
|
||||
def create(name, memory, vcpus, root_gb, ephemeral_gb, flavorid, swap=0,
|
||||
rxtx_factor=1):
|
||||
def create(name, memory, vcpus, root_gb, ephemeral_gb, flavorid, swap=None,
|
||||
rxtx_factor=None):
|
||||
"""Creates instance types."""
|
||||
|
||||
if swap is None:
|
||||
swap = 0
|
||||
if rxtx_factor is None:
|
||||
rxtx_factor = 1
|
||||
|
||||
kwargs = {
|
||||
'memory_mb': memory,
|
||||
'vcpus': vcpus,
|
||||
|
||||
Reference in New Issue
Block a user