summaryrefslogtreecommitdiff
path: root/troveclient/compat/mcli.py
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-11-13 08:53:57 +0000
committerGerrit Code Review <review@openstack.org>2020-11-13 08:53:57 +0000
commitf28390ee5ddf83c0dfbf886b7e99c192fa7f4ecc (patch)
tree9b5e95d315a4669a526fe1eb9163f45e6a3a0413 /troveclient/compat/mcli.py
parent20566017e5c5c4c5b2ebf3629c062f8f2521e0c7 (diff)
parentc04e299b1d503f2ce67730398b9585a196616e51 (diff)
downloadpython-troveclient-f28390ee5ddf83c0dfbf886b7e99c192fa7f4ecc.tar.gz
Merge "Revert "Remove flavor API""
Diffstat (limited to 'troveclient/compat/mcli.py')
-rw-r--r--troveclient/compat/mcli.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/troveclient/compat/mcli.py b/troveclient/compat/mcli.py
index f151ab7..e3efbae 100644
--- a/troveclient/compat/mcli.py
+++ b/troveclient/compat/mcli.py
@@ -181,6 +181,31 @@ class StorageCommands(common.AuthedCommandsBase):
self._pretty_list(self.dbaas.storage.index)
+class FlavorsCommands(common.AuthedCommandsBase):
+ """Commands for managing Flavors."""
+
+ params = [
+ 'name',
+ 'ram',
+ 'disk',
+ 'vcpus',
+ 'flavor_id',
+ 'ephemeral',
+ 'swap',
+ 'rxtx_factor',
+ 'service_type'
+ ]
+
+ def create(self):
+ """Create a new flavor."""
+ self._require('name', 'ram', 'disk', 'vcpus',
+ 'flavor_id', 'service_type')
+ self._pretty_print(self.dbaas.mgmt_flavor.create, self.name,
+ self.ram, self.disk, self.vcpus, self.flavor_id,
+ self.ephemeral, self.swap, self.rxtx_factor,
+ self.service_type)
+
+
def config_options(oparser):
oparser.add_option("-u", "--url", default="http://localhost:5000/v1.1",
help="Auth API endpoint URL with port and version. \
@@ -194,6 +219,7 @@ COMMANDS = {
'root': RootCommands,
'storage': StorageCommands,
'quota': QuotaCommands,
+ 'flavor': FlavorsCommands,
}