diff options
author | Zuul <zuul@review.opendev.org> | 2020-11-13 08:53:57 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2020-11-13 08:53:57 +0000 |
commit | f28390ee5ddf83c0dfbf886b7e99c192fa7f4ecc (patch) | |
tree | 9b5e95d315a4669a526fe1eb9163f45e6a3a0413 /troveclient/compat/mcli.py | |
parent | 20566017e5c5c4c5b2ebf3629c062f8f2521e0c7 (diff) | |
parent | c04e299b1d503f2ce67730398b9585a196616e51 (diff) | |
download | python-troveclient-f28390ee5ddf83c0dfbf886b7e99c192fa7f4ecc.tar.gz |
Merge "Revert "Remove flavor API""
Diffstat (limited to 'troveclient/compat/mcli.py')
-rw-r--r-- | troveclient/compat/mcli.py | 26 |
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, } |