Merge "Added optional availability_zone flag for instance"
This commit is contained in:
@@ -44,7 +44,8 @@ class InstanceCommands(common.AuthedCommandsBase):
|
||||
'marker',
|
||||
'name',
|
||||
'size',
|
||||
'backup'
|
||||
'backup',
|
||||
'availability_zone'
|
||||
]
|
||||
|
||||
def create(self):
|
||||
@@ -57,7 +58,8 @@ class InstanceCommands(common.AuthedCommandsBase):
|
||||
if self.backup:
|
||||
restorePoint = {"backupRef": self.backup}
|
||||
self._pretty_print(self.dbaas.instances.create, self.name,
|
||||
self.flavor, volume, restorePoint=restorePoint)
|
||||
self.flavor, volume, restorePoint=restorePoint,
|
||||
availability_zone=self.availability_zone)
|
||||
|
||||
def delete(self):
|
||||
"""Delete the specified instance"""
|
||||
|
||||
@@ -56,7 +56,7 @@ class Instances(base.ManagerWithFind):
|
||||
resource_class = Instance
|
||||
|
||||
def create(self, name, flavor_id, volume=None, databases=None, users=None,
|
||||
restorePoint=None):
|
||||
restorePoint=None, availability_zone=None):
|
||||
"""
|
||||
Create (boot) a new instance.
|
||||
"""
|
||||
@@ -72,6 +72,8 @@ class Instances(base.ManagerWithFind):
|
||||
body["instance"]["users"] = users
|
||||
if restorePoint:
|
||||
body["instance"]["restorePoint"] = restorePoint
|
||||
if availability_zone:
|
||||
body["instance"]["availability_zone"] = availability_zone
|
||||
|
||||
return self._create("/instances", body, "instance")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user