Debian Codegraph @

ansible_collections/dellemc/openmanage/plugins/module_utils/idrac_utils/info/video.py

raw symbols SCIP
1 # -*- coding: utf-8 -*-
2
3 # Dell OpenManage Ansible Modules
4 # Version 9.12.0
5 # Copyright (C) 2025 Dell Inc. or its subsidiaries. All Rights Reserved.
6
7 # Redistribution and use in source and binary forms, with or without modification,
8 # are permitted provided that the following conditions are met:
9
10 # * Redistributions of source code must retain the above copyright notice,
11 # this list of conditions and the following disclaimer.
12
13 # * Redistributions in binary form must reproduce the above copyright notice,
14 # this list of conditions and the following disclaimer in the documentation
15 # and/or other materials provided with the distribution.
16
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
25 # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 #
27
28 GET_IDRAC_VIDEO_DETAILS_URI_10 = "/redfish/v1/Systems/System.Embedded.1/Oem/Dell/DellVideo"
29
30
31 class IDRACVideoInfo(object):
32 def __init__(self, idrac):
33 self.idrac = idrac
34
35 def get_idrac_video_details(self):
36 response = self.idrac.invoke_request(method='GET', uri=GET_IDRAC_VIDEO_DETAILS_URI_10)
37 final_output = self.extract_video_data(response.json_data)
38 return final_output
39
40 def extract_video_data(self, response):
41 keys_to_search = {
42 "Description": "Description",
43 "DeviceDescription": "DeviceDescription",
44 "FQDD": "FQDD",
45 "Key": "Key",
46 "Manufacturer": "Manufacturer"
47 }
48 video_list = []
49 if "Members" in response and response["Members"]:
50 for member in response["Members"]:
51 video_data = {}
52 for key, response_key in keys_to_search.items():
53 video_data[key] = member.get(response_key, "Not Available")
54 video_list.append(video_data)
55 return video_list