public void CreateEnvironment()
        {
            CreateEnvironmentRequest createEnvironmentRequest = new CreateEnvironmentRequest()
            {
                Name        = _createdEnvironmentName,
                Description = _createdEnvironmentDescription,
                Size        = _createdEnvironmentSize
            };

            Console.WriteLine(string.Format("\nCalling CreateEnvironment()..."));
            var result = _discovery.CreateEnvironment(createEnvironmentRequest);

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

                _createdEnvironmentId = result.EnvironmentId;
            }
            else
            {
                Console.WriteLine("result is null.");
            }
        }
Exemplo n.º 2
0
        public void CreateEnvironment()
        {
            IamConfig config = new IamConfig(
                apikey: apikey
                );

            DiscoveryService service = new DiscoveryService(versionDate, config);

            service.SetEndpoint(url);

            var result = service.CreateEnvironment(
                name: "My environment"
                );

            Console.WriteLine(result.Response);
        }
        public void CreateEnvironment()
        {
            IamAuthenticator authenticator = new IamAuthenticator(
                apikey: "{apikey}");

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

            service.SetServiceUrl("{serviceUrl}");

            var result = service.CreateEnvironment(
                name: "my_environment",
                description: "My environment"
                );

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

            DiscoveryService service = new DiscoveryService(tokenOptions, versionDate);

            var result = service.CreateEnvironment(
                name: "My environment"
                );

            Console.WriteLine(result.Response);
        }
Exemplo n.º 5
0
    private IEnumerator ExampleCreateEnvironment()
    {
        ModelEnvironment createEnvironmentResponse = null;

        service.CreateEnvironment(
            callback: (DetailedResponse <ModelEnvironment> response, IBMError error) =>
        {
            Log.Debug("DiscoveryServiceV1", "CreateEnvironment result: {0}", response.Response);
            createEnvironmentResponse = response.Result;
            // environmentId = createEnvironmentResponse.EnvironmentId;
        },
            name: "my_environment",
            description: "My environment"
            );

        while (createEnvironmentResponse == null)
        {
            yield return(null);
        }
    }