Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_pm_wanprof_adom.py

raw symbols SCIP
1 #!/usr/bin/python
2 from __future__ import absolute_import, division, print_function
3 # Copyright 2019-2024 Fortinet, Inc.
4 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
5
6 __metaclass__ = type
7
8 ANSIBLE_METADATA = {'status': ['preview'],
9 'supported_by': 'community',
10 'metadata_version': '1.1'}
11
12 DOCUMENTATION = '''
13 ---
14 module: fmgr_pm_wanprof_adom
15 short_description: Sd wan template adom
16 version_added: "2.0.0"
17 extends_documentation_fragment:
18 - fortinet.fortimanager.general
19 - fortinet.fortimanager.general.partial_crud
20 options:
21 adom:
22 description: The parameter (adom) in requested url.
23 type: str
24 required: true
25 pm_wanprof_adom:
26 description: The top level parameters set.
27 required: false
28 type: dict
29 suboptions:
30 description:
31 type: str
32 description: Description.
33 name:
34 type: str
35 description: Name.
36 oid:
37 type: int
38 description: Oid.
39 scope_member:
40 aliases: ['scope member']
41 type: list
42 elements: dict
43 description: Scope member.
44 suboptions:
45 name:
46 type: str
47 description: Name.
48 vdom:
49 type: str
50 description: Vdom.
51 type:
52 type: str
53 description: Type.
54 choices: ['wanprof']
55 '''
56
57 EXAMPLES = '''
58 - name: Example playbook (generated based on argument schema)
59 hosts: fortimanagers
60 connection: httpapi
61 gather_facts: false
62 tasks:
63 - name: Sd wan template adom
64 fortinet.fortimanager.fmgr_pm_wanprof_adom:
65 # workspace_locking_adom: <global or your adom name>
66 adom: <your own value>
67 pm_wanprof_adom:
68 # description: <string>
69 # name: <string>
70 # oid: <integer>
71 # scope_member:
72 # - name: <string>
73 # vdom: <string>
74 # type: <value in [wanprof]>
75 '''
76
77 RETURN = '''
78 meta:
79 description: The result of the request.
80 type: dict
81 returned: always
82 contains:
83 request_url:
84 description: The full url requested.
85 returned: always
86 type: str
87 sample: /sys/login/user
88 response_code:
89 description: The status of api request.
90 returned: always
91 type: int
92 sample: 0
93 response_data:
94 description: The api response.
95 type: list
96 returned: always
97 response_message:
98 description: The descriptive message of the api response.
99 type: str
100 returned: always
101 sample: OK.
102 system_information:
103 description: The information of the target system.
104 type: dict
105 returned: always
106 rc:
107 description: The status the request.
108 type: int
109 returned: always
110 sample: 0
111 version_check_warning:
112 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
113 type: list
114 returned: complex
115 '''
116 from ansible.module_utils.basic import AnsibleModule
117 from ansible.module_utils.connection import Connection
118 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
119 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
120
121
122 def main():
123 urls_list = [
124 '/pm/wanprof/adom/{adom}'
125 ]
126 module_arg_spec = {
127 'adom': {'required': True, 'type': 'str'},
128 'pm_wanprof_adom': {
129 'type': 'dict', 'v_range': [['6.0.0', '']],
130 'options': {
131 'description': {'type': 'str'},
132 'name': {'type': 'str'},
133 'oid': {'type': 'int'},
134 'scope member': {'type': 'list', 'options': {'name': {'type': 'str'}, 'vdom': {'type': 'str'}}, 'elements': 'dict'},
135 'type': {'choices': ['wanprof'], 'type': 'str'}
136 }
137 }
138 }
139
140 module_option_spec = get_module_arg_spec('partial crud')
141 module_arg_spec.update(module_option_spec)
142 check_galaxy_version(module_arg_spec)
143 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'pm_wanprof_adom'),
144 supports_check_mode=True)
145 if not module._socket_path:
146 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
147 connection = Connection(module._socket_path)
148 fmgr = NAPIManager('partial crud', module_arg_spec, urls_list,
149 None, 'data', module, connection)
150 fmgr.process_partial_crud()
151 module.exit_json(meta=module.params)
152
153
154 if __name__ == '__main__':
155 main()