Debian Codegraph @

ansible_collections/theforeman/foreman/plugins/modules/content_view_version_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_version_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 options:
32 content_view:
33 description:
34 - Content View to which the Version belongs
35 required: true
36 type: str
37 extends_documentation_fragment:
38 - theforeman.foreman.foreman
39 - theforeman.foreman.foreman.katelloinfomodule
40 - theforeman.foreman.foreman.infomodulewithoutname
41 '''
42
43 EXAMPLES = '''
44 - name: "Show a content view version"
45 theforeman.foreman.content_view_version_info:
46 username: "admin"
47 password: "changeme"
48 server_url: "https://foreman.example.com"
49 content_view: "CentOS 8 View"
50 search: 'version = "4.0"'
51
52 - name: "Show all content view_versions for a content view"
53 theforeman.foreman.content_view_version_info:
54 username: "admin"
55 password: "changeme"
56 server_url: "https://foreman.example.com"
57 content_view: "CentOS 8 View"
58 '''
59
60 RETURN = '''
61 content_view_versions:
62 description: List of all found content_view_versions and their details
63 returned: success and I(search) was passed
64 type: list
65 elements: dict
66 '''
67
68 from ansible_collections.theforeman.foreman.plugins.module_utils.foreman_helper import (
69 KatelloInfoAnsibleModule,
70 )
71
72
73 class KatelloContentViewVersionInfo(KatelloInfoAnsibleModule):
74 pass
75
76
77 def main():
78 module = KatelloContentViewVersionInfo(
79 foreman_spec=dict(
80 content_view=dict(type='entity', scope=['organization'], required=True),
81 name=dict(invisible=True),
82 ),
83 )
84
85 with module.api_connection():
86 module.run()
87
88
89 if __name__ == '__main__':
90 main()