Implement functionality of the API method /cloudapi/account/listFlipGroups
This commit is contained in:
@@ -33,6 +33,7 @@ class DecortAccountInfo(DecortController):
|
||||
account_id=amodule.params['id'],
|
||||
computes_args=self.mapped_computes_args,
|
||||
disks_args=self.mapped_disks_args,
|
||||
flip_groups_args=self.mapped_flip_groups_args,
|
||||
images_args=self.mapped_images_args,
|
||||
resource_consumption=amodule.params['resource_consumption'],
|
||||
resource_groups_args=self.mapped_rg_args,
|
||||
@@ -176,6 +177,47 @@ class DecortAccountInfo(DecortController):
|
||||
),
|
||||
),
|
||||
),
|
||||
flip_groups=dict(
|
||||
type='dict',
|
||||
options=dict(
|
||||
filter=dict(
|
||||
type='dict',
|
||||
options=dict(
|
||||
ext_net_id=dict(
|
||||
type='int',
|
||||
),
|
||||
id=dict(
|
||||
type='int',
|
||||
),
|
||||
ip=dict(
|
||||
type='str',
|
||||
),
|
||||
name=dict(
|
||||
type='str',
|
||||
),
|
||||
vins_id=dict(
|
||||
type='int',
|
||||
),
|
||||
vins_name=dict(
|
||||
type='str',
|
||||
),
|
||||
),
|
||||
),
|
||||
pagination=dict(
|
||||
type='dict',
|
||||
options=dict(
|
||||
number=dict(
|
||||
type='int',
|
||||
default=1,
|
||||
),
|
||||
size=dict(
|
||||
type='int',
|
||||
required=True,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
id=dict(
|
||||
type='int',
|
||||
),
|
||||
@@ -440,6 +482,35 @@ class DecortAccountInfo(DecortController):
|
||||
|
||||
return mapped_args
|
||||
|
||||
@property
|
||||
def mapped_flip_groups_args(self) -> None | dict:
|
||||
"""
|
||||
Map the module argument `flip_groups` to
|
||||
arguments dictionary for the method
|
||||
`DecortController.account_flip_groups`
|
||||
(excluding for `account_id`).
|
||||
"""
|
||||
|
||||
input_args = self.amodule.params['flip_groups']
|
||||
if not input_args:
|
||||
return input_args
|
||||
|
||||
mapped_args = {}
|
||||
if input_args['filter']:
|
||||
mapped_args['ext_net_id'] = input_args['filter']['ext_net_id']
|
||||
mapped_args['flig_group_id'] = input_args['filter']['id']
|
||||
mapped_args['flig_group_ip'] = input_args['filter']['ip']
|
||||
mapped_args['flig_group_name'] = input_args['filter']['name']
|
||||
mapped_args['vins_id'] = input_args['filter']['vins_id']
|
||||
mapped_args['vins_name'] = input_args['filter']['vins_name']
|
||||
if input_args['pagination']:
|
||||
mapped_args['page_number'] =\
|
||||
input_args['pagination']['number']
|
||||
mapped_args['page_size'] =\
|
||||
input_args['pagination']['size']
|
||||
|
||||
return mapped_args
|
||||
|
||||
@property
|
||||
def mapped_images_args(self) -> None | dict:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user