Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_voip_profile_sccp.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_voip_profile_sccp
15 short_description: SCCP.
16 version_added: "2.0.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 profile:
29 description: The parameter (profile) in requested url.
30 type: str
31 required: true
32 voip_profile_sccp:
33 description: The top level parameters set.
34 required: false
35 type: dict
36 suboptions:
37 block_mcast:
38 aliases: ['block-mcast']
39 type: str
40 description: Enable/disable block multicast RTP connections.
41 choices: ['disable', 'enable']
42 log_call_summary:
43 aliases: ['log-call-summary']
44 type: str
45 description: Enable/disable log summary of SCCP calls.
46 choices: ['disable', 'enable']
47 log_violations:
48 aliases: ['log-violations']
49 type: str
50 description: Enable/disable logging of SCCP violations.
51 choices: ['disable', 'enable']
52 max_calls:
53 aliases: ['max-calls']
54 type: int
55 description: Maximum calls per minute per SCCP client
56 status:
57 type: str
58 description: Enable/disable SCCP.
59 choices: ['disable', 'enable']
60 verify_header:
61 aliases: ['verify-header']
62 type: str
63 description: Enable/disable verify SCCP header content.
64 choices: ['disable', 'enable']
65 '''
66
67 EXAMPLES = '''
68 - name: Example playbook (generated based on argument schema)
69 hosts: fortimanagers
70 connection: httpapi
71 gather_facts: false
72 tasks:
73 - name: SCCP.
74 fortinet.fortimanager.fmgr_voip_profile_sccp:
75 # workspace_locking_adom: <global or your adom name>
76 adom: <your own value>
77 profile: <your own value>
78 voip_profile_sccp:
79 # block_mcast: <value in [disable, enable]>
80 # log_call_summary: <value in [disable, enable]>
81 # log_violations: <value in [disable, enable]>
82 # max_calls: <integer>
83 # status: <value in [disable, enable]>
84 # verify_header: <value in [disable, enable]>
85 '''
86
87 RETURN = '''
88 meta:
89 description: The result of the request.
90 type: dict
91 returned: always
92 contains:
93 request_url:
94 description: The full url requested.
95 returned: always
96 type: str
97 sample: /sys/login/user
98 response_code:
99 description: The status of api request.
100 returned: always
101 type: int
102 sample: 0
103 response_data:
104 description: The api response.
105 type: list
106 returned: always
107 response_message:
108 description: The descriptive message of the api response.
109 type: str
110 returned: always
111 sample: OK.
112 system_information:
113 description: The information of the target system.
114 type: dict
115 returned: always
116 rc:
117 description: The status the request.
118 type: int
119 returned: always
120 sample: 0
121 version_check_warning:
122 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
123 type: list
124 returned: complex
125 '''
126 from ansible.module_utils.basic import AnsibleModule
127 from ansible.module_utils.connection import Connection
128 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
129 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
130
131
132 def main():
133 urls_list = [
134 '/pm/config/adom/{adom}/obj/voip/profile/{profile}/sccp',
135 '/pm/config/global/obj/voip/profile/{profile}/sccp'
136 ]
137 module_arg_spec = {
138 'adom': {'required': True, 'type': 'str'},
139 'profile': {'required': True, 'type': 'str'},
140 'revision_note': {'type': 'str'},
141 'voip_profile_sccp': {
142 'type': 'dict', 'v_range': [['6.0.0', '']],
143 'options': {
144 'block-mcast': {'choices': ['disable', 'enable'], 'type': 'str'},
145 'log-call-summary': {'choices': ['disable', 'enable'], 'type': 'str'},
146 'log-violations': {'choices': ['disable', 'enable'], 'type': 'str'},
147 'max-calls': {'type': 'int'},
148 'status': {'choices': ['disable', 'enable'], 'type': 'str'},
149 'verify-header': {'choices': ['disable', 'enable'], 'type': 'str'}
150 }
151 }
152 }
153
154 module_option_spec = get_module_arg_spec('partial crud')
155 module_arg_spec.update(module_option_spec)
156 check_galaxy_version(module_arg_spec)
157 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'voip_profile_sccp'),
158 supports_check_mode=True)
159 if not module._socket_path:
160 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
161 connection = Connection(module._socket_path)
162 fmgr = NAPIManager('partial crud', module_arg_spec, urls_list,
163 None, 'data', module, connection)
164 fmgr.process_partial_crud()
165 module.exit_json(meta=module.params)
166
167
168 if __name__ == '__main__':
169 main()