public void SetWalkUpgradeDomainProcess()
        {
            Action <string>        action = null;
            WalkUpgradeDomainInput walkUpgradeDomainInput = new WalkUpgradeDomainInput();

            walkUpgradeDomainInput.UpgradeDomain = this.DomainNumber;
            WalkUpgradeDomainInput walkUpgradeDomainInput1 = walkUpgradeDomainInput;

            using (OperationContextScope operationContextScope = new OperationContextScope((IContextChannel)base.Channel))
            {
                try
                {
                    SetAzureWalkUpgradeDomainCommand setAzureWalkUpgradeDomainCommand = this;
                    if (action == null)
                    {
                        action = (string s) => base.Channel.WalkUpgradeDomainBySlot(s, this.ServiceName, this.Slot, walkUpgradeDomainInput1);
                    }
                    ((CmdletBase <IServiceManagement>)setAzureWalkUpgradeDomainCommand).RetryCall(action);
                    Operation operation = base.WaitForOperation(base.CommandRuntime.ToString());
                    ManagementOperationContext managementOperationContext = new ManagementOperationContext();
                    managementOperationContext.set_OperationDescription(base.CommandRuntime.ToString());
                    managementOperationContext.set_OperationId(operation.OperationTrackingId);
                    managementOperationContext.set_OperationStatus(operation.Status);
                    ManagementOperationContext managementOperationContext1 = managementOperationContext;
                    base.WriteObject(managementOperationContext1, true);
                }
                catch (CommunicationException communicationException1)
                {
                    CommunicationException communicationException = communicationException1;
                    this.WriteErrorDetails(communicationException);
                }
            }
        }
            this.ExecuteCommand();
        }
    }
}
Ejemplo n.º 3
0
        internal void ExecuteCommand()
        {
            var walkUpgradeDomain = new WalkUpgradeDomainInput
            {
                UpgradeDomain = this.DomainNumber
            };

            ExecuteClientActionInOCS(null, CommandRuntime.ToString(), s => this.Channel.WalkUpgradeDomainBySlot(s, this.ServiceName, this.Slot, walkUpgradeDomain));
        }
        protected override void PerformOperation(IServiceManagement channel)
        {
            int upgradeDomain = -1;

            if (!string.IsNullOrEmpty(UpgradeDomainString))
            {
                upgradeDomain = int.Parse(UpgradeDomainString, CultureInfo.CurrentCulture);
            }

            WalkUpgradeDomainInput input = new WalkUpgradeDomainInput
            {
                UpgradeDomain = upgradeDomain
            };

            Console.WriteLine("Walking upgrade domain:" + input.UpgradeDomain);
            if (!string.IsNullOrEmpty(DeploymentName))
            {
                channel.WalkUpgradeDomain(SubscriptionId, HostedServiceName, DeploymentName, input);
            }
            else if (!string.IsNullOrEmpty(DeploymentSlot))
            {
                channel.WalkUpgradeDomainBySlot(SubscriptionId, HostedServiceName, DeploymentSlot, input);
            }
        }
 public static void WalkUpgradeDomainBySlot(this IServiceManagement proxy, string subscriptionId, string serviceName, string deploymentSlot, WalkUpgradeDomainInput input)
 {
     proxy.EndWalkUpgradeDomainBySlot(proxy.BeginWalkUpgradeDomainBySlot(subscriptionId, serviceName, deploymentSlot, input, null, null));
 }
 public IAsyncResult BeginWalkUpgradeDomainBySlot(string subscriptionId, string serviceName, string deploymentSlot, WalkUpgradeDomainInput input, AsyncCallback callback, object state)
 {
     SimpleServiceManagementAsyncResult result = new SimpleServiceManagementAsyncResult();
     result.Values["subscriptionId"] = subscriptionId;
     result.Values["serviceName"] = serviceName;
     result.Values["deploymentSlot"] = deploymentSlot;
     result.Values["input"] = input;
     result.Values["callback"] = callback;
     result.Values["state"] = state;
     return result;
 }
 public static void WalkUpgradeDomainBySlot(this IServiceManagement proxy, string subscriptionId, string serviceName, string deploymentSlot, WalkUpgradeDomainInput input)
 {
     proxy.EndWalkUpgradeDomainBySlot(proxy.BeginWalkUpgradeDomainBySlot(subscriptionId, serviceName, deploymentSlot, input, null, null));
 }