Debian Codegraph @

ansible_collections/cisco/intersight/plugins/modules/intersight_adapter_config_policy_info.py

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
5
6 from __future__ import absolute_import, division, print_function
7 __metaclass__ = type
8
9 ANSIBLE_METADATA = {'metadata_version': '1.1',
10 'status': ['preview'],
11 'supported_by': 'community'}
12
13 DOCUMENTATION = r'''
14 ---
15 module: intersight_adapter_config_policy_info
16 short_description: Gather information about Adapter Configuration Policies
17 description:
18 - Gathers information about Adapter Configuration Policies on Cisco Intersight.
19 - For more information see L(Cisco Intersight,https://intersight.com/apidocs).
20 extends_documentation_fragment: intersight
21 options:
22 organization:
23 description:
24 - The name of the Organization this resource is assigned to.
25 type: str
26 default: default
27 name:
28 description:
29 - The name assigned to the Adapter Configuration Policy.
30 type: str
31 author:
32 - Ron Gershburg (@rgershbu)
33 '''
34
35 EXAMPLES = r'''
36 - name: Get Adapter Config Policy Info
37 cisco.intersight.intersight_adapter_config_policy_info:
38 api_private_key: "{{ api_private_key }}"
39 api_key_id: "{{ api_key_id }}"
40 name: "adapter-config-policy"
41 '''
42
43 RETURN = r'''
44 api_response:
45 description: The API response output returned by the specified resource.
46 returned: always
47 type: list
48 sample:
49 [
50 {
51 "Name": "adapter-config-policy",
52 "ObjectType": "adapter.ConfigPolicy",
53 "Settings": []
54 }
55 ]
56 '''
57
58 from ansible.module_utils.basic import AnsibleModule
59 from ansible_collections.cisco.intersight.plugins.module_utils.intersight import IntersightModule, intersight_argument_spec
60
61
62 def main():
63 argument_spec = intersight_argument_spec.copy()
64 argument_spec.update(
65 organization=dict(type='str', default='default'),
66 name=dict(type='str'),
67 )
68
69 module = AnsibleModule(
70 argument_spec,
71 supports_check_mode=True,
72 )
73
74 intersight = IntersightModule(module)
75 intersight.result['api_response'] = {}
76 intersight.result['trace_id'] = ''
77
78 resource_path = '/adapter/ConfigPolicies'
79 query_params = intersight.set_query_params()
80
81 intersight.get_resource(resource_path=resource_path, query_params=query_params, return_list=True)
82
83 module.exit_json(**intersight.result)
84
85
86 if __name__ == '__main__':
87 main()