Provides the details of an HDInsight jobDetails when creating the jobDetails.
 public AzureHDInsightJob WaitJob()
 {
     _clusterName = GetClusterConnection(ResourceGroupName, ClusterName);
     var jobDetail = HDInsightJobClient.GetJob(JobId).JobDetail;
     while (!jobDetail.Status.JobComplete)
     {
         jobDetail = HDInsightJobClient.GetJob(JobId).JobDetail;
     }
     var jobDetails = new AzureHDInsightJob(jobDetail, HDInsightJobClient.ClusterName);
     return jobDetails;
 }
 public override void ExecuteCmdlet()
 {
     _clusterName = GetClusterConnection(ResourceGroupName, ClusterName);
     if (JobId != null)
     {
         var job = HDInsightJobClient.GetJob(JobId);
         var jobDetails = new AzureHDInsightJob(job.JobDetail, HDInsightJobClient.ClusterName);
         WriteObject(jobDetails);
     }
     else
     {
         var jobs = HDInsightJobClient.ListJobs().Select(job => job.Id);
         WriteObject(jobs, true);
     }
 }
 protected override void ProcessRecord()
 {
     if (ResourceGroupName == null)
     {
         ResourceGroupName = GetResourceGroupByAccountName(ClusterName);
     }
     _clusterName = GetClusterConnection(ResourceGroupName, ClusterName);
     if (JobId != null)
     {
         var job = HDInsightJobClient.GetJob(JobId);
         var jobDetails = new AzureHDInsightJob(job.JobDetail, HDInsightJobClient.ClusterName);
         WriteObject(jobDetails);
     }
     else
     {
         var jobs = HDInsightJobClient.ListJobs().Select(job => job.Id);
         WriteObject(jobs, true);
     }
 }
        public AzureHDInsightJob Execute()
        {
            _clusterName = GetClusterConnection(ResourceGroupName, ClusterName);

            var jobCreationResults = SubmitJob();

            var startedJob = HDInsightJobClient.GetJob(jobCreationResults.JobSubmissionJsonResponse.Id);

            var jobDetail = new AzureHDInsightJob(startedJob.JobDetail, HDInsightJobClient.ClusterName);

            return jobDetail;
        }
        public override void ExecuteCmdlet()
        {
            if (ResourceGroupName == null)
            {
                ResourceGroupName = GetResourceGroupByAccountName(ClusterName);
            }

            _clusterName = GetClusterConnection(ResourceGroupName, ClusterName);

            if (NumOfJobs > 0)
            {
                var jobs = HDInsightJobClient.ListJobsAfterJobId(JobId, NumOfJobs).Select(job => new AzureHDInsightJob(job.Detail, HDInsightJobClient.ClusterName));
                WriteObject(jobs, true);
            }
            else if (JobId != null)
            {
                var job = HDInsightJobClient.GetJob(JobId);
                var jobDetails = new AzureHDInsightJob(job.JobDetail, HDInsightJobClient.ClusterName);
                WriteObject(jobDetails);
            }
            else
            {
                var jobs = HDInsightJobClient.ListJobs().Select(job => job.Id);
                WriteObject(jobs, true);
            }
        }
        public AzureHDInsightJob WaitJob()
        {
            _clusterName = GetClusterConnection(ResourceGroupName, ClusterName);

            TimeSpan? duration = null;

            if (TimeoutInSeconds > 0)
            {
                duration = TimeSpan.FromSeconds(TimeoutInSeconds);
            }

            TimeSpan? waitInterval = null;

            if (WaitIntervalInSeconds > 0)
            {
                waitInterval = TimeSpan.FromSeconds(WaitIntervalInSeconds);
            }

            JobDetailRootJsonObject jobDetail = null;

            try
            {
                jobDetail = HDInsightJobClient.WaitForJobCompletion(JobId, duration, waitInterval).JobDetail;
            }
            catch (TimeoutException)
            {
                var exceptionMessage = string.Format(CultureInfo.InvariantCulture, "HDInsight job with ID {0} has not completed in {1} seconds. Increase the value of -TimeoutInSeconds or check the job runtime.", JobId, TimeoutInSeconds);
                throw new CloudException(exceptionMessage);
            }

            var jobDetails = new AzureHDInsightJob(jobDetail, HDInsightJobClient.ClusterName);
            return jobDetails;
        }