Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_system_npu_isfnpqueues.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_isfnpqueues
15 short_description: Configure queues of switch port connected to NP6 XAUI on ingress path.
16 version_added: "2.1.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 system_npu_isfnpqueues:
29 description: The top level parameters set.
30 required: false
31 type: dict
32 suboptions:
33 cos0:
34 type: str
35 description: CoS profile name for CoS 0.
36 cos1:
37 type: str
38 description: CoS profile name for CoS 1.
39 cos2:
40 type: str
41 description: CoS profile name for CoS 2.
42 cos3:
43 type: str
44 description: CoS profile name for CoS 3.
45 cos4:
46 type: str
47 description: CoS profile name for CoS 4.
48 cos5:
49 type: str
50 description: CoS profile name for CoS 5.
51 cos6:
52 type: str
53 description: CoS profile name for CoS 6.
54 cos7:
55 type: str
56 description: CoS profile name for CoS 7.
57 '''
58
59 EXAMPLES = '''
60 - name: Example playbook (generated based on argument schema)
61 hosts: fortimanagers
62 connection: httpapi
63 gather_facts: false
64 tasks:
65 - name: Configure queues of switch port connected to NP6 XAUI on ingress path.
66 fortinet.fortimanager.fmgr_system_npu_isfnpqueues:
67 # workspace_locking_adom: <global or your adom name>
68 adom: <your own value>
69 system_npu_isfnpqueues:
70 # cos0: <string>
71 # cos1: <string>
72 # cos2: <string>
73 # cos3: <string>
74 # cos4: <string>
75 # cos5: <string>
76 # cos6: <string>
77 # cos7: <string>
78 '''
79
80 RETURN = '''
81 meta:
82 description: The result of the request.
83 type: dict
84 returned: always
85 contains:
86 request_url:
87 description: The full url requested.
88 returned: always
89 type: str
90 sample: /sys/login/user
91 response_code:
92 description: The status of api request.
93 returned: always
94 type: int
95 sample: 0
96 response_data:
97 description: The api response.
98 type: list
99 returned: always
100 response_message:
101 description: The descriptive message of the api response.
102 type: str
103 returned: always
104 sample: OK.
105 system_information:
106 description: The information of the target system.
107 type: dict
108 returned: always
109 rc:
110 description: The status the request.
111 type: int
112 returned: always
113 sample: 0
114 version_check_warning:
115 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
116 type: list
117 returned: complex
118 '''
119 from ansible.module_utils.basic import AnsibleModule
120 from ansible.module_utils.connection import Connection
121 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
122 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
123
124
125 def main():
126 urls_list = [
127 '/pm/config/adom/{adom}/obj/system/npu/isf-np-queues',
128 '/pm/config/global/obj/system/npu/isf-np-queues'
129 ]
130 module_arg_spec = {
131 'adom': {'required': True, 'type': 'str'},
132 'revision_note': {'type': 'str'},
133 'system_npu_isfnpqueues': {
134 'type': 'dict', 'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']],
135 'options': {
136 'cos0': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'type': 'str'},
137 'cos1': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'type': 'str'},
138 'cos2': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'type': 'str'},
139 'cos3': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'type': 'str'},
140 'cos4': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'type': 'str'},
141 'cos5': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'type': 'str'},
142 'cos6': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'type': 'str'},
143 'cos7': {'v_range': [['6.4.7', '6.4.15'], ['7.0.1', '']], 'type': 'str'}
144 }
145 }
146 }
147
148 module_option_spec = get_module_arg_spec('partial crud')
149 module_arg_spec.update(module_option_spec)
150 check_galaxy_version(module_arg_spec)
151 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'system_npu_isfnpqueues'),
152 supports_check_mode=True)
153 if not module._socket_path:
154 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
155 connection = Connection(module._socket_path)
156 fmgr = NAPIManager('partial crud', module_arg_spec, urls_list,
157 None, 'data', module, connection)
158 fmgr.process_partial_crud()
159 module.exit_json(meta=module.params)
160
161
162 if __name__ == '__main__':
163 main()