WaitForState() публичный Метод

This method waits until the deployment reaches a specified state. Remark: Caller for this method should handle any thrown exception
public WaitForState ( string state, string rootPath, string inServiceName, string inSlot, string subscription ) : void
state string The state which method will wait on
rootPath string The service root path name (can be null)
inServiceName string Service that has the deployment to use (can be null)
inSlot string Type of the slot for deployment which method will wait on
subscription string Subscription name which has the service
Результат void
Пример #1
0
        public virtual string SetDeploymentStatusProcess(string rootPath, string newStatus, string slot, string subscription, string serviceName)
        {
            if (!string.IsNullOrEmpty(subscription))
            {
                var globalComponents = GlobalComponents.Load(GlobalPathInfo.GlobalSettingsDirectory);
                CurrentSubscription = globalComponents.Subscriptions.Values.First(
                    sub => sub.SubscriptionName == subscription);
            }

            string result = CheckDeployment(newStatus, serviceName, slot);
            if (string.IsNullOrEmpty(result))
            {
                SetDeployment(newStatus, serviceName, slot);
                var deploymentStatusCommand = new GetDeploymentStatus(Channel) { ShareChannel = ShareChannel, CurrentSubscription = CurrentSubscription };
                deploymentStatusCommand.WaitForState(newStatus, rootPath, serviceName, slot, CurrentSubscription.SubscriptionName);
            }

            return result;
        }
Пример #2
0
        public virtual string SetDeploymentStatusProcess(string rootPath, string newStatus, string slot, string subscription, string serviceName)
        {
            if (!string.IsNullOrEmpty(subscription))
            {
                var globalComponents = GlobalComponents.Load(GlobalPathInfo.GlobalSettingsDirectory);
                CurrentSubscription = globalComponents.Subscriptions.Values.First(
                    sub => sub.SubscriptionName == subscription);
            }

            string result = CheckDeployment(newStatus, serviceName, slot);

            if (string.IsNullOrEmpty(result))
            {
                SetDeployment(newStatus, serviceName, slot);
                var deploymentStatusCommand = new GetDeploymentStatus(Channel)
                {
                    ShareChannel = ShareChannel, CurrentSubscription = CurrentSubscription
                };
                deploymentStatusCommand.WaitForState(newStatus, rootPath, serviceName, slot, CurrentSubscription.SubscriptionName);
            }

            return(result);
        }
        public virtual void SetDeploymentStatusProcess(string rootPath, string newStatus, string slot, string subscription, string serviceName)
        {
            string result;

            if (!string.IsNullOrEmpty(subscription))
            {
                var globalComponents = GlobalComponents.Load(GlobalPathInfo.GlobalSettingsDirectory);
                CurrentSubscription = globalComponents.Subscriptions.Values.First(
                    sub => sub.SubscriptionName == subscription);
            }

            // Check that deployment slot for the service exists
            WriteVerboseWithTimestamp(Resources.LookingForDeploymentMessage, slot, serviceName);
            result = CheckDeployment(newStatus, serviceName, slot);

            if (string.IsNullOrEmpty(result))
            {
                SetDeployment(newStatus, serviceName, slot);
                GetDeploymentStatus deploymentStatusCommand = new GetDeploymentStatus(Channel, CommandRuntime)
                { ShareChannel = ShareChannel, CurrentSubscription = CurrentSubscription };
                deploymentStatusCommand.WaitForState(newStatus, rootPath, serviceName, slot, CurrentSubscription.SubscriptionName);
                Deployment deployment = this.RetryCall<Deployment>(s => this.Channel.GetDeploymentBySlot(s, serviceName, slot));

                if (PassThru)
                {
                    WriteObject(deployment);
                }

                WriteVerboseWithTimestamp(string.Format(Resources.ChangeDeploymentStatusCompleteMessage, serviceName, newStatus));
            }
            else
            {
                WriteWarning(result);
            }
        }