Debian Codegraph @

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

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