Beispiel #1
0
        public async Task <IActionResult> Test()
        {
            var viewModel = new TestAzureResourcesViewModel();

            viewModel.AzureRegions = await AzureRegionsSelectList();

            viewModel.Credentials = await AzureCredentialsSelectList();

            viewModel.DockerImages = await DockerApplicationImagesSelectList();

            return(View(viewModel));
        }
Beispiel #2
0
        public async Task <IActionResult> Test([FromForm] TestAzureResourcesViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(viewModel));
            }

            var ipAddress = await _mediatr.Send(new AzureTestCreateResourcesCommand(viewModel.ResourceName, viewModel.AzureRegion, viewModel.DeploymentJson, viewModel.ParametersJson, viewModel.CredentialsId, viewModel.DockerImage));

            ViewData["IPAddress"] = ipAddress;
            viewModel.IpAddress   = ipAddress;

            return(View(viewModel));
        }
        public async Task <IActionResult> Test(TestAzureResourcesViewModel viewModel)
        {
            var ipAddress = await _mediatr.Send(new AzureTestCreateResourcesCommand(viewModel.ResourceName, viewModel.AzureRegion, viewModel.DeploymentJson, viewModel.ParametersJson, viewModel.CredentialsId, viewModel.DockerImage));

            return(Ok(ipAddress));
        }