Debian Codegraph @

ansible_collections/theforeman/foreman/plugins/modules/content_view_info.py

raw symbols SCIP
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3 # (c) 2021 Eric Helms
4 #
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 from __future__ import absolute_import, division, print_function
19 __metaclass__ = type
20
21
22 DOCUMENTATION = '''
23 ---
24 module: content_view_info
25 version_added: 2.1.0
26 short_description: Fetch information about Content Views
27 description:
28 - Fetch information about Content Views
29 author:
30 - "Eric Helms (@ehelms)"
31 extends_documentation_fragment:
32 - theforeman.foreman.foreman
33 - theforeman.foreman.foreman.infomodule
34 '''
35
36 EXAMPLES = '''
37 - name: "Show a content_view"
38 theforeman.foreman.content_view_info:
39 username: "admin"
40 password: "changeme"
41 server_url: "https://foreman.example.com"
42 name: "CentOS 8"
43
44 - name: "Show all content_views with name CentOS 8"
45 theforeman.foreman.content_view_info:
46 username: "admin"
47 password: "changeme"
48 server_url: "https://foreman.example.com"
49 search: 'name = "CentOS 8"'
50 '''
51
52 RETURN = '''
53 content_view:
54 description: Details about the found content_view
55 returned: success and I(name) was passed
56 type: dict
57 content_views:
58 description: List of all found content_views and their details
59 returned: success and I(search) was passed
60 type: list
61 elements: dict
62 '''
63
64 from ansible_collections.theforeman.foreman.plugins.module_utils.foreman_helper import (
65 ForemanInfoAnsibleModule,
66 )
67
68
69 class KatelloContentViewInfo(ForemanInfoAnsibleModule):
70 pass
71
72
73 def main():
74 module = KatelloContentViewInfo()
75
76 with module.api_connection():
77 module.run()
78
79
80 if __name__ == '__main__':
81 main()