Package io.fathom.auto.openstack.metadata

Examples of io.fathom.auto.openstack.metadata.MetadataClient


    Metadata metadata;

    public Metadata getMetadata() throws RestClientException {
        if (metadata == null) {
            MetadataClient metadataClient = MetadataClient.INSTANCE;
            Metadata metadata = metadataClient.getMetadata();
            this.metadata = metadata;
        }
        return metadata;
    }
View Full Code Here


    OpenstackClient client;

    public OpenstackClient getOpenstackClient() throws RestClientException {
        if (client == null) {
            MetadataClient metadataClient = MetadataClient.INSTANCE;

            String serviceToken = metadataClient.getSecretString("token");
            serviceToken = serviceToken.trim();
            Metadata metadata = getMetadata();

            URI identityEndpoint = URI.create(metadata.getTopLevel("identity_uri"));

            HttpClient httpClient = metadataClient.getHttpClient();
            OpenstackIdentityClient identityClient = new OpenstackIdentityClient(httpClient, identityEndpoint, null);

            StaticTokenProvider tokenProvider = new StaticTokenProvider(identityClient, serviceToken);

            this.client = OpenstackClient.build(tokenProvider);
View Full Code Here

TOP

Related Classes of io.fathom.auto.openstack.metadata.MetadataClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.