Beispiel #1
0
    def list_tasks(self,
                   tenant_name,
                   cluster_name=None,
                   datacenter=None,
                   vcenter=None,
                   task_id=None):

        uri = self.cluster_query(cluster_name, datacenter, vcenter,
                                 tenant_name)

        if (cluster_name):
            cluster = self.cluster_show_uri(uri)
            if (cluster['name'] == cluster_name):
                if (not task_id):
                    return common.get_tasks_by_resourceuri(
                        "cluster", cluster["id"], self.__ipAddr, self.__port)

                else:
                    res = common.get_task_by_resourceuri_and_taskId(
                        "cluster", cluster["id"], task_id, self.__ipAddr,
                        self.__port)
                    if (res):
                        return res
            raise SOSError(SOSError.NOT_FOUND_ERR,
                           "Cluster with name: " + cluster_name + " not found")
    def list_tasks(self, host_name, initiatorportwwn, task_id=None):

        uri = self.query_by_portwwn(initiatorportwwn, host_name)
        
      

        hostinitiator = self.show_by_uri(uri)
        if(hostinitiator['initiator_port'] == initiatorportwwn):
            if(not task_id):
                
                return common.get_tasks_by_resourceuri(
                    "initiator", uri, self.__ipAddr, self.__port)

            else:
                
                res = common.get_task_by_resourceuri_and_taskId(
                    "initiator", uri, task_id,
                    self.__ipAddr, self.__port)
                if(res):
                    return res
        raise SOSError(
            SOSError.NOT_FOUND_ERR,
            "Initiator with Initiatorportwwn : " +
            initiatorportwwn +
            " not found")
    def list_tasks(self,
                   host_name,
                   initiatorportwwn,
                   task_id=None,
                   tenant=None):

        uri = self.query_by_portwwn(initiatorportwwn, host_name, tenant)

        hostinitiator = self.show_by_uri(uri)
        if (hostinitiator['initiator_port'] == initiatorportwwn):
            if (not task_id):

                return common.get_tasks_by_resourceuri("initiator", uri,
                                                       self.__ipAddr,
                                                       self.__port)

            else:

                res = common.get_task_by_resourceuri_and_taskId(
                    "initiator", uri, task_id, self.__ipAddr, self.__port)
                if (res):
                    return res
        raise SOSError(
            SOSError.NOT_FOUND_ERR, "Initiator with Initiatorportwwn : " +
            initiatorportwwn + " not found")
    def show_task_by_uri(self, initiator_uri, task_id=None):

        if not task_id:
            return common.get_tasks_by_resourceuri("initiator", initiator_uri, self.__ipAddr, self.__port)
        else:
            return common.get_task_by_resourceuri_and_taskId(
                "initiator", initiator_uri, task_id, self.__ipAddr, self.__port
            )
    def show_task_by_uri(self, exportgroup_uri, task_id=None):

        if not task_id:
            return common.get_tasks_by_resourceuri("export", exportgroup_uri, self.__ipAddr, self.__port)
        else:
            return common.get_task_by_resourceuri_and_taskId(
                "export", exportgroup_uri, task_id, self.__ipAddr, self.__port
            )
    def show_task_by_uri(self, initiator_uri, task_id=None):

        if (not task_id):
            return (common.get_tasks_by_resourceuri("initiator", initiator_uri,
                                                    self.__ipAddr,
                                                    self.__port))
        else:
            return (common.get_task_by_resourceuri_and_taskId(
                "initiator", initiator_uri, task_id, self.__ipAddr,
                self.__port))
Beispiel #7
0
    def list_tasks(self, tenant_name, vcenter_name=None, task_id=None):

        uri = self.vcenter_query(vcenter_name, tenant_name)

        if (vcenter_name):
            vcenter = self.vcenter_show(uri, True)
            if (vcenter != None):
                if (vcenter['name'] == vcenter_name):
                    if (not task_id):
                        return common.get_tasks_by_resourceuri(
                            "vcenter", vcenter["id"], self.__ipAddr,
                            self.__port)
                    else:
                        res = common.get_task_by_resourceuri_and_taskId(
                            "vcenter", vcenter["id"], task_id, self.__ipAddr,
                            self.__port)
                        if (res):
                            return res
            raise SOSError(SOSError.NOT_FOUND_ERR,
                           "Vcenter with name: " + vcenter_name + " not found")
Beispiel #8
0
    def list_tasks(self, host_name, ipaddress, task_id=None):

        ipinterfaceUri = self.query_by_ipaddress(ipaddress, host_name)

        ipinterface = self.show_by_uri(ipinterfaceUri)
        if (ipinterface['ip_address'] == ipaddress):
            if (not task_id):
                return common.get_tasks_by_resourceuri("ipinterface",
                                                       ipinterfaceUri,
                                                       self.__ipAddr,
                                                       self.__port)

            else:
                res = common.get_task_by_resourceuri_and_taskId(
                    "ipinterface", ipinterfaceUri, task_id, self.__ipAddr,
                    self.__port)
                if (res):
                    return res
        raise SOSError(
            SOSError.NOT_FOUND_ERR,
            "Ipinterface  with Ip Address : " + ipaddress + " not found")
    def list_tasks(self, host_name, ipaddress, task_id=None, tenant=None):

        ipinterfaceUri = self.query_by_ipaddress(ipaddress, host_name, tenant)

        ipinterface = self.show_by_uri(ipinterfaceUri)
        if(ipinterface['ip_address'] == ipaddress):
            if(not task_id):
                return common.get_tasks_by_resourceuri(
                    "ipinterface", ipinterfaceUri,
                    self.__ipAddr, self.__port)

            else:
                res = common.get_task_by_resourceuri_and_taskId(
                    "ipinterface", ipinterfaceUri, task_id,
                    self.__ipAddr, self.__port)
                if(res):
                    return res
        raise SOSError(
            SOSError.NOT_FOUND_ERR,
            "Ipinterface  with Ip Address : " +
            ipaddress +
            " not found")
Beispiel #10
0
    def list_tasks(self, tenant_name, cluster_name=None, task_id=None):

        uri = self.cluster_query(cluster_name, tenant_name)

        if(cluster_name):
            cluster = self.cluster_show_uri(uri)
            if(cluster['name'] == cluster_name):
                if(not task_id):
                    return common.get_tasks_by_resourceuri(
                        "cluster", cluster["id"],
                        self.__ipAddr, self.__port)

                else:
                    res = common.get_task_by_resourceuri_and_taskId(
                        "cluster", cluster["id"], task_id,
                        self.__ipAddr, self.__port)
                    if(res):
                        return res
            raise SOSError(
                SOSError.NOT_FOUND_ERR,
                "Cluster with name: " +
                cluster_name +
                " not found")
Beispiel #11
0
    def list_tasks(self, tenant_name, vcenter_name=None, task_id=None):

        uri = self.vcenter_query(vcenter_name, tenant_name)

        if(vcenter_name):
            vcenter = self.vcenter_show(uri, True)
            if(vcenter != None):
                if(vcenter['name'] == vcenter_name):
                    if(not task_id):
                        return common.get_tasks_by_resourceuri(
                            "vcenter", vcenter["id"],
                            self.__ipAddr, self.__port)
                    else:
                        res = common.get_task_by_resourceuri_and_taskId(
                            "vcenter", vcenter["id"], task_id,
                            self.__ipAddr, self.__port)
                        if(res):
                            return res
            raise SOSError(
                SOSError.NOT_FOUND_ERR,
                "Vcenter with name: " +
                vcenter_name +
                " not found")