Skip to content

Commit 58e04ac

Browse files
authored
Merge pull request #32 from selectel/add_skip_init_quotas
Add skip_init_quotas param
2 parents b565f52 + ac33d03 commit 58e04ac

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

selvpcclient/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.2"
1+
__version__ = "2.3"

selvpcclient/commands/project.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@ def get_parser(self, prog_name):
1515
'--name',
1616
required=True,
1717
)
18+
required.add_argument('--skip_quotas_init',
19+
default=False,
20+
action='store_true'
21+
)
1822
return parser
1923

2024
@handle_http_error
2125
def take_action(self, parsed_args):
22-
result = self.app.context["client"].projects.create(parsed_args.name)
26+
result = self.app.context["client"].projects.create(
27+
parsed_args.name, parsed_args.skip_quotas_init)
2328
return self.setup_columns(result, parsed_args)
2429

2530

selvpcclient/resources/projects.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,21 @@ def list(self, return_raw=False):
215215
"""
216216
return self._list('/projects', 'projects', return_raw=return_raw)
217217

218-
def create(self, name, return_raw=False):
218+
def create(self, name, skip_quotas_init=False, return_raw=False):
219219
"""Create new project.
220220
221221
:param string name: Name of project.
222+
:param skip_quotas_init: flag to skip quotas initialization.
222223
:param return_raw: flag to force returning raw JSON instead of
223224
Python object of self.resource_class
224225
:rtype: list of :class:`Project`.
225226
"""
226-
body = {"project": {"name": name}}
227+
body = {
228+
"project": {
229+
"name": name,
230+
"skip_quotas_init": skip_quotas_init
231+
}
232+
}
227233
return self._post('/projects', body, 'project', return_raw=return_raw)
228234

229235
def show(self, project_id, return_raw=False):

0 commit comments

Comments
 (0)