mirror of https://github.com/apache/jclouds.git
Issue 1037: consolidate keystone endpoints to end with /v2.0/ + change hpcloud to default to user/pass auth
This commit is contained in:
parent
ba56e2dce4
commit
735da0a285
|
@ -35,7 +35,7 @@
|
|||
|
||||
<properties>
|
||||
<!-- keystone endpoint -->
|
||||
<test.openstack-keystone.endpoint>http://localhost:5000</test.openstack-keystone.endpoint>
|
||||
<test.openstack-keystone.endpoint>http://localhost:5000/v${jclouds.api-version}/</test.openstack-keystone.endpoint>
|
||||
<!-- keystone version -->
|
||||
<test.openstack-keystone.api-version>2.0</test.openstack-keystone.api-version>
|
||||
<test.openstack-keystone.build-version></test.openstack-keystone.build-version>
|
||||
|
|
|
@ -43,7 +43,6 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
* />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Path("/v2.0")
|
||||
public interface AuthenticationAsyncApi {
|
||||
|
||||
/**
|
||||
|
@ -76,8 +75,6 @@ public interface AuthenticationAsyncApi {
|
|||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Path("/tokens")
|
||||
@MapBinder(BindAuthToJsonPayload.class)
|
||||
// TODO: is tenantName permanent? or should we switch to tenantId at some point. seems most tools
|
||||
// still use tenantName
|
||||
ListenableFuture<Access> authenticateWithTenantNameAndCredentials(@Nullable @PayloadParam("tenantName") String tenantName,
|
||||
ApiAccessKeyCredentials apiAccessKeyCredentials);
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ import org.jclouds.apis.ApiMetadata;
|
|||
import org.jclouds.openstack.keystone.v2_0.config.CredentialTypes;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneParserModule;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneRestClientModule;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneRestClientModule.KeystoneAdminURLModule;
|
||||
import org.jclouds.openstack.v2_0.ServiceType;
|
||||
|
@ -69,10 +68,8 @@ public class KeystoneApiMetadata extends BaseRestApiMetadata {
|
|||
|
||||
public static Properties defaultProperties() {
|
||||
Properties properties = BaseRestApiMetadata.defaultProperties();
|
||||
// TODO: this doesn't actually do anything yet.
|
||||
properties.setProperty(KeystoneProperties.VERSION, "2.0");
|
||||
properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS);
|
||||
properties.put(SERVICE_TYPE, ServiceType.IDENTITY);
|
||||
properties.setProperty(SERVICE_TYPE, ServiceType.IDENTITY);
|
||||
return properties;
|
||||
}
|
||||
|
||||
|
@ -82,11 +79,12 @@ public class KeystoneApiMetadata extends BaseRestApiMetadata {
|
|||
super(api, asyncApi);
|
||||
id("openstack-keystone")
|
||||
.name("OpenStack Keystone Essex+ API")
|
||||
.identityName("tenantId:user")
|
||||
.credentialName("password")
|
||||
.identityName("${tenantName}:${userName} or ${userName}, if your keystone supports a default tenant")
|
||||
.credentialName("${password}")
|
||||
.endpointName("KeyStone base url ending in /v${jclouds.api-version}/")
|
||||
.documentation(URI.create("http://api.openstack.org/"))
|
||||
.version("2.0")
|
||||
.defaultEndpoint("http://localhost:5000")
|
||||
.defaultEndpoint("http://localhost:5000/v${jclouds.api-version}/")
|
||||
.defaultProperties(KeystoneApiMetadata.defaultProperties())
|
||||
.defaultModules(ImmutableSet.<Class<? extends Module>>builder()
|
||||
.add(KeystoneAuthenticationModule.class)
|
||||
|
|
|
@ -20,10 +20,8 @@ package org.jclouds.openstack.keystone.v2_0;
|
|||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
import org.jclouds.Constants;
|
||||
import org.jclouds.openstack.keystone.v2_0.domain.ApiMetadata;
|
||||
import org.jclouds.openstack.keystone.v2_0.features.ServiceAsyncApi;
|
||||
import org.jclouds.openstack.keystone.v2_0.features.TenantAsyncApi;
|
||||
|
@ -53,7 +51,6 @@ public interface KeystoneAsyncApi {
|
|||
@GET
|
||||
@SelectJson("version")
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@Path("/v{" + Constants.PROPERTY_API_VERSION + "}/")
|
||||
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
|
||||
ListenableFuture<ApiMetadata> getApiMetadata();
|
||||
|
||||
|
|
|
@ -60,11 +60,6 @@ public interface KeystoneProperties {
|
|||
*/
|
||||
public static final String REQUIRES_TENANT = "jclouds.keystone.requires-tenant";
|
||||
|
||||
/**
|
||||
* version of the keystone service
|
||||
*/
|
||||
public static final String VERSION = "jclouds.keystone.version";
|
||||
|
||||
/**
|
||||
* type of the keystone service. ex. {@code compute}
|
||||
*
|
||||
|
|
|
@ -22,24 +22,25 @@ import static org.jclouds.util.Suppliers2.getLastValueInMap;
|
|||
|
||||
import java.net.URI;
|
||||
import java.util.Map;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import org.jclouds.http.HttpErrorHandler;
|
||||
import org.jclouds.http.annotation.ClientError;
|
||||
import org.jclouds.http.annotation.Redirection;
|
||||
import org.jclouds.http.annotation.ServerError;
|
||||
import org.jclouds.openstack.keystone.v2_0.KeystoneAsyncApi;
|
||||
import org.jclouds.location.Provider;
|
||||
import org.jclouds.openstack.keystone.v2_0.KeystoneApi;
|
||||
import org.jclouds.openstack.keystone.v2_0.features.ServiceAsyncApi;
|
||||
import org.jclouds.openstack.keystone.v2_0.KeystoneAsyncApi;
|
||||
import org.jclouds.openstack.keystone.v2_0.features.ServiceApi;
|
||||
import org.jclouds.openstack.keystone.v2_0.features.TenantAsyncApi;
|
||||
import org.jclouds.openstack.keystone.v2_0.features.ServiceAsyncApi;
|
||||
import org.jclouds.openstack.keystone.v2_0.features.TenantApi;
|
||||
import org.jclouds.openstack.keystone.v2_0.features.TokenAsyncApi;
|
||||
import org.jclouds.openstack.keystone.v2_0.features.TenantAsyncApi;
|
||||
import org.jclouds.openstack.keystone.v2_0.features.TokenApi;
|
||||
import org.jclouds.openstack.keystone.v2_0.features.UserAsyncApi;
|
||||
import org.jclouds.openstack.keystone.v2_0.features.TokenAsyncApi;
|
||||
import org.jclouds.openstack.keystone.v2_0.features.UserApi;
|
||||
import org.jclouds.openstack.keystone.v2_0.features.UserAsyncApi;
|
||||
import org.jclouds.openstack.keystone.v2_0.functions.PresentWhenAdminURLExistsForIdentityService;
|
||||
import org.jclouds.openstack.keystone.v2_0.handlers.KeystoneErrorHandler;
|
||||
import org.jclouds.openstack.keystone.v2_0.suppliers.RegionIdToAdminURIFromAccessForTypeAndVersion;
|
||||
|
@ -47,8 +48,10 @@ import org.jclouds.openstack.keystone.v2_0.suppliers.RegionIdToAdminURISupplier;
|
|||
import org.jclouds.openstack.v2_0.ServiceType;
|
||||
import org.jclouds.openstack.v2_0.services.Identity;
|
||||
import org.jclouds.rest.ConfiguresRestClient;
|
||||
import org.jclouds.rest.annotations.ApiVersion;
|
||||
import org.jclouds.rest.config.RestClientModule;
|
||||
import org.jclouds.rest.functions.ImplicitOptionalConverter;
|
||||
import org.jclouds.util.Suppliers2;
|
||||
|
||||
import com.google.common.base.Supplier;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
@ -90,13 +93,22 @@ public class KeystoneRestClientModule<S extends KeystoneApi, A extends KeystoneA
|
|||
RegionIdToAdminURIFromAccessForTypeAndVersion.class).build(RegionIdToAdminURISupplier.Factory.class));
|
||||
}
|
||||
|
||||
// return any identity url.
|
||||
/**
|
||||
* in some cases, there is no {@link ServiceType#IDENTITY} entry in the service catalog. In
|
||||
* other cases, there's no adminURL entry present. Fallback to the provider in this case.
|
||||
*/
|
||||
@Provides
|
||||
@Singleton
|
||||
@Identity
|
||||
protected Supplier<URI> provideStorageUrl(RegionIdToAdminURISupplier.Factory factory,
|
||||
@Named(KeystoneProperties.VERSION) String version) {
|
||||
return getLastValueInMap(factory.createForApiTypeAndVersion(ServiceType.IDENTITY, version));
|
||||
protected Supplier<URI> provideStorageUrl(final RegionIdToAdminURISupplier.Factory factory,
|
||||
@ApiVersion final String version, @Provider final Supplier<URI> providerURI) {
|
||||
Supplier<URI> identityServiceForVersion = getLastValueInMap(factory.createForApiTypeAndVersion(
|
||||
ServiceType.IDENTITY, version));
|
||||
Supplier<URI> whenIdentityServiceIsntListedFallbackToProviderURI = Suppliers2.onThrowable(
|
||||
identityServiceForVersion, NoSuchElementException.class, providerURI);
|
||||
Supplier<URI> whenIdentityServiceHasNoAdminURLFallbackToProviderURI = Suppliers2.or(
|
||||
whenIdentityServiceIsntListedFallbackToProviderURI, providerURI);
|
||||
return whenIdentityServiceHasNoAdminURLFallbackToProviderURI;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ import javax.ws.rs.GET;
|
|||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
import org.jclouds.Constants;
|
||||
import org.jclouds.openstack.keystone.v2_0.domain.Tenant;
|
||||
import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
|
||||
import org.jclouds.rest.annotations.ExceptionParser;
|
||||
|
@ -46,7 +45,6 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
* />
|
||||
* @author Adam Lowe
|
||||
*/
|
||||
@Path("/v{" + Constants.PROPERTY_API_VERSION + "}")
|
||||
@SkipEncoding( { '/', '=' })
|
||||
public interface ServiceAsyncApi {
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.jclouds.openstack.keystone.v2_0.suppliers;
|
|||
|
||||
import java.net.URI;
|
||||
import java.util.Map;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
import org.jclouds.javax.annotation.Nullable;
|
||||
|
||||
|
@ -18,13 +19,14 @@ public interface RegionIdToAdminURISupplier extends Supplier<Map<String, Supplie
|
|||
/**
|
||||
*
|
||||
* @param apiType
|
||||
* type of the api, according to the provider. ex. {@code compute} {@code
|
||||
* object-store}
|
||||
* type of the api, according to the provider. ex. {@code compute}
|
||||
* {@code object-store}
|
||||
* @param apiVersion
|
||||
* version of the api, or null
|
||||
* @return regions mapped to default uri
|
||||
* @throws NoSuchElementException if the {@code apiType} is not present in the catalog
|
||||
*/
|
||||
RegionIdToAdminURISupplier createForApiTypeAndVersion(@Assisted("apiType") String apiType,
|
||||
@Nullable @Assisted("apiVersion") String apiVersion);
|
||||
@Nullable @Assisted("apiVersion") String apiVersion) throws NoSuchElementException;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public class TokenApiLiveTest extends BaseKeystoneApiLiveTest {
|
|||
@BeforeMethod
|
||||
public void grabToken() {
|
||||
AuthenticateRequest ar = keystoneContext.getUtils().getInjector().getInstance(AuthenticateRequest.class);
|
||||
HttpRequest test = ar.filter(HttpRequest.builder().method("GET").endpoint(endpoint).build());
|
||||
HttpRequest test = ar.filter(HttpRequest.builder().method("GET").endpoint(context.getProviderMetadata().getEndpoint()).build());
|
||||
token = Iterables.getOnlyElement(test.getHeaders().get("X-Auth-Token"));
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
<properties>
|
||||
<!-- keystone endpoint -->
|
||||
<test.openstack-nova.endpoint>http://localhost:5000</test.openstack-nova.endpoint>
|
||||
<test.openstack-nova.endpoint>http://localhost:5000/v2.0/</test.openstack-nova.endpoint>
|
||||
<!-- keystone version -->
|
||||
<test.openstack-nova.api-version>1.1</test.openstack-nova.api-version>
|
||||
<test.openstack-nova.build-version></test.openstack-nova.build-version>
|
||||
|
|
|
@ -20,7 +20,6 @@ package org.jclouds.openstack.nova.v2_0;
|
|||
|
||||
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE;
|
||||
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.SERVICE_TYPE;
|
||||
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.VERSION;
|
||||
import static org.jclouds.openstack.nova.v2_0.config.NovaProperties.AUTO_ALLOCATE_FLOATING_IPS;
|
||||
import static org.jclouds.openstack.nova.v2_0.config.NovaProperties.AUTO_GENERATE_KEYPAIRS;
|
||||
import static org.jclouds.openstack.nova.v2_0.config.NovaProperties.TIMEOUT_SECURITYGROUP_PRESENT;
|
||||
|
@ -79,9 +78,6 @@ public class NovaApiMetadata extends BaseRestApiMetadata {
|
|||
properties.setProperty(SERVICE_TYPE, ServiceType.COMPUTE);
|
||||
properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS);
|
||||
|
||||
// TODO: this doesn't actually do anything yet.
|
||||
properties.setProperty(VERSION, "2.0");
|
||||
|
||||
properties.setProperty(AUTO_ALLOCATE_FLOATING_IPS, "false");
|
||||
properties.setProperty(AUTO_GENERATE_KEYPAIRS, "false");
|
||||
properties.setProperty(TIMEOUT_SECURITYGROUP_PRESENT, "500");
|
||||
|
@ -94,11 +90,12 @@ public class NovaApiMetadata extends BaseRestApiMetadata {
|
|||
super(NovaApi.class, NovaAsyncApi.class);
|
||||
id("openstack-nova")
|
||||
.name("OpenStack Nova Diablo+ API")
|
||||
.identityName("tenantName:user or user")
|
||||
.credentialName("password")
|
||||
.identityName("${tenantName}:${userName} or ${userName}, if your keystone supports a default tenant")
|
||||
.credentialName("${password}")
|
||||
.endpointName("KeyStone base url ending in /v2.0/")
|
||||
.documentation(URI.create("http://api.openstack.org/"))
|
||||
.version("1.1")
|
||||
.defaultEndpoint("http://localhost:5000")
|
||||
.defaultEndpoint("http://localhost:5000/v2.0/")
|
||||
.defaultProperties(NovaApiMetadata.defaultProperties())
|
||||
.view(TypeToken.of(ComputeServiceContext.class))
|
||||
.defaultModules(ImmutableSet.<Class<? extends Module>>builder()
|
||||
|
|
|
@ -35,11 +35,11 @@
|
|||
|
||||
<properties>
|
||||
<!-- keystone endpoint -->
|
||||
<test.rackspace-cloudidentity.endpoint>https://identity.api.rackspacecloud.com</test.rackspace-cloudidentity.endpoint>
|
||||
<test.rackspace-cloudidentity.endpoint>https://identity.api.rackspacecloud.com/v${jclouds.api-version}/</test.rackspace-cloudidentity.endpoint>
|
||||
<!-- keystone version -->
|
||||
<test.rackspace-cloudidentity.api-version>2.0</test.rackspace-cloudidentity.api-version>
|
||||
<test.rackspace-cloudidentity.build-version></test.rackspace-cloudidentity.build-version>
|
||||
<test.rackspace-cloudidentity.identity>413274:${test.rackspace-us.identity}</test.rackspace-cloudidentity.identity>
|
||||
<test.rackspace-cloudidentity.identity>${test.rackspace-us.identity}</test.rackspace-cloudidentity.identity>
|
||||
<test.rackspace-cloudidentity.credential>${test.rackspace-us.credential}</test.rackspace-cloudidentity.credential>
|
||||
<test.jclouds.keystone.credential-type>RAX-KSKEY:apiKeyCredentials</test.jclouds.keystone.credential-type>
|
||||
|
||||
|
|
|
@ -25,9 +25,9 @@ import java.net.URI;
|
|||
import java.util.Properties;
|
||||
|
||||
import org.jclouds.apis.ApiMetadata;
|
||||
import org.jclouds.openstack.keystone.v2_0.KeystoneApi;
|
||||
import org.jclouds.openstack.keystone.v2_0.KeystoneApiMetadata;
|
||||
import org.jclouds.openstack.keystone.v2_0.KeystoneAsyncApi;
|
||||
import org.jclouds.openstack.keystone.v2_0.KeystoneApi;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneParserModule;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneRestClientModule;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneRestClientModule.KeystoneAdminURLModule;
|
||||
|
@ -73,7 +73,6 @@ public class CloudIdentityApiMetadata extends KeystoneApiMetadata {
|
|||
public static Properties defaultProperties() {
|
||||
Properties properties = KeystoneApiMetadata.defaultProperties();
|
||||
properties.setProperty(CREDENTIAL_TYPE, CloudIdentityCredentialTypes.API_KEY_CREDENTIALS);
|
||||
|
||||
return properties;
|
||||
}
|
||||
|
||||
|
@ -82,9 +81,10 @@ public class CloudIdentityApiMetadata extends KeystoneApiMetadata {
|
|||
super(KeystoneApi.class, KeystoneAsyncApi.class);
|
||||
id("rackspace-cloudidentity")
|
||||
.name("Rackspace Cloud Identity Service")
|
||||
.defaultEndpoint("https://identity.api.rackspacecloud.com")
|
||||
.identityName("username")
|
||||
.credentialName("API Key")
|
||||
.identityName("${userName}")
|
||||
.credentialName("${apiKey}")
|
||||
.defaultEndpoint("https://identity.api.rackspacecloud.com/v${jclouds.api-version}/")
|
||||
.endpointName("identity service url ending in /v${jclouds.api-version}/")
|
||||
.defaultProperties(CloudIdentityApiMetadata.defaultProperties())
|
||||
.context(CONTEXT_TOKEN)
|
||||
.documentation(URI.create("http://docs.rackspace.com/auth/api/v2.0/auth-api-devguide/"))
|
||||
|
|
|
@ -43,7 +43,6 @@ import com.google.common.util.concurrent.ListenableFuture;
|
|||
* />
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Path("/v2.0")
|
||||
public interface CloudIdentityAuthenticationAsyncApi extends AuthenticationAsyncApi {
|
||||
|
||||
/**
|
||||
|
|
|
@ -27,7 +27,6 @@ import java.util.Properties;
|
|||
import org.jclouds.apis.ApiMetadata;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.CredentialTypes;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties;
|
||||
import org.jclouds.openstack.services.ServiceType;
|
||||
import org.jclouds.openstack.swift.blobstore.config.SwiftBlobStoreContextModule;
|
||||
import org.jclouds.openstack.swift.config.SwiftKeystoneRestClientModule;
|
||||
|
@ -72,22 +71,24 @@ public class SwiftKeystoneApiMetadata extends SwiftApiMetadata {
|
|||
public static Properties defaultProperties() {
|
||||
Properties properties = SwiftApiMetadata.defaultProperties();
|
||||
properties.setProperty(SERVICE_TYPE, ServiceType.OBJECT_STORE);
|
||||
// TODO: this doesn't actually do anything yet.
|
||||
properties.setProperty(KeystoneProperties.VERSION, "2.0");
|
||||
properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.API_ACCESS_KEY_CREDENTIALS);
|
||||
properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS);
|
||||
properties.remove(PROPERTY_REGIONS);
|
||||
return properties;
|
||||
}
|
||||
|
||||
public static class Builder extends SwiftApiMetadata.Builder {
|
||||
protected Builder() {
|
||||
super(SwiftKeystoneClient.class, SwiftKeystoneAsyncClient.class);
|
||||
this(SwiftKeystoneClient.class, SwiftKeystoneAsyncClient.class);
|
||||
}
|
||||
|
||||
protected Builder(Class<?> syncClient, Class<?> asyncClient) {
|
||||
super(syncClient, asyncClient);
|
||||
id("swift-keystone")
|
||||
.name("OpenStack Swift with Keystone authentication")
|
||||
.identityName("tenantName:user or user")
|
||||
.credentialName("password")
|
||||
.defaultEndpoint("http://localhost:5000")
|
||||
.endpointName("keystone url")
|
||||
.identityName("${tenantName}:${userName} or ${userName}, if your keystone supports a default tenant")
|
||||
.credentialName("${password}")
|
||||
.endpointName("KeyStone base url ending in /v2.0/")
|
||||
.defaultEndpoint("http://localhost:5000/v2.0/")
|
||||
.context(CONTEXT_TOKEN)
|
||||
.defaultProperties(SwiftKeystoneApiMetadata.defaultProperties())
|
||||
.defaultModules(ImmutableSet.<Class<? extends Module>>of(KeystoneStorageEndpointModule.class, KeystoneAuthenticationModule.RegionModule.class,
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
<properties>
|
||||
<!-- keystone endpoint -->
|
||||
<test.openstack-glance.endpoint>http://localhost:5000</test.openstack-glance.endpoint>
|
||||
<test.openstack-glance.endpoint>http://localhost:5000/v2.0/</test.openstack-glance.endpoint>
|
||||
<!-- keystone version -->
|
||||
<test.openstack-glance.api-version>1.0</test.openstack-glance.api-version>
|
||||
<test.openstack-glance.build-version></test.openstack-glance.build-version>
|
||||
|
|
|
@ -29,7 +29,6 @@ import org.jclouds.openstack.glance.v1_0.config.GlanceRestClientModule;
|
|||
import org.jclouds.openstack.keystone.v2_0.config.CredentialTypes;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.RegionModule;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties;
|
||||
import org.jclouds.openstack.v2_0.ServiceType;
|
||||
import org.jclouds.rest.RestContext;
|
||||
import org.jclouds.rest.internal.BaseRestApiMetadata;
|
||||
|
@ -69,9 +68,6 @@ public class GlanceApiMetadata extends BaseRestApiMetadata {
|
|||
Properties properties = BaseRestApiMetadata.defaultProperties();
|
||||
properties.setProperty(SERVICE_TYPE, ServiceType.IMAGE);
|
||||
properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS);
|
||||
|
||||
// TODO: this doesn't actually do anything yet.
|
||||
properties.setProperty(KeystoneProperties.VERSION, "2.0");
|
||||
return properties;
|
||||
}
|
||||
|
||||
|
@ -81,11 +77,12 @@ public class GlanceApiMetadata extends BaseRestApiMetadata {
|
|||
super(GlanceApi.class, GlanceAsyncApi.class);
|
||||
id("openstack-glance")
|
||||
.name("OpenStack Glance API")
|
||||
.identityName("tenantName:user or user")
|
||||
.credentialName("password")
|
||||
.identityName("${tenantName}:${userName} or ${userName}, if your keystone supports a default tenant")
|
||||
.credentialName("${password}")
|
||||
.endpointName("KeyStone base url ending in /v2.0/")
|
||||
.documentation(URI.create("http://glance.openstack.org/glanceapi.html"))
|
||||
.version("1.0")
|
||||
.defaultEndpoint("http://localhost:5000")
|
||||
.defaultEndpoint("http://localhost:5000/v2.0/")
|
||||
.defaultProperties(GlanceApiMetadata.defaultProperties())
|
||||
.defaultModules(ImmutableSet.<Class<? extends Module>>builder()
|
||||
.add(KeystoneAuthenticationModule.class)
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
<properties>
|
||||
<!-- keystone endpoint -->
|
||||
<test.openstack-quantum.endpoint>http://localhost:5000</test.openstack-quantum.endpoint>
|
||||
<test.openstack-quantum.endpoint>http://localhost:5000/v2.0/</test.openstack-quantum.endpoint>
|
||||
<!-- keystone version -->
|
||||
<test.openstack-quantum.api-version>1.0</test.openstack-quantum.api-version>
|
||||
<test.openstack-quantum.build-version></test.openstack-quantum.build-version>
|
||||
|
|
|
@ -28,7 +28,6 @@ import org.jclouds.apis.ApiMetadata;
|
|||
import org.jclouds.openstack.keystone.v2_0.config.CredentialTypes;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.RegionModule;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties;
|
||||
import org.jclouds.openstack.quantum.v1_0.config.QuantumRestClientModule;
|
||||
import org.jclouds.openstack.v2_0.ServiceType;
|
||||
import org.jclouds.rest.RestContext;
|
||||
|
@ -68,9 +67,6 @@ public class QuantumApiMetadata extends BaseRestApiMetadata {
|
|||
Properties properties = BaseRestApiMetadata.defaultProperties();
|
||||
properties.setProperty(SERVICE_TYPE, ServiceType.NETWORK);
|
||||
properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS);
|
||||
|
||||
// TODO: this doesn't actually do anything yet.
|
||||
properties.setProperty(KeystoneProperties.VERSION, "2.0");
|
||||
return properties;
|
||||
}
|
||||
|
||||
|
@ -80,11 +76,12 @@ public class QuantumApiMetadata extends BaseRestApiMetadata {
|
|||
super(QuantumApi.class, QuantumAsyncApi.class);
|
||||
id("openstack-quantum")
|
||||
.name("OpenStack Quantum API")
|
||||
.identityName("tenantName:user or user")
|
||||
.credentialName("password")
|
||||
.identityName("${tenantName}:${userName} or ${userName}, if your keystone supports a default tenant")
|
||||
.credentialName("${password}")
|
||||
.endpointName("KeyStone base url ending in /v2.0/")
|
||||
.documentation(URI.create("http://docs.openstack.org/api/openstack-network/1.0/content/"))
|
||||
.version("1.0")
|
||||
.defaultEndpoint("http://localhost:5000")
|
||||
.defaultEndpoint("http://localhost:5000/v2.0/")
|
||||
.defaultProperties(QuantumApiMetadata.defaultProperties())
|
||||
.defaultModules(ImmutableSet.<Class<? extends Module>>builder()
|
||||
.add(KeystoneAuthenticationModule.class)
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
<properties>
|
||||
<!-- keystone endpoint -->
|
||||
<test.openstack-swift.endpoint>http://localhost:5000</test.openstack-swift.endpoint>
|
||||
<test.openstack-swift.endpoint>http://localhost:5000/v2.0/</test.openstack-swift.endpoint>
|
||||
<test.openstack-swift.api-version>1.0</test.openstack-swift.api-version>
|
||||
<test.openstack-swift.build-version></test.openstack-swift.build-version>
|
||||
<test.openstack-swift.identity>FIXME_IDENTITY</test.openstack-swift.identity>
|
||||
|
|
|
@ -28,7 +28,6 @@ import org.jclouds.apis.ApiMetadata;
|
|||
import org.jclouds.openstack.keystone.v2_0.config.CredentialTypes;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.RegionModule;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties;
|
||||
import org.jclouds.openstack.swift.v1.config.SwiftRestClientModule;
|
||||
import org.jclouds.openstack.v2_0.ServiceType;
|
||||
import org.jclouds.rest.RestContext;
|
||||
|
@ -69,9 +68,6 @@ public class SwiftApiMetadata extends BaseRestApiMetadata {
|
|||
Properties properties = BaseRestApiMetadata.defaultProperties();
|
||||
properties.setProperty(SERVICE_TYPE, ServiceType.OBJECT_STORE);
|
||||
properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS);
|
||||
|
||||
// TODO: this doesn't actually do anything yet.
|
||||
properties.setProperty(KeystoneProperties.VERSION, "2.0");
|
||||
return properties;
|
||||
}
|
||||
|
||||
|
@ -81,11 +77,12 @@ public class SwiftApiMetadata extends BaseRestApiMetadata {
|
|||
super(SwiftApi.class, SwiftAsyncApi.class);
|
||||
id("openstack-swift")
|
||||
.name("OpenStack Swift Diablo+ API")
|
||||
.identityName("tenantId:user")
|
||||
.credentialName("password")
|
||||
.identityName("${tenantName}:${userName} or ${userName}, if your keystone supports a default tenant")
|
||||
.credentialName("${password}")
|
||||
.documentation(URI.create("http://docs.openstack.org/api/openstack-object-storage/1.0/content/ch_object-storage-dev-overview.html"))
|
||||
.version("1.0")
|
||||
.defaultEndpoint("http://localhost:5000")
|
||||
.endpointName("KeyStone base url ending in /v2.0/")
|
||||
.defaultEndpoint("http://localhost:5000/v2.0/")
|
||||
.defaultProperties(SwiftApiMetadata.defaultProperties())
|
||||
.defaultModules(ImmutableSet.<Class<? extends Module>>builder()
|
||||
.add(KeystoneAuthenticationModule.class)
|
||||
|
|
|
@ -22,13 +22,12 @@ import java.util.Properties;
|
|||
|
||||
import org.jclouds.apis.BaseContextLiveTest;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties;
|
||||
import org.jclouds.openstack.swift.v1.SwiftApi;
|
||||
import org.jclouds.openstack.swift.v1.SwiftApiMetadata;
|
||||
import org.jclouds.openstack.swift.v1.SwiftAsyncApi;
|
||||
import org.jclouds.openstack.swift.v1.SwiftApi;
|
||||
import org.jclouds.rest.RestContext;
|
||||
import org.testng.annotations.AfterGroups;
|
||||
import org.testng.annotations.BeforeGroups;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.common.reflect.TypeToken;
|
||||
|
||||
|
@ -37,7 +36,6 @@ import com.google.common.reflect.TypeToken;
|
|||
*
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "live")
|
||||
public class BaseSwiftApiLiveTest extends BaseContextLiveTest<RestContext<SwiftApi, SwiftAsyncApi>> {
|
||||
|
||||
public BaseSwiftApiLiveTest() {
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<packaging>bundle</packaging>
|
||||
|
||||
<properties>
|
||||
<test.hpcloud-compute.endpoint>https://region-a.geo-1.identity.hpcloudsvc.com:35357</test.hpcloud-compute.endpoint>
|
||||
<test.hpcloud-compute.endpoint>https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/</test.hpcloud-compute.endpoint>
|
||||
<test.hpcloud-compute.api-version>1.1</test.hpcloud-compute.api-version>
|
||||
<test.hpcloud-compute.build-version></test.hpcloud-compute.build-version>
|
||||
<test.hpcloud-compute.identity>FIXME_IDENTITY</test.hpcloud-compute.identity>
|
||||
|
|
|
@ -20,8 +20,6 @@ package org.jclouds.hpcloud.compute;
|
|||
|
||||
import static org.jclouds.compute.config.ComputeServiceProperties.TEMPLATE;
|
||||
import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_TERMINATED;
|
||||
import static org.jclouds.openstack.keystone.v2_0.config.CredentialTypes.API_ACCESS_KEY_CREDENTIALS;
|
||||
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE;
|
||||
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.REQUIRES_TENANT;
|
||||
import static org.jclouds.openstack.nova.v2_0.config.NovaProperties.AUTO_ALLOCATE_FLOATING_IPS;
|
||||
import static org.jclouds.openstack.nova.v2_0.config.NovaProperties.AUTO_GENERATE_KEYPAIRS;
|
||||
|
@ -68,11 +66,10 @@ public class HPCloudComputeProviderMetadata extends BaseProviderMetadata {
|
|||
}
|
||||
|
||||
public static Properties defaultProperties() {
|
||||
Properties properties = new Properties();
|
||||
Properties properties = NovaApiMetadata.defaultProperties();
|
||||
// deallocating ip addresses can take a while
|
||||
properties.setProperty(TIMEOUT_NODE_TERMINATED, 60 * 1000 + "");
|
||||
|
||||
properties.setProperty(CREDENTIAL_TYPE, API_ACCESS_KEY_CREDENTIALS);
|
||||
properties.setProperty(REQUIRES_TENANT, "true");
|
||||
properties.setProperty(AUTO_ALLOCATE_FLOATING_IPS, "true");
|
||||
properties.setProperty(AUTO_GENERATE_KEYPAIRS, "true");
|
||||
|
@ -86,8 +83,8 @@ public class HPCloudComputeProviderMetadata extends BaseProviderMetadata {
|
|||
id("hpcloud-compute")
|
||||
.name("HP Cloud Compute Services")
|
||||
.apiMetadata(new NovaApiMetadata().toBuilder()
|
||||
.identityName("yourTenantName:yourAccessKey")
|
||||
.credentialName("secretKey")
|
||||
.endpointName("identity service url ending in /v2.0/")
|
||||
.defaultEndpoint("https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/")
|
||||
.defaultModules(ImmutableSet.<Class<? extends Module>>builder()
|
||||
.add(KeystoneAuthenticationModule.class)
|
||||
.add(ZoneModule.class)
|
||||
|
@ -98,7 +95,7 @@ public class HPCloudComputeProviderMetadata extends BaseProviderMetadata {
|
|||
.console(URI.create("https://manage.hpcloud.com/compute"))
|
||||
.linkedServices("hpcloud-compute", "hpcloud-objectstorage")
|
||||
.iso3166Codes("US-NV")
|
||||
.endpoint("https://region-a.geo-1.identity.hpcloudsvc.com:35357")
|
||||
.endpoint("https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/")
|
||||
.defaultProperties(HPCloudComputeProviderMetadata.defaultProperties());
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<packaging>bundle</packaging>
|
||||
|
||||
<properties>
|
||||
<test.hpcloud-objectstorage.endpoint>https://region-a.geo-1.identity.hpcloudsvc.com:35357</test.hpcloud-objectstorage.endpoint>
|
||||
<test.hpcloud-objectstorage.endpoint>https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/</test.hpcloud-objectstorage.endpoint>
|
||||
<test.hpcloud-objectstorage.api-version>1.0</test.hpcloud-objectstorage.api-version>
|
||||
<test.hpcloud-objectstorage.build-version></test.hpcloud-objectstorage.build-version>
|
||||
<test.hpcloud-objectstorage.identity>FIXME_IDENTITY</test.hpcloud-objectstorage.identity>
|
||||
|
|
|
@ -18,21 +18,14 @@
|
|||
*/
|
||||
package org.jclouds.hpcloud.objectstorage;
|
||||
|
||||
import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS;
|
||||
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE;
|
||||
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.SERVICE_TYPE;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.jclouds.apis.ApiMetadata;
|
||||
import org.jclouds.hpcloud.objectstorage.blobstore.config.HPCloudObjectStorageBlobStoreContextModule;
|
||||
import org.jclouds.hpcloud.objectstorage.config.HPCloudObjectStorageRestClientModule;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.CredentialTypes;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.RegionModule;
|
||||
import org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties;
|
||||
import org.jclouds.openstack.services.ServiceType;
|
||||
import org.jclouds.openstack.swift.SwiftApiMetadata;
|
||||
import org.jclouds.openstack.swift.SwiftKeystoneApiMetadata;
|
||||
import org.jclouds.openstack.swift.config.SwiftRestClientModule.KeystoneStorageEndpointModule;
|
||||
import org.jclouds.rest.RestContext;
|
||||
|
||||
|
@ -44,7 +37,7 @@ import com.google.inject.Module;
|
|||
*
|
||||
* @author Jeremy Daggett
|
||||
*/
|
||||
public class HPCloudObjectStorageApiMetadata extends SwiftApiMetadata {
|
||||
public class HPCloudObjectStorageApiMetadata extends SwiftKeystoneApiMetadata {
|
||||
|
||||
/** The serialVersionUID */
|
||||
private static final long serialVersionUID = 820062881469203616L;
|
||||
|
@ -71,22 +64,17 @@ public class HPCloudObjectStorageApiMetadata extends SwiftApiMetadata {
|
|||
}
|
||||
|
||||
public static Properties defaultProperties() {
|
||||
Properties properties = SwiftApiMetadata.defaultProperties();
|
||||
properties.setProperty(SERVICE_TYPE, ServiceType.OBJECT_STORE);
|
||||
// TODO: this doesn't actually do anything yet.
|
||||
properties.setProperty(KeystoneProperties.VERSION, "2.0");
|
||||
properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.API_ACCESS_KEY_CREDENTIALS);
|
||||
properties.remove(PROPERTY_REGIONS);
|
||||
Properties properties = SwiftKeystoneApiMetadata.defaultProperties();
|
||||
return properties;
|
||||
}
|
||||
|
||||
public static class Builder extends SwiftApiMetadata.Builder {
|
||||
public static class Builder extends SwiftKeystoneApiMetadata.Builder {
|
||||
protected Builder(){
|
||||
super(HPCloudObjectStorageClient.class, HPCloudObjectStorageAsyncClient.class);
|
||||
id("hpcloud-objectstorage")
|
||||
.endpointName("identity service url ending in /v2.0/")
|
||||
.defaultEndpoint("https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/")
|
||||
.name("HP Cloud Services Object Storage API")
|
||||
.identityName("yourTenantName:yourAccessKey")
|
||||
.credentialName("secretKey")
|
||||
.documentation(URI.create("https://build.hpcloud.com/object-storage/api"))
|
||||
.defaultProperties(HPCloudObjectStorageApiMetadata.defaultProperties())
|
||||
.context(CONTEXT_TOKEN)
|
||||
|
|
|
@ -72,7 +72,7 @@ public class HPCloudObjectStorageProviderMetadata extends BaseProviderMetadata {
|
|||
.console(URI.create("https://manage.hpcloud.com/objects/us-west"))
|
||||
.linkedServices("hpcloud-compute", "hpcloud-objectstorage")
|
||||
.iso3166Codes("US-NV")
|
||||
.endpoint("https://region-a.geo-1.identity.hpcloudsvc.com:35357")
|
||||
.endpoint("https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/")
|
||||
.defaultProperties(HPCloudObjectStorageProviderMetadata.defaultProperties());
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<packaging>bundle</packaging>
|
||||
|
||||
<properties>
|
||||
<test.rackspace-cloudservers-us.endpoint>https://identity.api.rackspacecloud.com</test.rackspace-cloudservers-us.endpoint>
|
||||
<test.rackspace-cloudservers-us.endpoint>https://identity.api.rackspacecloud.com/v2.0/</test.rackspace-cloudservers-us.endpoint>
|
||||
<test.rackspace-cloudservers-us.api-version>2</test.rackspace-cloudservers-us.api-version>
|
||||
<test.rackspace-cloudservers-us.build-version></test.rackspace-cloudservers-us.build-version>
|
||||
<test.rackspace-cloudservers-us.identity>${test.rackspace-us.identity}</test.rackspace-cloudservers-us.identity>
|
||||
|
|
|
@ -74,9 +74,11 @@ public class CloudServersUSProviderMetadata extends BaseProviderMetadata {
|
|||
id("rackspace-cloudservers-us")
|
||||
.name("Rackspace Next Generation Cloud Servers")
|
||||
.apiMetadata(new NovaApiMetadata().toBuilder()
|
||||
.identityName("username")
|
||||
.credentialName("API Key")
|
||||
.identityName("${userName}")
|
||||
.credentialName("${apiKey}")
|
||||
.version("2")
|
||||
.defaultEndpoint("https://identity.api.rackspacecloud.com/v2.0/")
|
||||
.endpointName("identity service url ending in /v2.0/")
|
||||
.documentation(URI.create("http://docs.rackspace.com/servers/api/v2/cs-devguide/content/ch_preface.html#webhelp-currentid"))
|
||||
.defaultModules(ImmutableSet.<Class<? extends Module>>builder()
|
||||
.add(CloudIdentityAuthenticationModule.class)
|
||||
|
@ -88,7 +90,7 @@ public class CloudServersUSProviderMetadata extends BaseProviderMetadata {
|
|||
.console(URI.create("https://mycloud.rackspace.com"))
|
||||
.linkedServices("rackspace-cloudservers-us", "cloudfiles-swift-us")
|
||||
.iso3166Codes("US-TX")
|
||||
.endpoint("https://identity.api.rackspacecloud.com")
|
||||
.endpoint("https://identity.api.rackspacecloud.com/v2.0/")
|
||||
.defaultProperties(CloudServersUSProviderMetadata.defaultProperties());
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<packaging>bundle</packaging>
|
||||
|
||||
<properties>
|
||||
<test.trystack-nova.endpoint>https://nova-api.trystack.org:5443</test.trystack-nova.endpoint>
|
||||
<test.trystack-nova.endpoint>https://nova-api.trystack.org:5443/v2.0/</test.trystack-nova.endpoint>
|
||||
<test.trystack-nova.api-version>1.1</test.trystack-nova.api-version>
|
||||
<test.trystack-nova.build-version></test.trystack-nova.build-version>
|
||||
<test.trystack-nova.identity>FIXME_IDENTITY</test.trystack-nova.identity>
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
package org.jclouds.trystack.nova;
|
||||
|
||||
import static org.jclouds.Constants.PROPERTY_TRUST_ALL_CERTS;
|
||||
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE;
|
||||
import static org.jclouds.openstack.nova.v2_0.config.NovaProperties.AUTO_GENERATE_KEYPAIRS;
|
||||
|
||||
import java.net.URI;
|
||||
|
@ -64,7 +63,6 @@ public class TryStackNovaProviderMetadata extends BaseProviderMetadata {
|
|||
public static Properties defaultProperties() {
|
||||
Properties properties = new Properties();
|
||||
properties.setProperty(PROPERTY_TRUST_ALL_CERTS, "true");
|
||||
properties.setProperty(CREDENTIAL_TYPE, "passwordCredentials");
|
||||
properties.setProperty(AUTO_GENERATE_KEYPAIRS, "true");
|
||||
return properties;
|
||||
}
|
||||
|
@ -81,7 +79,7 @@ public class TryStackNovaProviderMetadata extends BaseProviderMetadata {
|
|||
.homepage(URI.create("https://trystack.org"))
|
||||
.console(URI.create("https://trystack.org/dash"))
|
||||
.iso3166Codes("US-CA")
|
||||
.endpoint("https://nova-api.trystack.org:5443")
|
||||
.endpoint("https://nova-api.trystack.org:5443/v2.0/")
|
||||
.defaultProperties(TryStackNovaProviderMetadata.defaultProperties());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue