Ejemplo n.º 1
0
        public void DeleteEnvironment()
        {
            Console.WriteLine(string.Format("\nCalling DeleteEnvironment()..."));

            if (string.IsNullOrEmpty(_createdEnvironmentId))
            {
                Assert.Fail("_createdEnvironmentId is null");
            }

            var result = _discovery.DeleteEnvironment(_createdEnvironmentId);

            if (result != null)
            {
                if (result != null)
                {
                    Console.WriteLine(JsonConvert.SerializeObject(result, Formatting.Indented));
                    _createdEnvironmentId = null;
                }
                else
                {
                    Console.WriteLine("result is null.");
                }
            }
            else
            {
                Console.WriteLine("result is null.");
            }

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Status == DeleteEnvironmentResponse.StatusEnum.DELETED);
        }
        public void DeleteEnvironment()
        {
            Console.WriteLine(string.Format("\nCalling DeleteEnvironment()..."));
            var result = _discovery.DeleteEnvironment(_createdEnvironmentId);

            if (result != null)
            {
                if (result != null)
                {
                    Console.WriteLine(JsonConvert.SerializeObject(result, Formatting.Indented));
                }
                else
                {
                    Console.WriteLine("result is null.");
                }

                _createdEnvironmentId = null;
            }
            else
            {
                Console.WriteLine("result is null.");
            }
        }
        public void DeleteEnvironment()
        {
            IamAuthenticator authenticator = new IamAuthenticator(
                apikey: "{apikey}");

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

            service.SetServiceUrl("{serviceUrl}");

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

            Console.WriteLine(result.Response);
        }
Ejemplo n.º 4
0
        public void DeleteEnvironment()
        {
            IamConfig config = new IamConfig(
                apikey: apikey
                );

            DiscoveryService service = new DiscoveryService(versionDate, config);

            service.SetEndpoint(url);

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

            Console.WriteLine(result.Response);
        }
Ejemplo n.º 5
0
        public void DeleteEnvironment()
        {
            TokenOptions tokenOptions = new TokenOptions()
            {
                IamApiKey  = apikey,
                ServiceUrl = url
            };

            DiscoveryService service = new DiscoveryService(tokenOptions, versionDate);

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

            Console.WriteLine(result.Response);
        }
Ejemplo n.º 6
0
        public static void TearDown()
        {
            var environmentVariable =
                Environment.GetEnvironmentVariable("VCAP_SERVICES");

            var fileContent =
                File.ReadAllText(environmentVariable);

            var vcapServices =
                JObject.Parse(fileContent);

            string _endpoint = vcapServices["discovery"][0]["credentials"]["url"].Value <string>();
            string _username = vcapServices["discovery"][0]["credentials"]["username"].Value <string>();
            string _password = vcapServices["discovery"][0]["credentials"]["password"].Value <string>();

            DiscoveryService _discovery = new DiscoveryService(_username, _password, DiscoveryService.DISCOVERY_VERSION_DATE_2016_12_01);

            if (!string.IsNullOrEmpty(_createdEnvironmentId) && !string.IsNullOrEmpty(_createdCollectionId) && !string.IsNullOrEmpty(_createdDocumentId))
            {
                _discovery.DeleteDocument(_createdEnvironmentId, _createdCollectionId, _createdDocumentId);
            }

            if (!string.IsNullOrEmpty(_createdEnvironmentId) && !string.IsNullOrEmpty(_createdCollectionId))
            {
                _discovery.DeleteCollection(_createdEnvironmentId, _createdCollectionId);
            }

            if (!string.IsNullOrEmpty(_createdEnvironmentId) && !string.IsNullOrEmpty(_createdConfigurationId))
            {
                _discovery.DeleteConfiguration(_createdEnvironmentId, _createdConfigurationId);
            }

            if (!string.IsNullOrEmpty(_createdEnvironmentId))
            {
                _discovery.DeleteEnvironment(_createdEnvironmentId);
            }
        }