Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_firewall_proxyaddrgrp6.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_firewall_proxyaddrgrp6
15 short_description: Firewall proxy addrgrp6
16 version_added: "2.12.0"
17 extends_documentation_fragment:
18 - fortinet.fortimanager.general
19 - fortinet.fortimanager.general.full_crud
20 options:
21 revision_note:
22 description: The change note that can be specified when an object is created or updated.
23 type: str
24 adom:
25 description: The parameter (adom) in requested url.
26 type: str
27 required: true
28 firewall_proxyaddrgrp6:
29 description: The top level parameters set.
30 required: false
31 type: dict
32 suboptions:
33 color:
34 type: int
35 description: Color.
36 comment:
37 type: str
38 description: Comment.
39 member:
40 type: list
41 elements: str
42 description: Member.
43 name:
44 type: str
45 description: Name.
46 required: true
47 tagging:
48 type: list
49 elements: dict
50 description: Tagging.
51 suboptions:
52 category:
53 type: list
54 elements: str
55 description: Category.
56 name:
57 type: str
58 description: Name.
59 tags:
60 type: list
61 elements: str
62 description: Tags.
63 type:
64 type: str
65 description: Type.
66 choices: ['src', 'dst']
67 uuid:
68 type: str
69 description: Uuid.
70 logic_type:
71 aliases: ['logic-type']
72 type: str
73 description: Logic type.
74 choices: ['or', 'and']
75 '''
76
77 EXAMPLES = '''
78 - name: Example playbook (generated based on argument schema)
79 hosts: fortimanagers
80 connection: httpapi
81 gather_facts: false
82 tasks:
83 - name: Firewall proxy addrgrp6
84 fortinet.fortimanager.fmgr_firewall_proxyaddrgrp6:
85 # workspace_locking_adom: <global or your adom name>
86 adom: <your own value>
87 state: present # <value in [present, absent]>
88 firewall_proxyaddrgrp6:
89 name: "your value" # Required variable, string
90 # color: <integer>
91 # comment: <string>
92 # member: <list or string>
93 # tagging:
94 # - category: <list or string>
95 # name: <string>
96 # tags: <list or string>
97 # type: <value in [src, dst]>
98 # uuid: <string>
99 # logic_type: <value in [or, and]>
100 '''
101
102 RETURN = '''
103 meta:
104 description: The result of the request.
105 type: dict
106 returned: always
107 contains:
108 request_url:
109 description: The full url requested.
110 returned: always
111 type: str
112 sample: /sys/login/user
113 response_code:
114 description: The status of api request.
115 returned: always
116 type: int
117 sample: 0
118 response_data:
119 description: The api response.
120 type: list
121 returned: always
122 response_message:
123 description: The descriptive message of the api response.
124 type: str
125 returned: always
126 sample: OK.
127 system_information:
128 description: The information of the target system.
129 type: dict
130 returned: always
131 rc:
132 description: The status the request.
133 type: int
134 returned: always
135 sample: 0
136 version_check_warning:
137 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
138 type: list
139 returned: complex
140 '''
141 from ansible.module_utils.basic import AnsibleModule
142 from ansible.module_utils.connection import Connection
143 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
144 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
145
146
147 def main():
148 urls_list = [
149 '/pm/config/adom/{adom}/obj/firewall/proxy-addrgrp6',
150 '/pm/config/global/obj/firewall/proxy-addrgrp6'
151 ]
152 module_arg_spec = {
153 'adom': {'required': True, 'type': 'str'},
154 'revision_note': {'type': 'str'},
155 'firewall_proxyaddrgrp6': {
156 'type': 'dict', 'v_range': [['7.6.4', '']],
157 'options': {
158 'color': {'v_range': [['7.6.4', '']], 'type': 'int'},
159 'comment': {'v_range': [['7.6.4', '']], 'type': 'str'},
160 'member': {'v_range': [['7.6.4', '']], 'type': 'list', 'elements': 'str'},
161 'name': {'v_range': [['7.6.4', '']], 'required': True, 'type': 'str'},
162 'tagging': {
163 'v_range': [['7.6.4', '']],
164 'type': 'list',
165 'options': {
166 'category': {'v_range': [['7.6.4', '']], 'type': 'list', 'elements': 'str'},
167 'name': {'v_range': [['7.6.4', '']], 'type': 'str'},
168 'tags': {'v_range': [['7.6.4', '']], 'type': 'list', 'elements': 'str'}
169 },
170 'elements': 'dict'
171 },
172 'type': {'v_range': [['7.6.4', '']], 'choices': ['src', 'dst'], 'type': 'str'},
173 'uuid': {'v_range': [['7.6.4', '']], 'type': 'str'},
174 'logic-type': {'v_range': [['7.6.5', '']], 'choices': ['or', 'and'], 'type': 'str'}
175 }
176 }
177 }
178
179 module_option_spec = get_module_arg_spec('full crud')
180 module_arg_spec.update(module_option_spec)
181 check_galaxy_version(module_arg_spec)
182 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'firewall_proxyaddrgrp6'),
183 supports_check_mode=True)
184 if not module._socket_path:
185 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
186 connection = Connection(module._socket_path)
187 fmgr = NAPIManager('full crud', module_arg_spec, urls_list,
188 'name', 'data', module, connection)
189 fmgr.process_crud()
190 module.exit_json(meta=module.params)
191
192
193 if __name__ == '__main__':
194 main()