+ ResourceTypeEnum.PSERVER_CPU, self._cpuconverter(cpuinfo))\r
+\r
+ def getMemList(self, **filters) -> List[ocloudModel.StxGenericModel]:\r
+ hostid = filters.get("hostid", None)\r
+ assert (hostid is not None), "missing hostid to query imem list"\r
+ memlist = self.stxclient.imemory.list(hostid)\r
+ return [ocloudModel.StxGenericModel(\r
+ ResourceTypeEnum.PSERVER_RAM,\r
+ self._memconverter(memories)) for memories in memlist if memories]\r
+\r
+ def getMem(self, id) -> ocloudModel.StxGenericModel:\r
+ meminfo = self.stxclient.imemory.get(id)\r
+ return ocloudModel.StxGenericModel(\r
+ ResourceTypeEnum.PSERVER_RAM, self._memconverter(meminfo))\r
+\r
+ def getPortList(self, **filters) -> List[ocloudModel.StxGenericModel]:\r
+ hostid = filters.get("hostid", None)\r
+ assert (hostid is not None), "missing hostid to query port list"\r
+ portlist = self.stxclient.port.list(hostid)\r
+ return [ocloudModel.StxGenericModel(\r
+ ResourceTypeEnum.PSERVER_PORT,\r
+ port) for port in portlist if port]\r
+\r
+ def getPort(self, id) -> ocloudModel.StxGenericModel:\r
+ portinfo = self.stxclient.port.get(id)\r
+ return ocloudModel.StxGenericModel(\r
+ ResourceTypeEnum.PSERVER_PORT, portinfo)\r
+\r
+ def getIfList(self, **filters) -> List[ocloudModel.StxGenericModel]:\r
+ hostid = filters.get("hostid", None)\r
+ assert (hostid is not None), "missing hostid to query iinterface list"\r
+ iflist = self.stxclient.iinterface.list(hostid)\r
+ return [ocloudModel.StxGenericModel(\r
+ ResourceTypeEnum.PSERVER_IF,\r
+ self._ifconverter(ifs)) for ifs in iflist if ifs]\r
+\r
+ def getIf(self, id) -> ocloudModel.StxGenericModel:\r
+ ifinfo = self.stxclient.iinterface.get(id)\r
+ return ocloudModel.StxGenericModel(\r
+ ResourceTypeEnum.PSERVER_IF, self._ifconverter(ifinfo))\r