Skip to content

Commit

Permalink
Merge pull request #32 from selectel/add_skip_init_quotas
Browse files Browse the repository at this point in the history
Add skip_init_quotas param
  • Loading branch information
T-Sh authored Apr 10, 2023
2 parents b565f52 + ac33d03 commit 58e04ac
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion selvpcclient/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.2"
__version__ = "2.3"
7 changes: 6 additions & 1 deletion selvpcclient/commands/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
10 changes: 8 additions & 2 deletions selvpcclient/resources/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 58e04ac

Please sign in to comment.