コード例 #1
0
 def test_get_sub_resource_path_by_collection(self):
     subresource_path = ["Links", "ManagedBy"]
     expected_result = ['/redfish/v1/Managers/BMC']
     value = utils.get_sub_resource_path_by(self.sys_inst,
                                            subresource_path,
                                            is_collection=True)
     self.assertEqual(expected_result, value)
コード例 #2
0
 def _get_metrics_path(self):
     """Helper function to find the Metrics path"""
     return utils.get_sub_resource_path_by(self,
                                           ['Links',
                                            'Oem',
                                            'Intel_RackScale',
                                            'Metrics'])
コード例 #3
0
    def get_task_service(self):
        """Get the TaskService object

        :returns: The TaskService object
        """
        return taskservice.TaskService(
            self._conn, utils.get_sub_resource_path_by(self, 'Tasks'),
            redfish_version=self.redfish_version,
            registries=self.lazy_registries)
コード例 #4
0
    def virtual_media(self):
        if self._virtual_media is None:
            self._virtual_media = virtual_media.VirtualMediaCollection(
                self._conn,
                utils.get_sub_resource_path_by(self, 'VirtualMedia'),
                redfish_version=self.redfish_version)

        self._virtual_media.refresh(force=False)
        return self._virtual_media
コード例 #5
0
    def ports(self):
        """Property to provide reference to `PortCollection` instance

        It is calculated once when it is queried for the first time. On
        refresh, this property is reset.
        """
        return port.PortCollection(self._conn,
                                   utils.get_sub_resource_path_by(
                                       self, 'Metrics'),
                                   redfish_version=self.redfish_version)
コード例 #6
0
    def thermal(self):
        """Property to reference `Thermal` instance

        It is set once when the first time it is queried. On refresh,
        this property is marked as stale (greedy-refresh not done).
        Here the actual refresh of the sub-resource happens, if stale.
        """
        return thermal.Thermal(self._conn,
                               utils.get_sub_resource_path_by(self, 'Thermal'),
                               self.redfish_version, self.registries)
コード例 #7
0
ファイル: system.py プロジェクト: SarahAlkhateeb/sushy
    def bios(self):
        """Property to reference `Bios` instance

        It is set once when the first time it is queried. On refresh,
        this property is marked as stale (greedy-refresh not done).
        Here the actual refresh of the sub-resource happens, if stale.
        """
        return bios.Bios(self._conn,
                         utils.get_sub_resource_path_by(self, 'Bios'),
                         redfish_version=self.redfish_version)
コード例 #8
0
    def subscriptions(self):
        """Property to provide reference to `EventDestinationCollection` instance

           It is calculated once when it is queried for the first time. On
           refresh, this property is reset.
        """
        return event_destination.EventDestinationCollection(
            self._conn,
            utils.get_sub_resource_path_by(self, "Subscriptions"),
            redfish_version=self.redfish_version,
        )
コード例 #9
0
    def forward_mirror_interface(self):
        """Property to provide reference to `EthernetSwitchPort` instance

           It is calculated once when it is queried for the first time. On
           refresh, this property is reset.
        """
        return ethernet_switch_port.EthernetSwitchPort(
            self._conn,
            utils.get_sub_resource_path_by(self, "ForwardMirrorInterface"),
            redfish_version=self.redfish_version,
        )
コード例 #10
0
    def network_protocol(self):
        """Property to provide reference to `ManagerNetworkProtocol` instance

           It is calculated once when it is queried for the first time. On
           refresh, this property is reset.
        """
        return manager_network_protocol.ManagerNetworkProtocol(
            self._conn,
            utils.get_sub_resource_path_by(self, "NetworkProtocol"),
            redfish_version=self.redfish_version,
        )
コード例 #11
0
    def acls(self):
        """Property to provide reference to `EthernetSwitchACLCollection` instance

           It is calculated once when it is queried for the first time. On
           refresh, this property is reset.
        """
        return ethernet_switch_acl.EthernetSwitchACLCollection(
            self._conn,
            utils.get_sub_resource_path_by(self, "ACLs"),
            redfish_version=self.redfish_version,
        )
コード例 #12
0
    def volumes(self):
        """Property to provide reference to `VolumeCollection` instance

           It is calculated once when it is queried for the first time. On
           refresh, this property is reset.
        """
        return volume.VolumeCollection(
            self._conn,
            utils.get_sub_resource_path_by(self, "Volumes"),
            redfish_version=self.redfish_version,
        )
コード例 #13
0
ファイル: system.py プロジェクト: SarahAlkhateeb/sushy
    def ethernet_interfaces(self):
        """Property to reference `EthernetInterfaceCollection` instance

        It is set once when the first time it is queried. On refresh,
        this property is marked as stale (greedy-refresh not done).
        Here the actual refresh of the sub-resource happens, if stale.
        """
        return ethernet_interface.EthernetInterfaceCollection(
            self._conn,
            utils.get_sub_resource_path_by(self, "EthernetInterfaces"),
            redfish_version=self.redfish_version)
コード例 #14
0
    def simple_storage(self):
        """Property to provide reference to `SimpleStorageCollection` instance

           It is calculated once when it is queried for the first time. On
           refresh, this property is reset.
        """
        return simple_storage.SimpleStorageCollection(
            self._conn,
            utils.get_sub_resource_path_by(self, "SimpleStorage"),
            redfish_version=self.redfish_version,
        )
コード例 #15
0
    def power(self):
        """Property to provide reference to `Power` instance

           It is calculated once when it is queried for the first time. On
           refresh, this property is reset.
        """
        return power.Power(
            self._conn,
            utils.get_sub_resource_path_by(self, "Power"),
            redfish_version=self.redfish_version,
        )
コード例 #16
0
    def static_macs(self):
        """Property to provide reference to `EthernetSwitchStaticMACCollection`

           It is calculated once when it is queried for the first time. On
           refresh, this property is reset.
        """
        return ethernet_switch_static_mac.EthernetSwitchStaticMACCollection(
            self._conn,
            utils.get_sub_resource_path_by(self, "StaticMACs"),
            redfish_version=self.redfish_version,
        )
コード例 #17
0
    def vlans(self):
        """Property to provide reference to `VLanNetworkInterfaceCollection`

           It is calculated once when it is queried for the first time. On
           refresh, this property is reset.
        """
        return vlan_network_interface.VLanNetworkInterfaceCollection(
            self._conn,
            utils.get_sub_resource_path_by(self, "VLANs"),
            redfish_version=self.redfish_version,
        )
コード例 #18
0
    def network_device_functions(self):
        """Property to provide reference to `NetworkDeviceFunctionCollection` instance

           It is calculated once when it is queried for the first time. On
           refresh, this property is reset.
        """
        return network_device_function.NetworkDeviceFunctionCollection(
            self._conn,
            utils.get_sub_resource_path_by(self, "NetworkDeviceFunctions"),
            redfish_version=self.redfish_version,
        )
コード例 #19
0
    def volumes(self):
        """Property to reference `VolumeCollection` instance

        It is set once when the first time it is queried. On refresh,
        this property is marked as stale (greedy-refresh not done at that
        point). Here only the actual refresh of the sub-resource happens,
        if resource is stale.
        """
        return volume.VolumeCollection(self._conn,
                                       utils.get_sub_resource_path_by(
                                           self, 'Volumes'),
                                       redfish_version=self.redfish_version)
コード例 #20
0
    def secure_boot(self):
        """Property to reference `SecureBoot` instance

        It is set once when the first time it is queried. On refresh,
        this property is marked as stale (greedy-refresh not done).
        Here the actual refresh of the sub-resource happens, if stale.
        """
        return secure_boot.SecureBoot(self._conn,
                                      utils.get_sub_resource_path_by(
                                          self, 'SecureBoot'),
                                      redfish_version=self.redfish_version,
                                      registries=self.registries)
コード例 #21
0
ファイル: system.py プロジェクト: nikitaomare/sushy
    def chassis(self):
        """A list of chassis where this system resides.

        Returns a list of `Chassis` objects representing the chassis
        or cabinets where this system is mounted.

        :raises: MissingAttributeError if '@odata.id' field is missing.
        :returns: A list of `Chassis` instances
        """
        paths = utils.get_sub_resource_path_by(
            self, ["Links", "Chassis"], is_collection=True)

        return [chassis.Chassis(self._conn, path,
                                redfish_version=self.redfish_version)
                for path in paths]
コード例 #22
0
ファイル: system.py プロジェクト: nikitaomare/sushy
    def managers(self):
        """A list of managers for this system.

        Returns a list of `Manager` objects representing the managers
        that manage this system.

        :raises: MissingAttributeError if '@odata.id' field is missing.
        :returns: A list of `Manager` instances
        """
        paths = utils.get_sub_resource_path_by(
            self, ["Links", "ManagedBy"], is_collection=True)

        return [manager.Manager(self._conn, path,
                                redfish_version=self.redfish_version)
                for path in paths]
コード例 #23
0
    def databases(self):
        """A collection of secure boot databases.

        It is set once when the first time it is queried. On refresh,
        this property is marked as stale (greedy-refresh not done).
        Here the actual refresh of the sub-resource happens, if stale.

        :raises: MissingAttributeError if 'SecureBootDatabases/@odata.id' field
            is missing.
        :returns: `SimpleStorageCollection` instance
        """
        return secure_boot_database.SecureBootDatabaseCollection(
            self._conn,
            utils.get_sub_resource_path_by(self, "SecureBootDatabases"),
            redfish_version=self.redfish_version,
            registries=self.registries)
コード例 #24
0
ファイル: chassis.py プロジェクト: fktt/sushy
    def systems(self):
        """A list of systems residing in this chassis.

        Returns a list of `System` objects representing systems being
        mounted in this chassis/cabinet.

        :raises: MissingAttributeError if '@odata.id' field is missing.
        :returns: A list of `System` instances
        """
        paths = utils.get_sub_resource_path_by(
            self, ["Links", "ComputerSystems"], is_collection=True)

        from sushy.resources.system import system
        return [system.System(self._conn, path,
                              self.redfish_version, self.registries)
                for path in paths]
コード例 #25
0
ファイル: system.py プロジェクト: nikitaomare/sushy
    def simple_storage(self):
        """A collection of simple storage associated with system.

        This returns a reference to `SimpleStorageCollection` instance.
        SimpleStorage represents the properties of a storage controller and its
        directly-attached devices.

        It is set once when the first time it is queried. On refresh,
        this property is marked as stale (greedy-refresh not done).
        Here the actual refresh of the sub-resource happens, if stale.

        :raises: MissingAttributeError if 'SimpleStorage/@odata.id' field
            is missing.
        :returns: `SimpleStorageCollection` instance
        """
        return sys_simple_storage.SimpleStorageCollection(
            self._conn, utils.get_sub_resource_path_by(self, "SimpleStorage"),
            redfish_version=self.redfish_version)
コード例 #26
0
    def systems(self):
        """A list of systems managed by this manager.

        Returns a list of `System` objects representing systems being
        managed by this manager.

        :raises: MissingAttributeError if '@odata.id' field is missing.
        :returns: A list of `System` instances
        """
        paths = utils.get_sub_resource_path_by(self,
                                               ["Links", "ManagerForServers"],
                                               is_collection=True)

        from sushy.resources.system import system
        return [
            system.System(self._conn, path, self.redfish_version,
                          self.registries) for path in paths
        ]
コード例 #27
0
    def chassis(self):
        """A list of chassis managed by this manager.

        Returns a list of `Chassis` objects representing the chassis
        or cabinets managed by this manager.

        :raises: MissingAttributeError if '@odata.id' field is missing.
        :returns: A list of `Chassis` instances
        """
        paths = utils.get_sub_resource_path_by(self,
                                               ["Links", "ManagerForChassis"],
                                               is_collection=True)

        from sushy.resources.chassis import chassis
        return [
            chassis.Chassis(self._conn, path, self.redfish_version,
                            self.registries) for path in paths
        ]
コード例 #28
0
ファイル: system.py プロジェクト: nikitaomare/sushy
    def storage(self):
        """A collection of storage subsystems associated with system.

        This returns a reference to `StorageCollection` instance.
        A storage subsystem represents a set of storage controllers (physical
        or virtual) and the resources such as drives and volumes that can be
        accessed from that subsystem.

        It is set once when the first time it is queried. On refresh,
        this property is marked as stale (greedy-refresh not done).
        Here the actual refresh of the sub-resource happens, if stale.

        :raises: MissingAttributeError if 'Storage/@odata.id' field
            is missing.
        :returns: `StorageCollection` instance
        """
        return sys_storage.StorageCollection(
            self._conn, utils.get_sub_resource_path_by(self, "Storage"),
            redfish_version=self.redfish_version)
コード例 #29
0
 def test_get_sub_resource_path_by_list(self):
     subresource_path = ['EthernetInterfaces']
     expected_result = '/redfish/v1/Systems/437XR1138R2/EthernetInterfaces'
     value = utils.get_sub_resource_path_by(self.sys_inst, subresource_path)
     self.assertEqual(expected_result, value)
コード例 #30
0
 def _get_metric_report_path(self):
     """Helper function to find the metric report path"""
     return utils.get_sub_resource_path_by(self, 'MetricReport')