You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.2 KiB
49 lines
1.2 KiB
#!/usr/bin/python
|
|
|
|
DOCUMENTATION = r'''
|
|
---
|
|
module: decort_zone
|
|
|
|
description: See L(Module Documentation,https://repository.basistech.ru/BASIS/decort-ansible/wiki/Home). # noqa: E501
|
|
'''
|
|
|
|
from ansible.module_utils.basic import AnsibleModule
|
|
from ansible.module_utils.decort_utils import DecortController
|
|
|
|
|
|
class DecortZone(DecortController):
|
|
def __init__(self):
|
|
super().__init__(AnsibleModule(**self.amodule_init_args))
|
|
self.id: int = self.aparams['id']
|
|
|
|
@property
|
|
def amodule_init_args(self) -> dict:
|
|
return self.pack_amodule_init_args(
|
|
argument_spec=dict(
|
|
id=dict(
|
|
type='int',
|
|
required=True,
|
|
),
|
|
),
|
|
supports_check_mode=True,
|
|
)
|
|
|
|
def run(self):
|
|
self.get_info()
|
|
self.exit()
|
|
|
|
def get_info(self):
|
|
self.facts = self.zone_get(id=self.id)
|
|
self.facts['grid_id'] = self.facts.pop('gid')
|
|
self.facts['created_timestamp'] = self.facts.pop('createdTime')
|
|
self.facts['updated_timestamp'] = self.facts.pop('updatedTime')
|
|
self.facts['node_ids'] = self.facts.pop('nodeIds')
|
|
|
|
|
|
def main():
|
|
DecortZone().run()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|