Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_casb_saasapplication_outputattributes.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_casb_saasapplication_outputattributes
15 short_description: SaaS application output attributes.
16 version_added: "2.14.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 saas-application:
29 description: Deprecated, please use "saas_application"
30 type: str
31 saas_application:
32 description: The parameter (saas-application) in requested url.
33 type: str
34 casb_saasapplication_outputattributes:
35 description: The top level parameters set.
36 required: false
37 type: dict
38 suboptions:
39 attr_type:
40 aliases: ['attr-type']
41 type: str
42 description: CASB attribute type.
43 choices: ['tenant']
44 description:
45 type: str
46 description: CASB attribute description.
47 name:
48 type: str
49 description: CASB attribute name.
50 required: true
51 required:
52 type: str
53 description: CASB attribute required.
54 choices: ['disable', 'enable']
55 type:
56 type: str
57 description: CASB attribute format type.
58 choices: ['string', 'string-list', 'integer', 'integer-list', 'boolean']
59 optional:
60 type: str
61 description: CASB output attribute optional.
62 choices: ['disable', 'enable']
63 '''
64
65 EXAMPLES = '''
66 - name: Example playbook (generated based on argument schema)
67 hosts: fortimanagers
68 connection: httpapi
69 gather_facts: false
70 tasks:
71 - name: SaaS application output attributes.
72 fortinet.fortimanager.fmgr_casb_saasapplication_outputattributes:
73 # workspace_locking_adom: <global or your adom name>
74 adom: <your own value>
75 saas_application: <your own value>
76 state: present # <value in [present, absent]>
77 casb_saasapplication_outputattributes:
78 name: "your value" # Required variable, string
79 # attr_type: <value in [tenant]>
80 # description: <string>
81 # required: <value in [disable, enable]>
82 # type: <value in [string, string-list, integer, ...]>
83 # optional: <value in [disable, enable]>
84 '''
85
86 RETURN = '''
87 meta:
88 description: The result of the request.
89 type: dict
90 returned: always
91 contains:
92 request_url:
93 description: The full url requested.
94 returned: always
95 type: str
96 sample: /sys/login/user
97 response_code:
98 description: The status of api request.
99 returned: always
100 type: int
101 sample: 0
102 response_data:
103 description: The api response.
104 type: list
105 returned: always
106 response_message:
107 description: The descriptive message of the api response.
108 type: str
109 returned: always
110 sample: OK.
111 system_information:
112 description: The information of the target system.
113 type: dict
114 returned: always
115 rc:
116 description: The status the request.
117 type: int
118 returned: always
119 sample: 0
120 version_check_warning:
121 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
122 type: list
123 returned: complex
124 '''
125 from ansible.module_utils.basic import AnsibleModule
126 from ansible.module_utils.connection import Connection
127 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
128 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
129
130
131 def main():
132 urls_list = [
133 '/pm/config/adom/{adom}/obj/casb/saas-application/{saas-application}/output-attributes',
134 '/pm/config/global/obj/casb/saas-application/{saas-application}/output-attributes'
135 ]
136 module_arg_spec = {
137 'adom': {'required': True, 'type': 'str'},
138 'saas-application': {'type': 'str', 'api_name': 'saas_application'},
139 'saas_application': {'type': 'str'},
140 'revision_note': {'type': 'str'},
141 'casb_saasapplication_outputattributes': {
142 'type': 'dict', 'v_range': [['7.6.2', '']],
143 'options': {
144 'attr-type': {'v_range': [['7.6.2', '']], 'choices': ['tenant'], 'type': 'str'},
145 'description': {'v_range': [['7.6.2', '']], 'type': 'str'},
146 'name': {'v_range': [['7.6.2', '']], 'required': True, 'type': 'str'},
147 'required': {'v_range': [['7.6.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
148 'type': {'v_range': [['7.6.2', '']], 'choices': ['string', 'string-list', 'integer', 'integer-list', 'boolean'], 'type': 'str'},
149 'optional': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'enable'], 'type': 'str'}
150 }
151 }
152 }
153
154 module_option_spec = get_module_arg_spec('full 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, 'casb_saasapplication_outputattributes'),
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('full crud', module_arg_spec, urls_list,
163 'name', 'data', module, connection)
164 fmgr.process_crud()
165 module.exit_json(meta=module.params)
166
167
168 if __name__ == '__main__':
169 main()