+ 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
+\r
+ def _getIsystems(self):\r
+ return self.stxclient.isystem.list()\r
+\r
+ def _getIsystem(self, id=None):\r
+ if id:\r
+ return self.stxclient.isystem.get(id)\r
+ else:\r
+ isystems = self.stxclient.isystem.list()\r
+ if len(isystems) != 1 and not id:\r
+ raise Exception('No system uuid was provided and '\r
+ 'more than one system exists in the account.')\r
+ return isystems[0]\r
+\r
+ @ staticmethod\r