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 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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 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);
     }
 }
Exemplo n.º 5
0
 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);
     }
 }