Beispiel #1
0
 protected override void ProcessRecord()
 {
     BatchClient.EnableJob(this.BatchContext, this.Id, this.AdditionalBehaviors);
 }
 public override void ExecuteCmdlet()
 {
     BatchClient.StopResizePool(this.BatchContext, this.Id, this.AdditionalBehaviors);
 }
 protected override void ProcessRecord()
 {
     BatchClient.TerminateJobSchedule(this.BatchContext, this.Id, this.AdditionalBehaviors);
 }
Beispiel #4
0
        public override void ExecuteCmdlet()
        {
            DisableJobParameters parameters = new DisableJobParameters(this.BatchContext, this.Id, null, this.DisableJobOption, this.AdditionalBehaviors);

            BatchClient.DisableJob(parameters);
        }
Beispiel #5
0
        /// <summary>
        /// Get the keys associated with the specified account. If only the account name is passed in, then
        /// look up its resource group and construct a new BatchAccountContext to hold everything.
        /// </summary>
        public override void ExecuteCmdlet()
        {
            BatchAccountContext context = BatchClient.GetKeys(this.ResourceGroupName, this.AccountName);

            WriteObject(context);
        }
        protected override void ExecuteCmdletImpl()
        {
            PSApplication response = BatchClient.AddApplication(this.ResourceGroupName, this.AccountName, this.ApplicationName, this.AllowUpdates, this.DisplayName);

            WriteObject(response);
        }
Beispiel #7
0
        public override void ExecuteCmdlet()
        {
            PSJobStatistics jobStatistics = BatchClient.GetAllJobsLifetimeStatistics(this.BatchContext, this.AdditionalBehaviors);

            WriteObject(jobStatistics);
        }
 public override void ExecuteCmdlet()
 {
     WriteVerboseWithTimestamp(Resources.BeginMAMLCall, mamlCall);
     BatchClient.DeleteApplication(this.ResourceGroupName, this.AccountName, this.ApplicationId);
     WriteVerboseWithTimestamp(Resources.EndMAMLCall, mamlCall);
 }
        protected override void ProcessRecord()
        {
            PSBatchSubscriptionQuotas quotas = BatchClient.GetSubscriptionQuotas(this.Location);

            WriteObject(quotas);
        }
 protected override void ExecuteCmdletImpl()
 {
     BatchAccountContext context = BatchClient.RegenerateKeys(this.ResourceGroupName, this.AccountName, this.keyType);
     WriteObject(context);
 }
 protected override void ExecuteCmdletImpl()
 {
     BatchClient.DisableJobSchedule(this.BatchContext, this.Id, this.AdditionalBehaviors);
 }
        protected override void ProcessRecord()
        {
            PoolOperationParameters parameters = new PoolOperationParameters(this.BatchContext, this.Id, null, this.AdditionalBehaviors);

            BatchClient.DisableAutoScale(parameters);
        }
 protected override void ExecuteCmdletImpl()
 {
     PSBatchLocationQuotas quotas = BatchClient.GetLocationQuotas(this.Location);
     WriteObject(quotas);
 }
Beispiel #14
0
        protected override void ExecuteCmdletImpl()
        {
            IList <PSSupportedSku> skus = BatchClient.GetSupportedVirtualMachineSku(Location, MaxResultCount, Filter);

            WriteObject(skus, true);
        }
Beispiel #15
0
        public override void ExecuteCmdlet()
        {
            PoolOperationParameters parameters = new PoolOperationParameters(this.BatchContext, this.Id, null, this.AdditionalBehaviors);

            BatchClient.DisableAutoScale(parameters);
        }
Beispiel #16
0
        public override void ExecuteCmdlet()
        {
            PSApplicationPackage context = BatchClient.GetApplicationPackage(this.ResourceGroupName, this.AccountName, this.ApplicationId, this.ApplicationVersion);

            WriteObject(context);
        }
Beispiel #17
0
        protected override void ExecuteCmdletImpl()
        {
            PSPoolStatistics poolStatistics = BatchClient.GetAllPoolsLifetimeStatistics(this.BatchContext, this.AdditionalBehaviors);

            WriteObject(poolStatistics);
        }
Beispiel #18
0
        public override void ExecuteCmdlet()
        {
            PSBatchSubscriptionQuotas quotas = BatchClient.GetSubscriptionQuotas(this.Location);

            WriteObject(quotas);
        }
        public override void ExecuteCmdlet()
        {
            var options = new ListJobPreparationAndReleaseStatusOptions(this.BatchContext, this.AdditionalBehaviors)
            {
                JobId    = this.Id,
                Job      = this.InputObject,
                Filter   = this.Filter,
                Select   = this.Select,
                Expand   = this.Expand,
                MaxCount = this.MaxCount
            };

            // The enumerator will internally query the service in chunks. Using WriteObject with the enumerate flag will enumerate
            // the entire collection first and then write the items out one by one in a single group.  Using foreach, we can take
            // advantage of the enumerator's behavior and write output to the pipeline in bursts.
            foreach (PSJobPreparationAndReleaseTaskExecutionInformation jobPrepAndReleaseInfo in BatchClient.ListJobPreparationAndReleaseStatus(options))
            {
                WriteObject(jobPrepAndReleaseInfo);
            }
        }
Beispiel #20
0
        // Keeping for InputObject
        //[Parameter(ParameterSetName = ParameterSetContext, Mandatory = true, ValueFromPipeline = true,
        //    HelpMessage = "An existing context that identifies the account to use for the key query.")]
        //[ValidateNotNull]
        //public BatchAccountContext InputObject { get; set; }

        public override void ExecuteCmdlet()
        {
            string accountName       = this.AccountName;
            string resourceGroupName = this.ResourceGroupName;

            //if (Context != null)
            //{
            //    accountName = Context.AccountName;
            //    resourceGroupName = Context.ResourceGroupName;
            //    context = Context;
            //}

            if (string.IsNullOrEmpty(accountName))
            {
                // no account name so we're doing some sort of list. If no resource group, then list all accounts under the
                // subscription otherwise all accounts in the resource group.
                if (resourceGroupName == null)
                {
                    WriteVerboseWithTimestamp(Resources.GBA_AllAccounts);
                }
                else
                {
                    WriteVerboseWithTimestamp(Resources.GBA_ResGroupAccounts, resourceGroupName);
                }

                WriteVerboseWithTimestamp(Resources.BeginMAMLCall, mamlRestName);
                var response = BatchClient.ListAccounts(new AccountListParameters {
                    ResourceGroupName = resourceGroupName
                });
                WriteVerboseWithTimestamp(Resources.EndMAMLCall, mamlRestName);

                foreach (AccountResource resource in response.Accounts)
                {
                    var context = BatchAccountContext.CrackAccountResourceToNewAccountContext(resource);
                    WriteObject(context);
                }

                var nextLink = response.NextLink;

                while (nextLink != null)
                {
                    WriteVerboseWithTimestamp(Resources.BeginMAMLCall, mamlRestName);
                    response = BatchClient.ListNextAccounts(nextLink);
                    WriteVerboseWithTimestamp(Resources.EndMAMLCall, mamlRestName);

                    foreach (AccountResource resource in response.Accounts)
                    {
                        var context = BatchAccountContext.CrackAccountResourceToNewAccountContext(resource);
                        WriteObject(context);
                    }

                    nextLink = response.NextLink;
                }
            }
            else
            {
                if (string.IsNullOrEmpty(resourceGroupName))
                {
                    // use resource mgr to see if account exists and then use resource group name to do the actual lookup
                    WriteVerboseWithTimestamp(Resources.ResGroupLookup, accountName);
                    resourceGroupName = BatchClient.GetGroupForAccount(accountName);
                }

                WriteVerboseWithTimestamp(Resources.BeginMAMLCall, mamlRestName);
                var response = BatchClient.GetAccount(resourceGroupName, accountName);
                WriteVerboseWithTimestamp(Resources.EndMAMLCall, mamlRestName);

                var context = BatchAccountContext.CrackAccountResourceToNewAccountContext(response.Resource);
                WriteObject(context);
            }
        }
 private void DeleteAction(string resGroupName, string accountName)
 {
     WriteVerboseWithTimestamp(Resources.BeginMAMLCall, mamlCall);
     BatchClient.DeleteAccount(resGroupName, accountName);
     WriteVerboseWithTimestamp(Resources.EndMAMLCall, mamlCall);
 }
Beispiel #22
0
 public override void ExecuteCmdlet()
 {
     WriteVerboseWithTimestamp(Resources.BeginMAMLCall, mamlCall);
     BatchClient.UpdateApplication(this.ResourceGroupName, this.AccountName, this.ApplicationId, this.AllowUpdates, this.DefaultVersion, this.DisplayName);
     WriteVerboseWithTimestamp(Resources.EndMAMLCall, mamlCall);
 }
        public override void ExecuteCmdlet()
        {
            BatchAccountContext context = BatchClient.CreateAccount(this.ResourceGroupName, this.AccountName, this.Location, this.Tag);

            WriteObject(context);
        }
Beispiel #24
0
        public override void ExecuteCmdlet()
        {
            BatchAccountContext context = BatchClient.UpdateAccount(this.ResourceGroupName, this.AccountName, this.Tag, this.AutoStorageAccountId);

            WriteObject(context);
        }
Beispiel #25
0
 public override void ExecuteCmdlet()
 {
     BatchClient.EnableJobSchedule(this.BatchContext, this.Id, this.AdditionalBehaviors);
 }
Beispiel #26
0
 protected override void ExecuteCmdletImpl()
 {
     WriteVerboseWithTimestamp(Resources.BeginMAMLCall, mamlCall);
     BatchClient.DeleteApplicationPackage(this.ResourceGroupName, this.AccountName, this.ApplicationName, this.ApplicationVersion);
     WriteVerboseWithTimestamp(Resources.EndMAMLCall, mamlCall);
 }
        /// <summary>
        /// Get the keys associated with the specified account. If only the account name is passed in, then
        /// look up its resource group and construct a new BatchAccountContext to hold everything.
        /// </summary>
        protected override void ProcessRecord()
        {
            BatchAccountContext context = BatchClient.ListKeys(this.ResourceGroupName, this.AccountName);

            WriteObject(context);
        }
        protected override void ProcessRecord()
        {
            BatchAccountContext context = BatchClient.CreateAccount(this.ResourceGroupName, this.AccountName, this.Location, this.Tag);

            WriteObject(context);
        }