Exemple #1
0
        public JobInstance[] GetAllJobs()
        {
            ServiceCred cred    = new ServiceCred(this.m_hostInfo.Username, this.m_hostInfo.Password);
            int         timeout = this.m_proxy.Timeout;

            this.m_proxy.Timeout = this.m_requestCompositeTimeout;
            JobInstance[] allJobs = this.m_proxy.GetAllJobs(cred);
            this.m_proxy.Timeout = timeout;
            return(allJobs);
        }
Exemple #2
0
        public NetworkInstance[] GetHypervisorNetworks(ServerInfo source)
        {
            ServiceCred cred    = new ServiceCred(this.m_hostInfo.Username, this.m_hostInfo.Password);
            int         timeout = this.m_proxy.Timeout;

            this.m_proxy.Timeout = this.m_requestCompositeTimeout;
            NetworkInstance[] hypervisorNetworks = this.m_proxy.GetHypervisorNetworks(cred, source);
            this.m_proxy.Timeout = timeout;
            return(hypervisorNetworks);
        }
Exemple #3
0
        public VmInstance[] GetVirtualMachines(ServerInfo source)
        {
            ServiceCred cred    = new ServiceCred(this.m_hostInfo.Username, this.m_hostInfo.Password);
            int         timeout = this.m_proxy.Timeout;

            this.m_proxy.Timeout = this.m_requestCompositeTimeout;
            VmInstance[] virtualMachines = this.m_proxy.GetVirtualMachines(cred, source);
            this.m_proxy.Timeout = timeout;
            return(virtualMachines);
        }
Exemple #4
0
        public string GetLog()
        {
            ServiceCred cred    = new ServiceCred(this.m_hostInfo.Username, this.m_hostInfo.Password);
            int         timeout = this.m_proxy.Timeout;

            this.m_proxy.Timeout = this.m_requestCompositeTimeout;
            string log = this.m_proxy.GetLog(cred);

            this.m_proxy.Timeout = timeout;
            return(log);
        }
Exemple #5
0
        public void Connect(ServerInfo hostInfo)
        {
            if (((hostInfo.Hostname.Length == 0) || (hostInfo.Username.Length == 0)) || (hostInfo.Password.Length == 0))
            {
                throw new ArgumentException("Host info is empty");
            }
            Dictionary <string, string> xenServerVersionInfo = this.GetXenServerVersionInfo(hostInfo);

            if ((xenServerVersionInfo != null) && (xenServerVersionInfo.Count == 3))
            {
                IsTampaOrGreater(xenServerVersionInfo);
            }
            this.m_hostInfo   = hostInfo;
            this.m_serviceUrl = GetServiceUrl(hostInfo);
            LOG.Info(string.Format("Conversion info: service={0}", this.m_serviceUrl));
            this.m_proxy = this.CreateProxy(this.m_serviceUrl, this.m_requestRegularTimeout);
            ServiceCred cred = new ServiceCred(this.m_hostInfo.Username, this.m_hostInfo.Password);
            string      msg  = string.Format("ConversionClient version={0}, Application version={1}", Assembly.GetExecutingAssembly().GetName().Version.ToString(), Assembly.GetCallingAssembly().GetName().Version.ToString());

            this.m_proxy.LogMessage(cred, 6, msg);
        }
Exemple #6
0
        public void DeleteJob(string jobId)
        {
            ServiceCred cred = new ServiceCred(this.m_hostInfo.Username, this.m_hostInfo.Password);

            this.m_proxy.DeleteJob(cred, jobId);
        }
Exemple #7
0
        public JobInstance CreateJob(JobInfo jobInfo)
        {
            ServiceCred cred = new ServiceCred(this.m_hostInfo.Username, this.m_hostInfo.Password);

            return(this.m_proxy.CreateJob(cred, jobInfo));
        }
Exemple #8
0
        public void ClearJobs()
        {
            ServiceCred cred = new ServiceCred(this.m_hostInfo.Username, this.m_hostInfo.Password);

            this.m_proxy.ClearJobs(cred);
        }
Exemple #9
0
        public long GetReservedDiskSpace(string sruuid)
        {
            ServiceCred cred = new ServiceCred(this.m_hostInfo.Username, this.m_hostInfo.Password);

            return(this.m_proxy.GetReservedDiskSpace(cred, sruuid));
        }
Exemple #10
0
        public JobInstance GetJob(string jobId)
        {
            ServiceCred cred = new ServiceCred(this.m_hostInfo.Username, this.m_hostInfo.Password);

            return(this.m_proxy.GetJob(cred, jobId));
        }