Example #1
0
        private void IsEnvironmentReady(string environmentId)
        {
            var result = _discovery.GetEnvironment(environmentId);

            Console.WriteLine(string.Format("\tEnvironment {0} status is {1}.", environmentId, result.Status));

            if (result.Status == ModelEnvironment.StatusEnum.ACTIVE)
            {
                autoEvent.Set();
            }
            else
            {
                Task.Factory.StartNew(() =>
                {
                    System.Threading.Thread.Sleep(30000);
                    Console.WriteLine("Checking environment status in 30 seconds...");
                    IsEnvironmentReady(environmentId);
                });
            }
        }
        public void GetEnvironment()
        {
            Console.WriteLine(string.Format("\nCalling GetEnvironment()..."));
            var result = _discovery.GetEnvironment(_createdEnvironmentId);

            if (result != null)
            {
                if (result != null)
                {
                    Console.WriteLine(JsonConvert.SerializeObject(result, Formatting.Indented));
                }
                else
                {
                    Console.WriteLine("result is null.");
                }
            }
            else
            {
                Console.WriteLine("result is null.");
            }
        }
        public void GetEnvironment()
        {
            IamAuthenticator authenticator = new IamAuthenticator(
                apikey: "{apikey}");

            DiscoveryService service = new DiscoveryService("2019-04-30", authenticator);

            service.SetServiceUrl("{serviceUrl}");

            var result = service.GetEnvironment(
                environmentId: "{environmentId}"
                );

            Console.WriteLine(result.Response);
        }
Example #4
0
        public void GetEnvironment()
        {
            IamConfig config = new IamConfig(
                apikey: apikey
                );

            DiscoveryService service = new DiscoveryService(versionDate, config);

            service.SetEndpoint(url);

            var result = service.GetEnvironment(
                environmentId: environmentId
                );

            Console.WriteLine(result.Response);
        }
        public void GetEnvironment()
        {
            TokenOptions tokenOptions = new TokenOptions()
            {
                IamApiKey  = apikey,
                ServiceUrl = url
            };

            DiscoveryService service = new DiscoveryService(tokenOptions, versionDate);

            var result = service.GetEnvironment(
                environmentId: environmentId
                );

            Console.WriteLine(result.Response);
        }