How to use the redfish.ris.sharedtypes.Dictable function in redfish

To help you get started, we’ve selected a few redfish examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DMTF / python-redfish-library / tests / ris / test_ris.py View on Github external
def test_init(self):
        with self.assertRaises(TypeError):
            RisMonolithMember_v1_0_0()

        RisMonolithMember_v1_0_0("test")
        self.assertTrue(
            issubclass(RisMonolithMember_v1_0_0, RisMonolithMemberBase)
        )
        self.assertTrue(issubclass(RisMonolithMember_v1_0_0, Dictable))
github HewlettPackard / python-ilorest-library-old / src / redfish / ris / ris.py View on Github external
#---------Debug logger---------

LOGGER = logging.getLogger(__name__)

#---------End of debug logger---------

class BiosUnregisteredError(Exception):
    """Raised when BIOS has not been registered correctly in iLO"""
    pass

class SessionExpiredRis(Exception):
    """Raised when session has expired"""
    pass

class RisMonolithMemberBase(Dictable):
    """RIS monolith member base class"""
    pass

class RisMonolithMemberv100(RisMonolithMemberBase):
    """Wrapper around RestResponse that adds the monolith data"""
    def __init__(self, restresp, isredfish):
        self._resp = restresp
        self._patches = list()
        self._type = None
        if isredfish:
            self._typestring = u'@odata.type'
        else:
            self._typestring = u'Type'

    def _get_type(self):
        """Return type from monolith"""
github DMTF / python-redfish-library / src / redfish / ris / ris.py View on Github external
# ---------Debug logger---------

LOGGER = logging.getLogger(__name__)

# ---------End of debug logger---------


class SessionExpiredRis(Exception):
    """Raised when session has expired"""

    pass


@six.add_metaclass(abc.ABCMeta)
class RisMonolithMemberBase(Dictable):
    """RIS monolith member base class"""

    pass


class RisMonolithMember_v1_0_0(RisMonolithMemberBase):
    """Wrapper around RestResponse that adds the monolith data"""

    def __init__(self, restresp):
        self._resp = restresp
        self._patches = list()
        self._type = None
        self._typestring = "@odata.type"

    def _get_type(self):
        """Return type from monolith"""
github HewlettPackard / python-ilorest-library-old / src / redfish / ris / ris.py View on Github external
result = OrderedDict()

        if self.type:
            result[u'Type'] = self.type

            if self.maj_type == u'Collection.1' and \
                                            u'MemberType' in self._resp.dict:
                result[u'MemberType'] = self._resp.dict[u'MemberType']

            self._reducer(self._resp.dict)
            result[u'OriginalUri'] = self._resp.request.path
            result[u'Content'] = self._reducer(self._resp.dict)

        return result

class RisMonolithv100(Dictable):
    """Monolithic cache of RIS data"""
    def __init__(self, client):
        """Initialize RisMonolith

        :param client: client to utilize
        :type client: RmcClient object

        """
        self._client = client
        self.name = u"Monolithic output of RIS Service"
        self.types = OrderedDict()
        self._visited_urls = list()
        self._current_location = '/' # "root"
        self.queue = Queue()
        self._type = None
        self._name = None
github DMTF / python-redfish-library / src / redfish / ris / ris.py View on Github external
if self.type:
            result["Type"] = self.type

            if (self.maj_type == "Collection.1"
                    and "MemberType" in self._resp.dict):
                result["MemberType"] = self._resp.dict["MemberType"]

            self._reducer(self._resp.dict)
            result["OriginalUri"] = self._resp.request.path
            result["Content"] = self._reducer(self._resp.dict)

        return result


class RisMonolith_v1_0_0(Dictable):
    """Monolithic cache of RIS data"""

    def __init__(self, client):
        """Initialize RisMonolith

        :param client: client to utilize
        :type client: RmcClient object

        """
        self._client = client
        self.name = "Monolithic output of RIS Service"
        self.types = OrderedDict()
        self._visited_urls = list()
        self._current_location = "/"  # "root"
        self.queue = Queue()
        self._type = None