Exemple #1
0
        internal static DeploymentCreateForecastWorker[] GetDeploymentCreateForecastWorkers()
        {
            IConfigurationSource configurationSource = GetConfigurationSource();
            ArrayList            list = new ArrayList();

            foreach (DeploymentCreateConfiguration deploymentCreateConfiguration in configurationSource.GetWindowsAzureDeploymentCreateConfigurations())
            {
                SubscriptionConfiguration subscriptionConfiguration = configurationSource.GetWindowsAzureSubscriptionConfiguration(deploymentCreateConfiguration.SubscriptionConfigurationId);
                PackageConfiguration      packageConfiguration      = configurationSource.GetWindowsAzurePackageConfiguration(deploymentCreateConfiguration.WindowsAzurePackageId);
                foreach (ScheduleDefinitionConfiguration scheduleDefinitionConfiguration in deploymentCreateConfiguration.Schedules)
                {
                    ScheduleDay[] scheduleDays = GetScheduleDaysFromScheduleConfiguration(scheduleDefinitionConfiguration);
                    Uri           packageUrl   = Blob.GetUrl(packageConfiguration.StorageAccountName, packageConfiguration.ContainerName, packageConfiguration.BlobName);
                    DeploymentCreateForecastWorker deploymentCreateForecastWorker = new DeploymentCreateForecastWorker(
                        new Deployment(),
                        new Operation(),
                        subscriptionConfiguration.SubscriptionId,
                        subscriptionConfiguration.CertificateThumbprint,
                        deploymentCreateConfiguration.ServiceName,
                        deploymentCreateConfiguration.DeploymentSlot,
                        scheduleDays,
                        deploymentCreateConfiguration.DeploymentName,
                        packageUrl,
                        deploymentCreateConfiguration.DeploymentLabel,
                        deploymentCreateConfiguration.PackageConfigurationFilePath,
                        deploymentCreateConfiguration.StartDeployment,
                        deploymentCreateConfiguration.TreatWarningsAsError,
                        deploymentCreateConfiguration.PollingIntervalInMinutes);
                    list.Add(deploymentCreateForecastWorker);
                }
            }

            return((DeploymentCreateForecastWorker[])list.ToArray(typeof(DeploymentCreateForecastWorker)));
        }
Exemple #2
0
        internal static ScheduledHorizontalScaleForecastWorker[] GetScheduledHorizontalScaleForecastWorkers()
        {
            IConfigurationSource configurationSource = GetConfigurationSource();
            ArrayList            list = new ArrayList();

            foreach (ScheduledHorizontalScaleConfiguration scheduledHorizontalScaleConfiguration in configurationSource.GetWindowsAzureScheduledHorizontalScaleConfigurations())
            {
                SubscriptionConfiguration subscriptionConfiguration = configurationSource.GetWindowsAzureSubscriptionConfiguration(scheduledHorizontalScaleConfiguration.SubscriptionConfigurationId);
                foreach (ScheduleDefinitionConfiguration scheduleDefinitionConfiguration in scheduledHorizontalScaleConfiguration.Schedules)
                {
                    HorizontalScale[] horizontalScales = GetHorizontalScalesFromHorizontalScaleConfiguration(scheduledHorizontalScaleConfiguration.HorizontalScales.ToArray());
                    ScheduleDay[]     scheduleDays     = GetScheduleDaysFromScheduleConfiguration(scheduleDefinitionConfiguration);
                    ScheduledHorizontalScaleForecastWorker scheduledHorizontalScaleForecastWorker = new ScheduledHorizontalScaleForecastWorker(
                        new Deployment(),
                        new Operation(),
                        subscriptionConfiguration.SubscriptionId,
                        subscriptionConfiguration.CertificateThumbprint,
                        scheduledHorizontalScaleConfiguration.ServiceName,
                        scheduledHorizontalScaleConfiguration.DeploymentSlot,
                        horizontalScales,
                        scheduleDays,
                        scheduledHorizontalScaleConfiguration.TreatWarningsAsError,
                        scheduledHorizontalScaleConfiguration.Mode,
                        scheduledHorizontalScaleConfiguration.PollingIntervalInMinutes);
                    list.Add(scheduledHorizontalScaleForecastWorker);
                }
            }

            return((ScheduledHorizontalScaleForecastWorker[])list.ToArray(typeof(ScheduledHorizontalScaleForecastWorker)));
        }
Exemple #3
0
        internal static DeploymentDeleteForecastWorker[] GetDeploymentDeleteForecastWorkers()
        {
            IConfigurationSource configurationSource = GetConfigurationSource();
            ArrayList            list = new ArrayList();

            foreach (DeploymentDeleteConfiguration deploymentDeleteConfiguration in configurationSource.GetWindowsAzureDeploymentDeleteConfigurations())
            {
                SubscriptionConfiguration subscriptionConfiguration = configurationSource.GetWindowsAzureSubscriptionConfiguration(deploymentDeleteConfiguration.SubscriptionConfigurationId);
                foreach (string deploymentSlot in deploymentDeleteConfiguration.DeploymentSlots)
                {
                    foreach (ScheduleDefinitionConfiguration scheduleDefinitionConfiguration in deploymentDeleteConfiguration.Schedules)
                    {
                        ScheduleDay[] scheduleDays = GetScheduleDaysFromScheduleConfiguration(scheduleDefinitionConfiguration);
                        DeploymentDeleteForecastWorker deploymentDeleteForecastWorker = new DeploymentDeleteForecastWorker(
                            new Deployment(),
                            new Operation(),
                            subscriptionConfiguration.SubscriptionId,
                            subscriptionConfiguration.CertificateThumbprint,
                            deploymentDeleteConfiguration.ServiceName,
                            deploymentSlot,
                            scheduleDays,
                            deploymentDeleteConfiguration.PollingIntervalInMinutes);
                        list.Add(deploymentDeleteForecastWorker);
                    }
                }
            }

            return((DeploymentDeleteForecastWorker[])list.ToArray(typeof(DeploymentDeleteForecastWorker)));
        }