Debian Codegraph @

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

raw symbols SCIP
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3 # (c) 2021 Evgeni Golov
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: subscription_info
25 version_added: 2.1.0
26 short_description: Fetch information about Subscriptions
27 description:
28 - Fetch information about Subscriptions
29 author:
30 - "Evgeni Golov (@evgeni)"
31 extends_documentation_fragment:
32 - theforeman.foreman.foreman
33 - theforeman.foreman.foreman.katelloinfomodule
34 - theforeman.foreman.foreman.infomodule
35 '''
36
37 EXAMPLES = '''
38 - name: "Show a subscription"
39 theforeman.foreman.subscription_info:
40 username: "admin"
41 password: "changeme"
42 server_url: "https://foreman.example.com"
43 name: "Red Hat Satellite Infrastructure Subscription"
44
45 - name: "Show all subscriptions with a certain name"
46 theforeman.foreman.subscription_info:
47 username: "admin"
48 password: "changeme"
49 server_url: "https://foreman.example.com"
50 search: name="Red Hat Satellite Infrastructure Subscription"
51 '''
52
53 RETURN = '''
54 subscription:
55 description: Details about the found subscription
56 returned: success and I(name) was passed
57 type: dict
58 subscriptions:
59 description: List of all found subscriptions and their details
60 returned: success and I(search) was passed
61 type: list
62 elements: dict
63 '''
64
65 from ansible_collections.theforeman.foreman.plugins.module_utils.foreman_helper import (
66 KatelloInfoAnsibleModule
67 )
68
69
70 class KatelloSubscriptionInfo(KatelloInfoAnsibleModule):
71 pass
72
73
74 def main():
75 module = KatelloSubscriptionInfo()
76
77 with module.api_connection():
78 module.run()
79
80
81 if __name__ == '__main__':
82 main()