Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_firewall_sslsshprofile_echoutersni.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_sslsshprofile_echoutersni
15 short_description: ClientHelloOuter SNIs to be blocked.
16 version_added: "2.6.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 ssl-ssh-profile:
29 description: Deprecated, please use "ssl_ssh_profile"
30 type: str
31 ssl_ssh_profile:
32 description: The parameter (ssl-ssh-profile) in requested url.
33 type: str
34 firewall_sslsshprofile_echoutersni:
35 description: The top level parameters set.
36 required: false
37 type: dict
38 suboptions:
39 name:
40 type: str
41 description: ClientHelloOuter SNI name.
42 required: true
43 sni:
44 type: str
45 description: ClientHelloOuter SNI to be blocked.
46 '''
47
48 EXAMPLES = '''
49 - name: Example playbook (generated based on argument schema)
50 hosts: fortimanagers
51 connection: httpapi
52 gather_facts: false
53 tasks:
54 - name: ClientHelloOuter SNIs to be blocked.
55 fortinet.fortimanager.fmgr_firewall_sslsshprofile_echoutersni:
56 # workspace_locking_adom: <global or your adom name>
57 adom: <your own value>
58 ssl_ssh_profile: <your own value>
59 state: present # <value in [present, absent]>
60 firewall_sslsshprofile_echoutersni:
61 name: "your value" # Required variable, string
62 # sni: <string>
63 '''
64
65 RETURN = '''
66 meta:
67 description: The result of the request.
68 type: dict
69 returned: always
70 contains:
71 request_url:
72 description: The full url requested.
73 returned: always
74 type: str
75 sample: /sys/login/user
76 response_code:
77 description: The status of api request.
78 returned: always
79 type: int
80 sample: 0
81 response_data:
82 description: The api response.
83 type: list
84 returned: always
85 response_message:
86 description: The descriptive message of the api response.
87 type: str
88 returned: always
89 sample: OK.
90 system_information:
91 description: The information of the target system.
92 type: dict
93 returned: always
94 rc:
95 description: The status the request.
96 type: int
97 returned: always
98 sample: 0
99 version_check_warning:
100 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
101 type: list
102 returned: complex
103 '''
104 from ansible.module_utils.basic import AnsibleModule
105 from ansible.module_utils.connection import Connection
106 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
107 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
108
109
110 def main():
111 urls_list = [
112 '/pm/config/adom/{adom}/obj/firewall/ssl-ssh-profile/{ssl-ssh-profile}/ech-outer-sni',
113 '/pm/config/global/obj/firewall/ssl-ssh-profile/{ssl-ssh-profile}/ech-outer-sni'
114 ]
115 module_arg_spec = {
116 'adom': {'required': True, 'type': 'str'},
117 'ssl-ssh-profile': {'type': 'str', 'api_name': 'ssl_ssh_profile'},
118 'ssl_ssh_profile': {'type': 'str'},
119 'revision_note': {'type': 'str'},
120 'firewall_sslsshprofile_echoutersni': {
121 'type': 'dict', 'v_range': [['7.4.3', '']],
122 'options': {'name': {'v_range': [['7.4.3', '']], 'required': True, 'type': 'str'}, 'sni': {'v_range': [['7.4.3', '']], 'type': 'str'}}
123 }
124 }
125
126 module_option_spec = get_module_arg_spec('full crud')
127 module_arg_spec.update(module_option_spec)
128 check_galaxy_version(module_arg_spec)
129 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'firewall_sslsshprofile_echoutersni'),
130 supports_check_mode=True)
131 if not module._socket_path:
132 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
133 connection = Connection(module._socket_path)
134 fmgr = NAPIManager('full crud', module_arg_spec, urls_list,
135 'name', 'data', module, connection)
136 fmgr.process_crud()
137 module.exit_json(meta=module.params)
138
139
140 if __name__ == '__main__':
141 main()