Ejemplo n.º 1
0
        /// <summary>
        /// Загружает входные параметры для vm в s3 хранилище
        /// </summary>
        /// <returns></returns>
        private async Task UploadInputParamsAsync()
        {
            foreach (var viewModel in Instances)
            {
                if (viewModel.Ec2Instance.LaunchTime != null)
                {
                    continue;
                }

                await AlgoStorageService.UploadInputParamsAsync(viewModel.Ec2Instance);
            }
        }
Ejemplo n.º 2
0
        public Ec2InstancesViewModel(InstancesStore instancesStore, InstancesService instancesService,
                                     AlgoStorageService algoStorageService, InstancesWatcher instancesWatcher)
        {
            Instances = new ObservableCollection <Ec2InstanceViewModel>();

            NavigateToCreateInstancesCommand = new Command(NavigateToCreateInstances);
            StartInstancesCommand            = new Command(StartInstances);

            InstancesStore     = instancesStore;
            InstancesService   = instancesService;
            AlgoStorageService = algoStorageService;
            InstancesWatcher   = instancesWatcher;
        }
Ejemplo n.º 3
0
        public Ec2InstancesView()
        {
            InitializeComponent();

            string regionName         = ConfigurationManager.AppSettings["RegionEndpoint"];
            string algoStorageName    = ConfigurationManager.AppSettings["AlgoStorage"];
            var    algoStorageService = new AlgoStorageService(RegionEndpoint.GetBySystemName(regionName), algoStorageName);

            DataContext = new Ec2InstancesViewModel(
                InstancesStore.Instance,
                new InstancesService(RegionEndpoint.GetBySystemName(regionName)),
                algoStorageService,
                new InstancesWatcher(algoStorageService));
        }