From ac33d03333cea4fd640f92a03dbf2789cd7a3ec4 Mon Sep 17 00:00:00 2001 From: Voloshina Tatyana Date: Thu, 30 Mar 2023 18:32:22 +0300 Subject: [PATCH] Add skip_init_quotas param --- selvpcclient/__init__.py | 2 +- selvpcclient/commands/project.py | 7 ++++++- selvpcclient/resources/projects.py | 10 ++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/selvpcclient/__init__.py b/selvpcclient/__init__.py index d3c8880..202075f 100644 --- a/selvpcclient/__init__.py +++ b/selvpcclient/__init__.py @@ -1 +1 @@ -__version__ = "2.2" +__version__ = "2.3" diff --git a/selvpcclient/commands/project.py b/selvpcclient/commands/project.py index 776e147..d011a09 100644 --- a/selvpcclient/commands/project.py +++ b/selvpcclient/commands/project.py @@ -15,11 +15,16 @@ def get_parser(self, prog_name): '--name', required=True, ) + required.add_argument('--skip_quotas_init', + default=False, + action='store_true' + ) return parser @handle_http_error def take_action(self, parsed_args): - result = self.app.context["client"].projects.create(parsed_args.name) + result = self.app.context["client"].projects.create( + parsed_args.name, parsed_args.skip_quotas_init) return self.setup_columns(result, parsed_args) diff --git a/selvpcclient/resources/projects.py b/selvpcclient/resources/projects.py index d9cca57..e72506c 100644 --- a/selvpcclient/resources/projects.py +++ b/selvpcclient/resources/projects.py @@ -215,15 +215,21 @@ def list(self, return_raw=False): """ return self._list('/projects', 'projects', return_raw=return_raw) - def create(self, name, return_raw=False): + def create(self, name, skip_quotas_init=False, return_raw=False): """Create new project. :param string name: Name of project. + :param skip_quotas_init: flag to skip quotas initialization. :param return_raw: flag to force returning raw JSON instead of Python object of self.resource_class :rtype: list of :class:`Project`. """ - body = {"project": {"name": name}} + body = { + "project": { + "name": name, + "skip_quotas_init": skip_quotas_init + } + } return self._post('/projects', body, 'project', return_raw=return_raw) def show(self, project_id, return_raw=False):