Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_system_npu_dswqueuedtsprofile.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_system_npu_dswqueuedtsprofile
15 short_description: Configure NPU DSW Queue DTS profile.
16 version_added: "2.2.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 system_npu_dswqueuedtsprofile:
29 description: The top level parameters set.
30 required: false
31 type: dict
32 suboptions:
33 iport:
34 type: str
35 description: Set NPU DSW DTS in port.
36 choices: ['EIF0', 'eif0', 'EIF1', 'eif1', 'EIF2', 'eif2', 'EIF3', 'eif3', 'EIF4',
37 'eif4', 'EIF5', 'eif5', 'EIF6', 'eif6', 'EIF7', 'eif7', 'HTX0', 'htx0',
38 'HTX1', 'htx1', 'SSE0', 'sse0', 'SSE1', 'sse1', 'SSE2', 'sse2', 'SSE3',
39 'sse3', 'RLT', 'rlt', 'DFR', 'dfr', 'IPSECI', 'ipseci', 'IPSECO',
40 'ipseco', 'IPTI', 'ipti', 'IPTO', 'ipto', 'VEP0', 'vep0', 'VEP2',
41 'vep2', 'VEP4', 'vep4', 'VEP6', 'vep6', 'IVS', 'ivs', 'L2TI1', 'l2ti1',
42 'L2TO', 'l2to', 'L2TI0', 'l2ti0', 'PLE', 'ple', 'SPATH', 'spath', 'QTM',
43 'qtm']
44 name:
45 type: str
46 description: Name.
47 required: true
48 oport:
49 type: str
50 description: Set NPU DSW DTS out port.
51 choices: ['EIF0', 'eif0', 'EIF1', 'eif1', 'EIF2', 'eif2', 'EIF3', 'eif3', 'EIF4',
52 'eif4', 'EIF5', 'eif5', 'EIF6', 'eif6', 'EIF7', 'eif7', 'HRX', 'hrx',
53 'SSE0', 'sse0', 'SSE1', 'sse1', 'SSE2', 'sse2', 'SSE3', 'sse3', 'RLT',
54 'rlt', 'DFR', 'dfr', 'IPSECI', 'ipseci', 'IPSECO', 'ipseco', 'IPTI',
55 'ipti', 'IPTO', 'ipto', 'VEP0', 'vep0', 'VEP2', 'vep2', 'VEP4', 'vep4',
56 'VEP6', 'vep6', 'IVS', 'ivs', 'L2TI1', 'l2ti1', 'L2TO', 'l2to', 'L2TI0',
57 'l2ti0', 'PLE', 'ple', 'SYNK', 'sync', 'NSS', 'nss', 'TSK', 'tsk',
58 'QTM', 'qtm', 'l2tO']
59 profile_id:
60 aliases: ['profile-id']
61 type: int
62 description: Set NPU DSW DTS profile ID.
63 queue_select:
64 aliases: ['queue-select']
65 type: int
66 description: Set NPU DSW DTS queue ID select
67 '''
68
69 EXAMPLES = '''
70 - name: Example playbook (generated based on argument schema)
71 hosts: fortimanagers
72 connection: httpapi
73 gather_facts: false
74 tasks:
75 - name: Configure NPU DSW Queue DTS profile.
76 fortinet.fortimanager.fmgr_system_npu_dswqueuedtsprofile:
77 # workspace_locking_adom: <global or your adom name>
78 adom: <your own value>
79 state: present # <value in [present, absent]>
80 system_npu_dswqueuedtsprofile:
81 name: "your value" # Required variable, string
82 # iport: <value in [EIF0, eif0, EIF1, ...]>
83 # oport: <value in [EIF0, eif0, EIF1, ...]>
84 # profile_id: <integer>
85 # queue_select: <integer>
86 '''
87
88 RETURN = '''
89 meta:
90 description: The result of the request.
91 type: dict
92 returned: always
93 contains:
94 request_url:
95 description: The full url requested.
96 returned: always
97 type: str
98 sample: /sys/login/user
99 response_code:
100 description: The status of api request.
101 returned: always
102 type: int
103 sample: 0
104 response_data:
105 description: The api response.
106 type: list
107 returned: always
108 response_message:
109 description: The descriptive message of the api response.
110 type: str
111 returned: always
112 sample: OK.
113 system_information:
114 description: The information of the target system.
115 type: dict
116 returned: always
117 rc:
118 description: The status the request.
119 type: int
120 returned: always
121 sample: 0
122 version_check_warning:
123 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
124 type: list
125 returned: complex
126 '''
127 from ansible.module_utils.basic import AnsibleModule
128 from ansible.module_utils.connection import Connection
129 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
130 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
131
132
133 def main():
134 urls_list = [
135 '/pm/config/adom/{adom}/obj/system/npu/dsw-queue-dts-profile',
136 '/pm/config/global/obj/system/npu/dsw-queue-dts-profile'
137 ]
138 module_arg_spec = {
139 'adom': {'required': True, 'type': 'str'},
140 'revision_note': {'type': 'str'},
141 'system_npu_dswqueuedtsprofile': {
142 'type': 'dict', 'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']],
143 'options': {
144 'iport': {
145 'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']],
146 'choices': [
147 'EIF0', 'eif0', 'EIF1', 'eif1', 'EIF2', 'eif2', 'EIF3', 'eif3', 'EIF4', 'eif4', 'EIF5', 'eif5', 'EIF6', 'eif6', 'EIF7', 'eif7',
148 'HTX0', 'htx0', 'HTX1', 'htx1', 'SSE0', 'sse0', 'SSE1', 'sse1', 'SSE2', 'sse2', 'SSE3', 'sse3', 'RLT', 'rlt', 'DFR', 'dfr',
149 'IPSECI', 'ipseci', 'IPSECO', 'ipseco', 'IPTI', 'ipti', 'IPTO', 'ipto', 'VEP0', 'vep0', 'VEP2', 'vep2', 'VEP4', 'vep4', 'VEP6',
150 'vep6', 'IVS', 'ivs', 'L2TI1', 'l2ti1', 'L2TO', 'l2to', 'L2TI0', 'l2ti0', 'PLE', 'ple', 'SPATH', 'spath', 'QTM', 'qtm'
151 ],
152 'type': 'str'
153 },
154 'name': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'required': True, 'type': 'str'},
155 'oport': {
156 'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']],
157 'choices': [
158 'EIF0', 'eif0', 'EIF1', 'eif1', 'EIF2', 'eif2', 'EIF3', 'eif3', 'EIF4', 'eif4', 'EIF5', 'eif5', 'EIF6', 'eif6', 'EIF7', 'eif7',
159 'HRX', 'hrx', 'SSE0', 'sse0', 'SSE1', 'sse1', 'SSE2', 'sse2', 'SSE3', 'sse3', 'RLT', 'rlt', 'DFR', 'dfr', 'IPSECI', 'ipseci',
160 'IPSECO', 'ipseco', 'IPTI', 'ipti', 'IPTO', 'ipto', 'VEP0', 'vep0', 'VEP2', 'vep2', 'VEP4', 'vep4', 'VEP6', 'vep6', 'IVS', 'ivs',
161 'L2TI1', 'l2ti1', 'L2TO', 'l2to', 'L2TI0', 'l2ti0', 'PLE', 'ple', 'SYNK', 'sync', 'NSS', 'nss', 'TSK', 'tsk', 'QTM', 'qtm',
162 'l2tO'
163 ],
164 'type': 'str'
165 },
166 'profile-id': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'type': 'int'},
167 'queue-select': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'type': 'int'}
168 }
169 }
170 }
171
172 module_option_spec = get_module_arg_spec('full crud')
173 module_arg_spec.update(module_option_spec)
174 check_galaxy_version(module_arg_spec)
175 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'system_npu_dswqueuedtsprofile'),
176 supports_check_mode=True)
177 if not module._socket_path:
178 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
179 connection = Connection(module._socket_path)
180 fmgr = NAPIManager('full crud', module_arg_spec, urls_list,
181 'name', 'data', module, connection)
182 fmgr.process_crud()
183 module.exit_json(meta=module.params)
184
185
186 if __name__ == '__main__':
187 main()