initial support for dynamic instance_types: db migration and model, stub tests and stub methods.
This commit is contained in:
@@ -609,6 +609,44 @@ class VolumeCommands(object):
|
||||
"mountpoint": volume['mountpoint']}})
|
||||
|
||||
|
||||
class InstanceTypesCommands(object):
|
||||
"""Class for managing instance types / flavors."""
|
||||
|
||||
def create(self, name, memory, vcpus, localstorage):
|
||||
"""Creates instance types / flavors
|
||||
arguments: name memory vcpus localstorage"""
|
||||
#for address in IPy.IP(range):
|
||||
# db.floating_ip_create(context.get_admin_context(),
|
||||
# {'address': str(address),
|
||||
# 'host': host})
|
||||
|
||||
def delete(self, name):
|
||||
"""Deletes instance types / flavors
|
||||
arguments: name"""
|
||||
#for address in IPy.IP(ip_range):
|
||||
# db.floating_ip_destroy(context.get_admin_context(),
|
||||
# str(address))
|
||||
|
||||
def list(self):
|
||||
"""Lists all instance types / flavors
|
||||
arguments: <none>"""
|
||||
#ctxt = context.get_admin_context()
|
||||
#if host == None:
|
||||
# floating_ips = db.floating_ip_get_all(ctxt)
|
||||
#else:
|
||||
# floating_ips = db.floating_ip_get_all_by_host(ctxt, host)
|
||||
#for floating_ip in floating_ips:
|
||||
# instance = None
|
||||
# if floating_ip['fixed_ip']:
|
||||
# instance = floating_ip['fixed_ip']['instance']['ec2_id']
|
||||
# print "%s\t%s\t%s" % (floating_ip['host'],
|
||||
# floating_ip['address'],
|
||||
# instance)
|
||||
# print "%-10s %-10s %-8s %s %s" % (svc['host'], svc['binary'],
|
||||
# active, art,
|
||||
# svc['updated_at'])
|
||||
|
||||
|
||||
CATEGORIES = [
|
||||
('user', UserCommands),
|
||||
('project', ProjectCommands),
|
||||
@@ -620,7 +658,8 @@ CATEGORIES = [
|
||||
('service', ServiceCommands),
|
||||
('log', LogCommands),
|
||||
('db', DbCommands),
|
||||
('volume', VolumeCommands)]
|
||||
('volume', VolumeCommands),
|
||||
('instance_types', InstanceTypesCommands)]
|
||||
|
||||
|
||||
def lazy_match(name, key_value_tuples):
|
||||
|
||||
Reference in New Issue
Block a user