Debian Codegraph @

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