Пример #1
0
        public EnvironmentConfigurationModel(RenderingEnvironment environment, StartTaskProvider startTaskProvider, string environmentEndpoint = null)
        {
            if (environment != null)
            {
                EnvironmentName = environment.Name;

                if (environment.AutoScaleConfiguration != null)
                {
                    MaxIdleCpuPercent = environment.AutoScaleConfiguration.MaxIdleCpuPercent;
                    MaxIdleGpuPercent = environment.AutoScaleConfiguration.MaxIdleGpuPercent;

                    if (environment.AutoScaleConfiguration.SpecificProcesses != null)
                    {
                        SpecificProcesses = string.Join(',', environment.AutoScaleConfiguration.SpecificProcesses);
                    }

                    ScaleEndpointEnabled = environment.AutoScaleConfiguration.ScaleEndpointEnabled;
                    PrimaryApiKey        = environment.AutoScaleConfiguration.PrimaryApiKey;
                    SecondaryApiKey      = environment.AutoScaleConfiguration.SecondaryApiKey;
                }
            }

            WindowsBootstrapScript = startTaskProvider.GetWindowsStartTaskUrl(environment);
            LinuxBootstrapScript   = startTaskProvider.GetLinuxStartTaskUrl(environment);
            EnvironmentEndpoint    = environmentEndpoint;
        }
 public PoolsController(
     IPoolCoordinator poolCoordinator,
     IVMSizes vmSizes,
     IEnvironmentCoordinator environmentCoordinator,
     IPackageCoordinator packageCoordinator,
     IAssetRepoCoordinator assetRepoCoordinator,
     IPoolUsageProvider poolUsageProvider,
     StartTaskProvider startTaskProvider) : base(environmentCoordinator, packageCoordinator, assetRepoCoordinator)
 {
     _poolCoordinator        = poolCoordinator;
     _vmSizes                = vmSizes;
     _environmentCoordinator = environmentCoordinator;
     _packageCoordinator     = packageCoordinator;
     _poolUsageProvider      = poolUsageProvider;
     _startTaskProvider      = startTaskProvider;
 }