Microsoft.WindowsAzure.Management.CloudService.Model.GetDeploymentStatus.WaitForState C# (CSharp) Метод

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
        public void WaitForState(string state, string rootPath, string inServiceName, string inSlot, string subscription)
        {
            string serviceName;
            string slot;

            InitializeArguments(rootPath, inServiceName, inSlot, subscription, out serviceName, out slot);

            do
            {
                // Delay the request for some time
                //
                System.Threading.Thread.Sleep(int.Parse(Resources.StandardRetryDelayInMs));

            } while (GetStatus(serviceName, slot) != state);
        }

Usage Example

Пример #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;
        }
All Usage Examples Of Microsoft.WindowsAzure.Management.CloudService.Model.GetDeploymentStatus::WaitForState