Debian Codegraph @

ansible_collections/community/general/plugins/modules/utm_network_interface_address_info.py

raw
1 #!/usr/bin/python
2
3 # Copyright (c) 2018, Juergen Wiebe <[email protected]>
4 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
5 # SPDX-License-Identifier: GPL-3.0-or-later
6 from __future__ import annotations
7
8 DOCUMENTATION = r"""
9 module: utm_network_interface_address_info
10
11 author:
12 - Juergen Wiebe (@steamx)
13
14 short_description: Get info for a network/interface_address object
15
16 description:
17 - Get info for a network/interface_address object in SOPHOS UTM.
18 attributes:
19 check_mode:
20 version_added: 3.3.0
21 # This was backported to 2.5.4 and 1.3.11 as well, since this was a bugfix
22
23 options:
24 name:
25 type: str
26 description:
27 - The name of the object that identifies the entry.
28 required: true
29
30 extends_documentation_fragment:
31 - community.general._utm
32 - community.general._attributes
33 - community.general._attributes.info_module
34 """
35
36 EXAMPLES = r"""
37 - name: Get network interface address info
38 utm_proxy_interface_address_info:
39 utm_host: sophos.host.name
40 utm_token: abcdefghijklmno1234
41 name: TestNetworkInterfaceAddress
42 """
43
44 RETURN = r"""
45 result:
46 description: The utm object that was created.
47 returned: success
48 type: complex
49 contains:
50 _ref:
51 description: The reference name of the object.
52 type: str
53 _locked:
54 description: Whether or not the object is currently locked.
55 type: bool
56 _type:
57 description: The type of the object.
58 type: str
59 name:
60 description: The name of the object.
61 type: str
62 address:
63 description: The ip4 address of the network/interface_address object.
64 type: str
65 address6:
66 description: The ip6 address of the network/interface_address object.
67 type: str
68 comment:
69 description: The comment string.
70 type: str
71 resolved:
72 description: Whether or not the object is resolved.
73 type: bool
74 resolved6:
75 description: Whether or not the object is resolved.
76 type: bool
77 """
78
79 from ansible_collections.community.general.plugins.module_utils._utm_utils import UTM, UTMModule
80
81
82 def main():
83 endpoint = "network/interface_address"
84 key_to_check_for_changes = []
85 module = UTMModule(
86 argument_spec=dict(name=dict(type="str", required=True)),
87 supports_check_mode=True,
88 )
89 try:
90 UTM(module, endpoint, key_to_check_for_changes, info_only=True).execute()
91 except Exception as e:
92 module.fail_json(msg=f"{e}")
93
94
95 if __name__ == "__main__":
96 main()