public async Task <bool> Run()
        {
            Console.Write("Application name: ");
            var promptedApp = Console.ReadLine();

            Console.WriteLine($"Environments for application {promptedApp}: ");
            var apps = await _client.ListApplicationsAsync(new ListApplicationsRequest());

            var app = apps.Items.FirstOrDefault(x => x.Name == promptedApp);

            if (app == null)
            {
                Console.WriteLine($"Can't find application with name [{promptedApp}]");
                return(false);
            }

            var envs = await _client.ListEnvironmentsAsync(new ListEnvironmentsRequest
            {
                ApplicationId = app.Id
            });

            foreach (var env in envs.Items)
            {
                Console.WriteLine(env.Name);
            }

            return(false);
        }
        public async Task <bool> Run()
        {
            var apps = await _client.ListApplicationsAsync(new ListApplicationsRequest());

            Console.WriteLine(string.Join(";", apps.Items.Select(x => x.Name)));

            return(false);
        }
Пример #3
0
        public async Task <Application> AskApplication()
        {
            var apps = await _client.ListApplicationsAsync(new ListApplicationsRequest());

            Console.Write($"Application name (available, {string.Join(";", apps.Items.Select(x => $"[{x.Name}]"))}): ");
            var promptedApp = Console.ReadLine();
            var app         = apps.Items.FirstOrDefault(x => x.Name == promptedApp);

            if (app == null)
            {
                throw new Exception($"Can't find application with name [{promptedApp}]");
            }

            return(app);
        }
        public async Task <Application> Get(string appName)
        {
            var apps = await _client.ListApplicationsAsync(new ListApplicationsRequest());

            return(apps.Items.FirstOrDefault(x => x.Name == appName));
        }