Esempio n. 1
0
        private void GetFirmwareDownloadsReport()
        {
            //TODO: Request that firmware download API accept callback parameter then wouldn't have to request a report and poll.
            Client <ReportServiceClient> c = null;

            c = InternalClientFactory.ConstructReportServiceClient(InternalLib.Endpoint.ReportEndpointName, InternalLib.Endpoint.ExternalUserName, InternalLib.Endpoint.ExternalUserPassword);
            FirmwareDownloadsReportInput fwdlReportInput = new FirmwareDownloadsReportInput();

            //Request all fwdl jobs between the begin
            fwdlReportInput.StartTime = _fwdl.FWDLBegin;
            fwdlReportInput.StopTime  = DateTime.Now;
            this._fwdlsRunningReport  = c.ServiceClient.GetFirmwareDownloadsReport(fwdlReportInput);
            c.ServiceClient.Close();
        }
Esempio n. 2
0
        public int GetEndpointsCompletedForCurrentJob()
        {
            int iEndpointsComplete = 0;
            //TODO: Request that firmware download API accept callback parameter then wouldn't have to request a report and poll.
            Client <ReportServiceClient> c = null;

            c = InternalClientFactory.ConstructReportServiceClient(InternalLib.Endpoint.ReportEndpointName, InternalLib.Endpoint.ExternalUserName, InternalLib.Endpoint.ExternalUserPassword);
            FirmwareDownloadsReportInput fwdlReportInput = new FirmwareDownloadsReportInput();

            //Request all fwdl jobs between the begin
            fwdlReportInput.StartTime = FWDLBegin;
            fwdlReportInput.StopTime  = DateTime.Now;
            FirmwareDownloadsReport _fwdlsRunningReport = c.ServiceClient.GetFirmwareDownloadsReport(fwdlReportInput);

            c.ServiceClient.Close();


            //TODO: FirmwareDownloadItems[0].Status is an EnumJobStatus type that is not exposed in web services, thus test status against hard string.  Request EnumJobStatus be exposed.
            if (null != _fwdlsRunningReport)
            {
                if (0 < _fwdlsRunningReport.FirmwareDownloadItems.Length)
                {
                    //firmware download running
                    foreach (FirmwareDownloadItem fwdlItem in _fwdlsRunningReport.FirmwareDownloadItems)
                    {
                        if (fwdlItem.JobId == CurrentFWDLJob.JobKey.value.ToString())
                        {
                            iEndpointsComplete = fwdlItem.CountOfEndpointsComplete;
                            break;
                        }
                    }
                }
            }

            return(iEndpointsComplete);
        }