Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_firewall_sslsshprofile_sslclientcertificate.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_sslclientcertificate
15 short_description: Firewall ssl ssh profile ssl client certificate
16 version_added: "2.12.0"
17 extends_documentation_fragment:
18 - fortinet.fortimanager.general
19 - fortinet.fortimanager.general.partial_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_sslclientcertificate:
35 description: The top level parameters set.
36 required: false
37 type: dict
38 suboptions:
39 caname:
40 type: list
41 elements: str
42 description: Caname.
43 cert:
44 type: list
45 elements: str
46 description: Cert.
47 keyring_list:
48 aliases: ['keyring-list']
49 type: list
50 elements: str
51 description: Keyring list.
52 status:
53 type: str
54 description: Status.
55 choices: ['do-not-offer', 'keyring-list', 'ca-sign', 'static']
56 '''
57
58 EXAMPLES = '''
59 - name: Example playbook (generated based on argument schema)
60 hosts: fortimanagers
61 connection: httpapi
62 gather_facts: false
63 tasks:
64 - name: Firewall ssl ssh profile ssl client certificate
65 fortinet.fortimanager.fmgr_firewall_sslsshprofile_sslclientcertificate:
66 # workspace_locking_adom: <global or your adom name>
67 adom: <your own value>
68 ssl_ssh_profile: <your own value>
69 firewall_sslsshprofile_sslclientcertificate:
70 # caname: <list or string>
71 # cert: <list or string>
72 # keyring_list: <list or string>
73 # status: <value in [do-not-offer, keyring-list, ca-sign, ...]>
74 '''
75
76 RETURN = '''
77 meta:
78 description: The result of the request.
79 type: dict
80 returned: always
81 contains:
82 request_url:
83 description: The full url requested.
84 returned: always
85 type: str
86 sample: /sys/login/user
87 response_code:
88 description: The status of api request.
89 returned: always
90 type: int
91 sample: 0
92 response_data:
93 description: The api response.
94 type: list
95 returned: always
96 response_message:
97 description: The descriptive message of the api response.
98 type: str
99 returned: always
100 sample: OK.
101 system_information:
102 description: The information of the target system.
103 type: dict
104 returned: always
105 rc:
106 description: The status the request.
107 type: int
108 returned: always
109 sample: 0
110 version_check_warning:
111 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
112 type: list
113 returned: complex
114 '''
115 from ansible.module_utils.basic import AnsibleModule
116 from ansible.module_utils.connection import Connection
117 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
118 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
119
120
121 def main():
122 urls_list = [
123 '/pm/config/adom/{adom}/obj/firewall/ssl-ssh-profile/{ssl-ssh-profile}/ssl-client-certificate',
124 '/pm/config/global/obj/firewall/ssl-ssh-profile/{ssl-ssh-profile}/ssl-client-certificate'
125 ]
126 module_arg_spec = {
127 'adom': {'required': True, 'type': 'str'},
128 'ssl-ssh-profile': {'type': 'str', 'api_name': 'ssl_ssh_profile'},
129 'ssl_ssh_profile': {'type': 'str'},
130 'revision_note': {'type': 'str'},
131 'firewall_sslsshprofile_sslclientcertificate': {
132 'type': 'dict', 'v_range': [['7.4.8', '7.4.10'], ['7.6.4', '']],
133 'options': {
134 'caname': {'v_range': [['7.4.8', '7.4.10'], ['7.6.4', '']], 'type': 'list', 'elements': 'str'},
135 'cert': {'v_range': [['7.4.8', '7.4.10'], ['7.6.4', '']], 'type': 'list', 'elements': 'str'},
136 'keyring-list': {'v_range': [['7.4.8', '7.4.10'], ['7.6.4', '']], 'no_log': True, 'type': 'list', 'elements': 'str'},
137 'status': {
138 'v_range': [['7.4.8', '7.4.10'], ['7.6.4', '']],
139 'choices': ['do-not-offer', 'keyring-list', 'ca-sign', 'static'],
140 'type': 'str'
141 }
142 }
143 }
144 }
145
146 module_option_spec = get_module_arg_spec('partial crud')
147 module_arg_spec.update(module_option_spec)
148 check_galaxy_version(module_arg_spec)
149 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'firewall_sslsshprofile_sslclientcertificate'),
150 supports_check_mode=True)
151 if not module._socket_path:
152 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
153 connection = Connection(module._socket_path)
154 fmgr = NAPIManager('partial crud', module_arg_spec, urls_list,
155 None, 'data', module, connection)
156 fmgr.process_partial_crud()
157 module.exit_json(meta=module.params)
158
159
160 if __name__ == '__main__':
161 main()