JCLOUDS-584: HP Cloud Object Storage Fixes for 13.5

This commit is contained in:
Chris Custine 2014-06-04 02:01:03 -06:00 committed by Jeremy Daggett
parent b33825441f
commit fbb4f04930
18 changed files with 960 additions and 270 deletions

View File

@ -16,8 +16,11 @@
*/ */
package org.jclouds.blobstore.integration.internal; package org.jclouds.blobstore.integration.internal;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.jclouds.blobstore.options.CreateContainerOptions.Builder.publicRead; import static org.jclouds.blobstore.options.CreateContainerOptions.Builder.publicRead;
import static org.jclouds.util.Predicates2.retry;
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import java.io.IOException; import java.io.IOException;
import java.net.MalformedURLException; import java.net.MalformedURLException;
@ -25,11 +28,13 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.logging.Logger; import java.util.logging.Logger;
import com.google.common.net.HostAndPort;
import org.jclouds.blobstore.BlobStore; import org.jclouds.blobstore.BlobStore;
import org.jclouds.blobstore.domain.BlobMetadata; import org.jclouds.blobstore.domain.BlobMetadata;
import org.jclouds.blobstore.domain.StorageMetadata; import org.jclouds.blobstore.domain.StorageMetadata;
import org.jclouds.domain.Location; import org.jclouds.domain.Location;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import org.jclouds.predicates.SocketOpen;
import org.jclouds.util.Strings2; import org.jclouds.util.Strings2;
import org.testng.SkipException; import org.testng.SkipException;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -70,7 +75,11 @@ public class BaseContainerLiveTest extends BaseBlobStoreIntegrationTest {
BlobMetadata metadata = view.getBlobStore().blobMetadata(containerName, "hello"); BlobMetadata metadata = view.getBlobStore().blobMetadata(containerName, "hello");
assert metadata.getPublicUri() != null : metadata; assertTrue(metadata.getPublicUri() != null, metadata.toString());
SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class);
Predicate<HostAndPort> socketTester = retry(socketOpen, 1200, 10, SECONDS);
assertTrue(socketTester.apply(HostAndPort.fromParts(metadata.getPublicUri().getHost(),80)), metadata.getPublicUri().toString());
assertEquals(Strings2.toStringAndClose(view.utils().http().get(metadata.getPublicUri())), TEST_STRING); assertEquals(Strings2.toStringAndClose(view.utils().http().get(metadata.getPublicUri())), TEST_STRING);

View File

@ -36,9 +36,7 @@
<test.hpcloud-objectstorage.api-version>1.0</test.hpcloud-objectstorage.api-version> <test.hpcloud-objectstorage.api-version>1.0</test.hpcloud-objectstorage.api-version>
<test.hpcloud-objectstorage.build-version /> <test.hpcloud-objectstorage.build-version />
<!-- <!--
Identity must be tenantName:userName. Note that the following Identity must be "tenantName:accessKey". Credential is "secretKey".
credentials are the HP Cloud username and password, not the access
key id and secret key.
--> -->
<test.hpcloud-objectstorage.identity>FIXME_IDENTITY</test.hpcloud-objectstorage.identity> <test.hpcloud-objectstorage.identity>FIXME_IDENTITY</test.hpcloud-objectstorage.identity>
<test.hpcloud-objectstorage.credential>FIXME_CREDENTIAL</test.hpcloud-objectstorage.credential> <test.hpcloud-objectstorage.credential>FIXME_CREDENTIAL</test.hpcloud-objectstorage.credential>

View File

@ -16,32 +16,32 @@
*/ */
package org.jclouds.hpcloud.objectstorage; package org.jclouds.hpcloud.objectstorage;
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.SERVICE_TYPE; import com.google.common.collect.ImmutableSet;
import static org.jclouds.rest.config.BinderUtils.bindSyncToAsyncHttpApi; import com.google.common.reflect.TypeToken;
import com.google.inject.Module;
import java.net.URI; import com.google.inject.name.Named;
import java.util.Properties;
import javax.inject.Named;
import org.jclouds.blobstore.BlobRequestSigner; import org.jclouds.blobstore.BlobRequestSigner;
import org.jclouds.hpcloud.objectstorage.blobstore.HPCloudObjectStorageBlobRequestSigner; import org.jclouds.hpcloud.objectstorage.blobstore.HPCloudObjectStorageBlobRequestSigner;
import org.jclouds.hpcloud.objectstorage.blobstore.config.HPCloudObjectStorageBlobStoreContextModule; import org.jclouds.hpcloud.objectstorage.blobstore.config.HPCloudObjectStorageBlobStoreContextModule;
import org.jclouds.hpcloud.objectstorage.config.HPCloudObjectStorageRestClientModule; import org.jclouds.hpcloud.objectstorage.config.HPCloudObjectStorageRestClientModule;
import org.jclouds.location.suppliers.RegionIdToURISupplier; import org.jclouds.location.suppliers.RegionIdToURISupplier;
import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.RegionModule; import org.jclouds.openstack.keystone.v2_0.config.CredentialTypes;
import org.jclouds.openstack.keystone.v2_0.config.MappedAuthenticationApiModule; import org.jclouds.openstack.keystone.v2_0.config.MappedAuthenticationApiModule;
import org.jclouds.openstack.keystone.v2_0.suppliers.RegionIdToAdminURISupplier; import org.jclouds.openstack.keystone.v2_0.suppliers.RegionIdToAdminURISupplier;
import org.jclouds.openstack.swift.SwiftKeystoneApiMetadata; import org.jclouds.openstack.swift.SwiftKeystoneApiMetadata;
import org.jclouds.openstack.swift.blobstore.config.TemporaryUrlExtensionModule; import org.jclouds.openstack.swift.blobstore.config.TemporaryUrlExtensionModule;
import org.jclouds.openstack.swift.config.SwiftRestClientModule.KeystoneStorageEndpointModule;
import org.jclouds.openstack.swift.extensions.KeystoneTemporaryUrlKeyAsyncApi; import org.jclouds.openstack.swift.extensions.KeystoneTemporaryUrlKeyAsyncApi;
import org.jclouds.openstack.swift.extensions.TemporaryUrlKeyApi; import org.jclouds.openstack.swift.extensions.TemporaryUrlKeyApi;
import org.jclouds.rest.annotations.ApiVersion; import org.jclouds.rest.annotations.ApiVersion;
import com.google.common.collect.ImmutableSet; import java.net.URI;
import com.google.common.reflect.TypeToken; import java.util.Properties;
import com.google.inject.Module;
import static org.jclouds.hpcloud.objectstorage.config.HPCloudObjectStorageRestClientModule.HPCloudObjectStorageEndpointModule;
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.RegionModule;
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.rest.config.BinderUtils.bindSyncToAsyncHttpApi;
/** /**
* Implementation of {@link org.jclouds.providers.ProviderMetadata} for HP Cloud Services Object Storage * Implementation of {@link org.jclouds.providers.ProviderMetadata} for HP Cloud Services Object Storage
* *
@ -73,6 +73,7 @@ public class HPCloudObjectStorageApiMetadata extends SwiftKeystoneApiMetadata {
public static Properties defaultProperties() { public static Properties defaultProperties() {
Properties properties = SwiftKeystoneApiMetadata.defaultProperties(); Properties properties = SwiftKeystoneApiMetadata.defaultProperties();
properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.API_ACCESS_KEY_CREDENTIALS);
return properties; return properties;
} }
@ -89,7 +90,7 @@ public class HPCloudObjectStorageApiMetadata extends SwiftKeystoneApiMetadata {
.context(CONTEXT_TOKEN) .context(CONTEXT_TOKEN)
.defaultModules(ImmutableSet.<Class<? extends Module>>builder() .defaultModules(ImmutableSet.<Class<? extends Module>>builder()
.add(MappedAuthenticationApiModule.class) .add(MappedAuthenticationApiModule.class)
.add(KeystoneStorageEndpointModule.class) .add(HPCloudObjectStorageEndpointModule.class)
.add(IgnoreRegionVersionsModule.class) .add(IgnoreRegionVersionsModule.class)
.add(HPCloudObjectStorageRestClientModule.class) .add(HPCloudObjectStorageRestClientModule.class)
.add(HPCloudObjectStorageBlobStoreContextModule.class) .add(HPCloudObjectStorageBlobStoreContextModule.class)

View File

@ -17,17 +17,17 @@
package org.jclouds.hpcloud.objectstorage; package org.jclouds.hpcloud.objectstorage;
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.REQUIRES_TENANT; import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.REQUIRES_TENANT;
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE;
import java.net.URI; import java.net.URI;
import java.util.Properties; import java.util.Properties;
import org.jclouds.openstack.keystone.v2_0.config.CredentialTypes;
import org.jclouds.providers.ProviderMetadata; import org.jclouds.providers.ProviderMetadata;
import org.jclouds.providers.internal.BaseProviderMetadata; import org.jclouds.providers.internal.BaseProviderMetadata;
/** /**
* Implementation of {@link org.jclouds.types.ProviderMetadata} for StratoGen VMware hosting * Implementation of {@link org.jclouds.types.ProviderMetadata} for HP Cloud
*
* @author Adrian Cole
*/ */
public class HPCloudObjectStorageProviderMetadata extends BaseProviderMetadata { public class HPCloudObjectStorageProviderMetadata extends BaseProviderMetadata {
@ -51,6 +51,8 @@ public class HPCloudObjectStorageProviderMetadata extends BaseProviderMetadata {
public static Properties defaultProperties() { public static Properties defaultProperties() {
Properties properties = new Properties(); Properties properties = new Properties();
properties.setProperty(REQUIRES_TENANT, "true"); properties.setProperty(REQUIRES_TENANT, "true");
properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.API_ACCESS_KEY_CREDENTIALS);
return properties; return properties;
} }
@ -63,7 +65,7 @@ public class HPCloudObjectStorageProviderMetadata extends BaseProviderMetadata {
.homepage(URI.create("http://hpcloud.com")) .homepage(URI.create("http://hpcloud.com"))
.console(URI.create("https://manage.hpcloud.com/objects/us-west")) .console(URI.create("https://manage.hpcloud.com/objects/us-west"))
.linkedServices("hpcloud-compute", "hpcloud-objectstorage") .linkedServices("hpcloud-compute", "hpcloud-objectstorage")
.iso3166Codes("US-NV") .iso3166Codes("US-NV", "US-VA")
.endpoint("https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/") .endpoint("https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/")
.defaultProperties(HPCloudObjectStorageProviderMetadata.defaultProperties()); .defaultProperties(HPCloudObjectStorageProviderMetadata.defaultProperties());
} }

View File

@ -0,0 +1,90 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jclouds.hpcloud.objectstorage;
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.REQUIRES_TENANT;
import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE;
import java.net.URI;
import java.util.Properties;
import org.jclouds.openstack.keystone.v2_0.config.CredentialTypes;
import org.jclouds.providers.ProviderMetadata;
import org.jclouds.providers.internal.BaseProviderMetadata;
/**
<<<<<<< HEAD
* Implementation of {@link org.jclouds.types.ProviderMetadata} for StratoGen VMware hosting
*
* @author Adrian Cole
=======
* Implementation of {@link org.jclouds.types.ProviderMetadata} for HP Cloud
>>>>>>> 7d89840... JCLOUDS-584: HP Cloud Object Storage Fixes for 13.5
*/
public class HPCloudObjectStorageProviderMetadata extends BaseProviderMetadata {
public static Builder builder() {
return new Builder();
}
@Override
public Builder toBuilder() {
return builder().fromProviderMetadata(this);
}
public HPCloudObjectStorageProviderMetadata() {
super(builder());
}
public HPCloudObjectStorageProviderMetadata(Builder builder) {
super(builder);
}
public static Properties defaultProperties() {
Properties properties = new Properties();
properties.setProperty(REQUIRES_TENANT, "true");
properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.API_ACCESS_KEY_CREDENTIALS);
return properties;
}
public static class Builder extends BaseProviderMetadata.Builder {
protected Builder() {
id("hpcloud-objectstorage")
.name("HP Cloud Services Object Storage")
.apiMetadata(new HPCloudObjectStorageApiMetadata())
.homepage(URI.create("http://hpcloud.com"))
.console(URI.create("https://manage.hpcloud.com/objects/us-west"))
.linkedServices("hpcloud-compute", "hpcloud-objectstorage")
.iso3166Codes("US-NV", "US-VA")
.endpoint("https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/")
.defaultProperties(HPCloudObjectStorageProviderMetadata.defaultProperties());
}
@Override
public HPCloudObjectStorageProviderMetadata build() {
return new HPCloudObjectStorageProviderMetadata(this);
}
@Override
public Builder fromProviderMetadata(ProviderMetadata in) {
super.fromProviderMetadata(in);
return this;
}
}
}

View File

@ -16,8 +16,10 @@
*/ */
package org.jclouds.hpcloud.objectstorage.blobstore; package org.jclouds.hpcloud.objectstorage.blobstore;
import static com.google.common.util.concurrent.Futures.immediateFuture;
import static com.google.common.util.concurrent.Futures.transform; import static com.google.common.util.concurrent.Futures.transform;
import java.net.URI;
import java.util.Set; import java.util.Set;
import javax.inject.Inject; import javax.inject.Inject;
@ -80,20 +82,14 @@ public class HPCloudObjectStorageAsyncBlobStore extends SwiftAsyncBlobStore {
@Override @Override
public ListenableFuture<Boolean> createContainerInLocation(Location location, final String container, public ListenableFuture<Boolean> createContainerInLocation(Location location, final String container,
CreateContainerOptions options) { CreateContainerOptions options) {
if (options.isPublicRead()) {
ListenableFuture<Boolean> returnVal = createContainerInLocation(location, container); return transform(immediateFuture(enableAndCache.apply(container)), new Function<URI, Boolean>() {
if (options.isPublicRead()) public Boolean apply(URI from) {
return transform(createContainerInLocation(location, container), new Function<Boolean, Boolean>() { return from != null;
@Override
public Boolean apply(Boolean input) {
if (Boolean.TRUE.equals(input)) {
return enableAndCache.apply(container) != null;
}
return false;
} }
}, userExecutor); }, userExecutor);
return returnVal; }
return createContainerInLocation(location, container);
} }
} }

View File

@ -49,7 +49,7 @@ import com.google.common.base.Supplier;
@Singleton @Singleton
public class HPCloudObjectStorageBlobStore extends SwiftBlobStore { public class HPCloudObjectStorageBlobStore extends SwiftBlobStore {
private EnableCDNAndCache enableAndCache; private EnableCDNAndCache enableCDNAndCache;
@Inject @Inject
protected HPCloudObjectStorageBlobStore(BlobStoreContext context, BlobUtils blobUtils, protected HPCloudObjectStorageBlobStore(BlobStoreContext context, BlobUtils blobUtils,
@ -58,23 +58,19 @@ public class HPCloudObjectStorageBlobStore extends SwiftBlobStore {
BlobStoreListContainerOptionsToListContainerOptions container2ContainerListOptions, BlobStoreListContainerOptionsToListContainerOptions container2ContainerListOptions,
ContainerToResourceList container2ResourceList, ObjectToBlob object2Blob, BlobToObject blob2Object, ContainerToResourceList container2ResourceList, ObjectToBlob object2Blob, BlobToObject blob2Object,
ObjectToBlobMetadata object2BlobMd, BlobToHttpGetOptions blob2ObjectGetOptions, ObjectToBlobMetadata object2BlobMd, BlobToHttpGetOptions blob2ObjectGetOptions,
Provider<FetchBlobMetadata> fetchBlobMetadataProvider, EnableCDNAndCache enableAndCache, Provider<FetchBlobMetadata> fetchBlobMetadataProvider, EnableCDNAndCache enableCDNAndCache,
Provider<MultipartUploadStrategy> multipartUploadStrategy) { Provider<MultipartUploadStrategy> multipartUploadStrategy) {
super(context, blobUtils, defaultLocation, locations, sync, container2ResourceMd, container2ContainerListOptions, super(context, blobUtils, defaultLocation, locations, sync, container2ResourceMd, container2ContainerListOptions,
container2ResourceList, object2Blob, blob2Object, object2BlobMd, blob2ObjectGetOptions, container2ResourceList, object2Blob, blob2Object, object2BlobMd, blob2ObjectGetOptions,
fetchBlobMetadataProvider, multipartUploadStrategy); fetchBlobMetadataProvider, multipartUploadStrategy);
this.enableAndCache = enableAndCache; this.enableCDNAndCache = enableCDNAndCache;
} }
@Override @Override
public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options) { public boolean createContainerInLocation(Location location, String container, CreateContainerOptions options) {
try { // Enabling CDN will create the container if it does not exist
return createContainerInLocation(location, container); return options.isPublicRead() ? enableCDNAndCache.apply(container) != null : createContainerInLocation(location, container);
} finally {
if (options.isPublicRead())
enableAndCache.apply(container);
}
} }
} }

View File

@ -17,10 +17,12 @@
package org.jclouds.hpcloud.objectstorage.config; package org.jclouds.hpcloud.objectstorage.config;
import static org.jclouds.reflect.Reflection2.typeToken; import static org.jclouds.reflect.Reflection2.typeToken;
import static org.jclouds.util.Suppliers2.getLastValueInMap; import static org.jclouds.util.Suppliers2.getLastValueInMap;
import static org.jclouds.util.Suppliers2.getValueInMapOrNull;
import java.net.URI; import java.net.URI;
import java.util.Map; import java.util.Map;
import javax.inject.Named;
import javax.inject.Singleton; import javax.inject.Singleton;
import org.jclouds.hpcloud.objectstorage.HPCloudObjectStorageApi; import org.jclouds.hpcloud.objectstorage.HPCloudObjectStorageApi;
@ -29,9 +31,14 @@ import org.jclouds.hpcloud.objectstorage.extensions.CDNContainerApi;
import org.jclouds.hpcloud.objectstorage.extensions.CDNContainerAsyncApi; import org.jclouds.hpcloud.objectstorage.extensions.CDNContainerAsyncApi;
import org.jclouds.hpcloud.services.HPExtensionCDN; import org.jclouds.hpcloud.services.HPExtensionCDN;
import org.jclouds.hpcloud.services.HPExtensionServiceType; import org.jclouds.hpcloud.services.HPExtensionServiceType;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.location.reference.LocationConstants;
import org.jclouds.location.suppliers.RegionIdToURISupplier; import org.jclouds.location.suppliers.RegionIdToURISupplier;
import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule;
import org.jclouds.openstack.services.ServiceType;
import org.jclouds.openstack.swift.CommonSwiftAsyncClient; import org.jclouds.openstack.swift.CommonSwiftAsyncClient;
import org.jclouds.openstack.swift.CommonSwiftClient; import org.jclouds.openstack.swift.CommonSwiftClient;
import org.jclouds.openstack.swift.Storage;
import org.jclouds.openstack.swift.config.SwiftRestClientModule; import org.jclouds.openstack.swift.config.SwiftRestClientModule;
import org.jclouds.rest.ConfiguresRestClient; import org.jclouds.rest.ConfiguresRestClient;
import org.jclouds.rest.annotations.ApiVersion; import org.jclouds.rest.annotations.ApiVersion;
@ -61,10 +68,40 @@ public class HPCloudObjectStorageRestClientModule extends
bind(CommonSwiftAsyncClient.class).to(HPCloudObjectStorageAsyncApi.class).in(Scopes.SINGLETON); bind(CommonSwiftAsyncClient.class).to(HPCloudObjectStorageAsyncApi.class).in(Scopes.SINGLETON);
} }
private static Supplier<URI> getUriSupplier(String serviceType, String apiVersion, RegionIdToURISupplier.Factory factory, String region) {
Supplier<Map<String, Supplier<URI>>> endpointsSupplier = factory.createForApiTypeAndVersion(serviceType, apiVersion);
if (region.isEmpty()) {
return getLastValueInMap(endpointsSupplier);
} else {
return getValueInMapOrNull(endpointsSupplier, region);
}
}
@Provides @Provides
@Singleton @Singleton
@HPExtensionCDN @HPExtensionCDN
protected Supplier<URI> provideCDNUrl(RegionIdToURISupplier.Factory factory, @ApiVersion String apiVersion) { @Nullable
return getLastValueInMap(factory.createForApiTypeAndVersion(HPExtensionServiceType.CDN, apiVersion)); protected Supplier<URI> provideCDNUrl(RegionIdToURISupplier.Factory factory,
@ApiVersion String apiVersion,
@Named(LocationConstants.PROPERTY_REGION) String region) {
return getUriSupplier(HPExtensionServiceType.CDN, apiVersion, factory, region);
} }
// Ignores requested apiVersion to work around versionId issue in HP endpoints
public static class HPCloudObjectStorageEndpointModule extends KeystoneAuthenticationModule {
@Provides
@Singleton
@Storage
@Nullable
protected Supplier<URI> provideStorageUrl(RegionIdToURISupplier.Factory factory,
@ApiVersion String apiVersion,
@Named(LocationConstants.PROPERTY_REGION) String region) {
return getUriSupplier(ServiceType.OBJECT_STORE, null, factory, region);
}
}
} }

View File

@ -130,8 +130,8 @@ public class CDNContainer implements Comparable<CDNContainer> {
private final String referrerAcl; private final String referrerAcl;
private final String useragentAcl; private final String useragentAcl;
@ConstructorProperties({ "name", "cdnEnabled", "ttl", "cdnUri", "cdnSslUri", "referrerAcl", "useragentAcl", @ConstructorProperties({ "name", "cdn_enabled", "ttl", "x-cdn-uri", "x-cdn-ssl-uri", "referrerAcl", "useragentAcl",
"logRetention" }) "log_retention" })
protected CDNContainer(@Nullable String name, boolean cdnEnabled, long ttl, @Nullable URI CDNUri, protected CDNContainer(@Nullable String name, boolean cdnEnabled, long ttl, @Nullable URI CDNUri,
@Nullable URI CDNSslUri, @Nullable String referrerAcl, @Nullable String useragentAcl, @Nullable URI CDNSslUri, @Nullable String referrerAcl, @Nullable String useragentAcl,
boolean logRetention) { boolean logRetention) {

View File

@ -46,37 +46,37 @@ import com.google.inject.Module;
public class HPCloudObjectStorageBlobSignerExpectTest extends BaseBlobSignerExpectTest { public class HPCloudObjectStorageBlobSignerExpectTest extends BaseBlobSignerExpectTest {
public HPCloudObjectStorageBlobSignerExpectTest() { public HPCloudObjectStorageBlobSignerExpectTest() {
identity = "12346637803162:identity"; identity = "myTenantName:apiaccesskey";
} }
@Override @Override
protected HttpRequest getBlob() { protected HttpRequest getBlob() {
return HttpRequest.builder().method("GET") return HttpRequest.builder().method("GET")
.endpoint("https://objects.jclouds.org/v1.0/40806637803162/container/name") .endpoint("https://region-a.geo-1.objects.hpcloudsvc.com/v1/myTenantId/container/name")
.addHeader("X-Auth-Token", "Auth_4f173437e4b013bee56d1007").build(); .addHeader("X-Auth-Token", "myToken").build();
} }
@Override @Override
protected HttpRequest getBlobWithTime() { protected HttpRequest getBlobWithTime() {
return HttpRequest.builder().method("GET") return HttpRequest.builder().method("GET")
.endpoint("https://objects.jclouds.org/v1.0/40806637803162/container/name?temp_url_sig=40806637803162%3Aidentity%3Ada88bc31122f0d0806b1c7bf71cd3af5c5d5b94c&temp_url_expires=123456792") .endpoint("https://region-a.geo-1.objects.hpcloudsvc.com/v1/myTenantId/container/name?temp_url_sig=myTenantId%3Aapiaccesskey%3A5620ad176e6dd08f25e7ae34f72e5fd98d1b89b1&temp_url_expires=123456792")
.build(); .build();
} }
@Override @Override
protected HttpRequest getBlobWithOptions() { protected HttpRequest getBlobWithOptions() {
return HttpRequest.builder().method("GET") return HttpRequest.builder().method("GET")
.endpoint("https://objects.jclouds.org/v1.0/40806637803162/container/name") .endpoint("https://region-a.geo-1.objects.hpcloudsvc.com/v1/myTenantId/container/name")
.addHeader("X-Auth-Token", "Auth_4f173437e4b013bee56d1007").addHeader("Range", "bytes=0-1").build(); .addHeader("X-Auth-Token", "myToken").addHeader("Range", "bytes=0-1").build();
} }
@Override @Override
protected HttpRequest putBlob() { protected HttpRequest putBlob() {
return HttpRequest.builder().method("PUT") return HttpRequest.builder().method("PUT")
.endpoint("https://objects.jclouds.org/v1.0/40806637803162/container/name") .endpoint("https://region-a.geo-1.objects.hpcloudsvc.com/v1/myTenantId/container/name")
.addHeader("ETag", "00020408") .addHeader("ETag", "00020408")
.addHeader("Expect", "100-continue") .addHeader("Expect", "100-continue")
.addHeader("X-Auth-Token", "Auth_4f173437e4b013bee56d1007") .addHeader("X-Auth-Token", "myToken")
.addHeader("X-Delete-At", "1") .addHeader("X-Delete-At", "1")
.build(); .build();
} }
@ -84,7 +84,7 @@ public class HPCloudObjectStorageBlobSignerExpectTest extends BaseBlobSignerExpe
@Override @Override
protected HttpRequest putBlobWithTime() { protected HttpRequest putBlobWithTime() {
return HttpRequest.builder().method("PUT") return HttpRequest.builder().method("PUT")
.endpoint("https://objects.jclouds.org/v1.0/40806637803162/container/name?temp_url_sig=40806637803162%3Aidentity%3Ac90269245ab0a316d5ea5e654d4c2a975fb4bf77&temp_url_expires=123456792") .endpoint("https://region-a.geo-1.objects.hpcloudsvc.com/v1/myTenantId/container/name?temp_url_sig=myTenantId%3Aapiaccesskey%3A04dc6071fbbf8e1696eaceb61a3fe49874abb71d&temp_url_expires=123456792")
.addHeader("Expect", "100-continue") .addHeader("Expect", "100-continue")
.build(); .build();
} }
@ -92,8 +92,8 @@ public class HPCloudObjectStorageBlobSignerExpectTest extends BaseBlobSignerExpe
@Override @Override
protected HttpRequest removeBlob() { protected HttpRequest removeBlob() {
return HttpRequest.builder().method("DELETE") return HttpRequest.builder().method("DELETE")
.endpoint("https://objects.jclouds.org/v1.0/40806637803162/container/name") .endpoint("https://region-a.geo-1.objects.hpcloudsvc.com/v1/myTenantId/container/name")
.addHeader("X-Auth-Token", "Auth_4f173437e4b013bee56d1007").build(); .addHeader("X-Auth-Token", "myToken").build();
} }
/** /**
@ -109,7 +109,7 @@ public class HPCloudObjectStorageBlobSignerExpectTest extends BaseBlobSignerExpe
.addHeader("Accept", "application/json") .addHeader("Accept", "application/json")
.payload( .payload(
payloadFromStringWithContentType( payloadFromStringWithContentType(
"{\"auth\":{\"passwordCredentials\":{\"username\":\"identity\",\"password\":\"credential\"},\"tenantName\":\"12346637803162\"}}", "{\"auth\":{\"apiAccessKeyCredentials\":{\"accessKey\":\"apiaccesskey\",\"secretKey\":\"credential\"},\"tenantName\":\"myTenantName\"}}",
"application/json")).build(); "application/json")).build();
HttpResponse authenticationResponse = HttpResponse.builder().statusCode(200) HttpResponse authenticationResponse = HttpResponse.builder().statusCode(200)
@ -120,7 +120,7 @@ public class HPCloudObjectStorageBlobSignerExpectTest extends BaseBlobSignerExpe
.builder() .builder()
.method("HEAD") .method("HEAD")
.endpoint("https://objects.jclouds.org/v1.0/40806637803162/") .endpoint("https://objects.jclouds.org/v1.0/40806637803162/")
.addHeader("X-Auth-Token", "Auth_4f173437e4b013bee56d1007").build(); .addHeader("X-Auth-Token", "myToken").build();
HttpResponse temporaryKeyResponse = HttpResponse.builder().statusCode(200) HttpResponse temporaryKeyResponse = HttpResponse.builder().statusCode(200)
.addHeader(ACCOUNT_TEMPORARY_URL_KEY, "TEMPORARY_KEY").build(); .addHeader(ACCOUNT_TEMPORARY_URL_KEY, "TEMPORARY_KEY").build();

View File

@ -37,7 +37,7 @@ public class HPCloudObjectStorageBlobStoreExpectTest extends BaseHPCloudObjectSt
public void testListObjectsWhenResponseIs2xx() throws Exception { public void testListObjectsWhenResponseIs2xx() throws Exception {
Map<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder().put( Map<HttpRequest, HttpResponse> requestResponseMap = ImmutableMap.<HttpRequest, HttpResponse> builder().put(
keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess).build(); keystoneAuthWithAccessKeyAndSecretKey, responseWithKeystoneAccess).build();
BlobStore clientWhenLocationsExist = requestsSendResponses(requestResponseMap); BlobStore clientWhenLocationsExist = requestsSendResponses(requestResponseMap);

View File

@ -18,6 +18,7 @@ package org.jclouds.hpcloud.objectstorage.blobstore.integration;
import org.jclouds.blobstore.domain.Blob; import org.jclouds.blobstore.domain.Blob;
import org.jclouds.openstack.swift.blobstore.integration.SwiftBlobIntegrationLiveTest; import org.jclouds.openstack.swift.blobstore.integration.SwiftBlobIntegrationLiveTest;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/** /**
@ -29,6 +30,20 @@ public class HPCloudObjectStorageBlobIntegrationLiveTest extends SwiftBlobIntegr
provider = "hpcloud-objectstorage"; provider = "hpcloud-objectstorage";
} }
/**
* HP Cloud Object Storage container naming rules have more restrictions than defaults
* @see <a href="http://docs.hpcloud.com/api/object-storage#naming" />
*/
@DataProvider(name = "delete")
public Object[][] createData() {
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
return new Object[][] { { "normal" }, { "sp ace" } };
} else {
return new Object[][] { { "normal" }, { "sp ace" }, { "qu?stion" }, { "unic₪de" }, { "path/foo" }, { "colon:" },
{ "asteri*k" }, { "p|pe" } };
}
}
@Override @Override
protected void checkContentDisposition(Blob blob, String contentDisposition) { protected void checkContentDisposition(Blob blob, String contentDisposition) {
assert blob.getPayload().getContentMetadata().getContentDisposition().startsWith(contentDisposition) : blob assert blob.getPayload().getContentMetadata().getContentDisposition().startsWith(contentDisposition) : blob

View File

@ -17,6 +17,7 @@
package org.jclouds.hpcloud.objectstorage.blobstore.integration; package org.jclouds.hpcloud.objectstorage.blobstore.integration;
import org.jclouds.blobstore.integration.internal.BaseContainerLiveTest; import org.jclouds.blobstore.integration.internal.BaseContainerLiveTest;
import org.testng.SkipException;
import org.testng.annotations.Test; import org.testng.annotations.Test;
/** /**
@ -27,4 +28,13 @@ public class HPCloudObjectStorageContainerLiveTest extends BaseContainerLiveTest
public HPCloudObjectStorageContainerLiveTest() { public HPCloudObjectStorageContainerLiveTest() {
provider = "hpcloud-objectstorage"; provider = "hpcloud-objectstorage";
} }
@Override
@Test
public void testPublicAccessInNonDefaultLocation() { throw new SkipException("Locations are ignored"); }
@Override
@Test
public void testPublicAccessInNonDefaultLocationWithBigBlob() { throw new SkipException("Locations are ignored"); }
} }

View File

@ -19,6 +19,7 @@ package org.jclouds.hpcloud.objectstorage.blobstore.integration;
import java.util.Set; import java.util.Set;
import org.jclouds.openstack.swift.blobstore.integration.SwiftServiceIntegrationLiveTest; import org.jclouds.openstack.swift.blobstore.integration.SwiftServiceIntegrationLiveTest;
import org.testng.SkipException;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
@ -34,7 +35,11 @@ public class HPCloudObjectStorageServiceIntegrationLiveTest extends SwiftService
@Override @Override
protected Set<String> getIso3166Codes() { protected Set<String> getIso3166Codes() {
return ImmutableSet.<String> of("US-NV"); return ImmutableSet.<String> of("US-NV", "US-VA");
} }
@Override
@Test
public void testAllLocations() { throw new SkipException("Locations are ignored"); }
} }

View File

@ -0,0 +1,131 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jclouds.hpcloud.objectstorage.config;
import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import com.google.common.collect.Maps;
import org.jclouds.hpcloud.services.HPExtensionServiceType;
import org.jclouds.location.suppliers.RegionIdToURISupplier;
import org.jclouds.openstack.services.ServiceType;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Map;
import static org.easymock.EasyMock.createStrictMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.fail;
@Test(groups = "unit")
public class HPCloudObjectStorageEndpointModuleTest {
private final String apiVersion = "1.0";
private final RegionIdToURISupplier.Factory mockFactory = createStrictMock(RegionIdToURISupplier.Factory.class);
private final RegionIdToURISupplier.Factory mockCDNFactory = createStrictMock(RegionIdToURISupplier.Factory.class);
private final RegionIdToURISupplier mockSupplier = createStrictMock(RegionIdToURISupplier.class);
/**
* Setup the expectations for our mock factory to return 3 region urls keyed
* by test region names
*/
@BeforeTest
public void setup() {
Map<String, Supplier<URI>> endpoints = Maps.newHashMap();
try {
endpoints.put("region1", Suppliers.ofInstance(new URI("http://region1.example.org/")));
endpoints.put("region2", Suppliers.ofInstance(new URI("http://region2.example.org/")));
endpoints.put("region3", Suppliers.ofInstance(new URI("http://region3.example.org/")));
} catch (URISyntaxException ex) {
fail("static test Strings do not parse to URI: " + ex.getMessage());
}
expect(mockSupplier.get())
.andReturn(endpoints)
.anyTimes();
expect(mockFactory.createForApiTypeAndVersion(ServiceType.OBJECT_STORE, null))
.andReturn(mockSupplier)
.anyTimes();
expect(mockCDNFactory.createForApiTypeAndVersion(HPExtensionServiceType.CDN, apiVersion))
.andReturn(mockSupplier)
.anyTimes();
replay(mockSupplier);
replay(mockFactory);
replay(mockCDNFactory);
}
@Test
public void testObjectStorageRegion() {
final HPCloudObjectStorageRestClientModule.HPCloudObjectStorageEndpointModule moduleToTest = new HPCloudObjectStorageRestClientModule.HPCloudObjectStorageEndpointModule();
for (int i = 1; i <= 3; i++) {
Supplier<URI> resultingSupplier = moduleToTest.provideStorageUrl(mockFactory, apiVersion, String.format("region%1$s", i));
assertNotNull(resultingSupplier);
URI resultingUri = resultingSupplier.get();
assertNotNull(resultingUri);
assertEquals(resultingUri.toString(),
String.format("http://region%1$s.example.org/", i));
}
}
@Test
public void testCDNRegion() {
final HPCloudObjectStorageRestClientModule moduleToTest = new HPCloudObjectStorageRestClientModule();
for (int i = 1; i <= 3; i++) {
Supplier<URI> resultingSupplier = moduleToTest.provideCDNUrl(mockCDNFactory, apiVersion, String.format("region%1$s", i));
assertNotNull(resultingSupplier);
URI resultingUri = resultingSupplier.get();
assertNotNull(resultingUri);
assertEquals(resultingUri.toString(),
String.format("http://region%1$s.example.org/", i));
}
}
/**
* Test that specifying an undefined region will return null
*/
@Test
public void testObjectStorageUndefinedRegion() {
final HPCloudObjectStorageRestClientModule.HPCloudObjectStorageEndpointModule moduleToTest = new HPCloudObjectStorageRestClientModule.HPCloudObjectStorageEndpointModule();
Supplier<URI> resultingSupplier = moduleToTest.provideStorageUrl(mockFactory, apiVersion, "region-that-dne");
assertNotNull(resultingSupplier);
URI resultingUri = resultingSupplier.get();
assertNull(resultingUri);
}
@Test
public void testCDNUndefinedRegion() {
final HPCloudObjectStorageRestClientModule moduleToTest = new HPCloudObjectStorageRestClientModule();
Supplier<URI> resultingSupplier = moduleToTest.provideCDNUrl(mockCDNFactory, apiVersion, "region-that-dne");
assertNotNull(resultingSupplier);
URI resultingUri = resultingSupplier.get();
assertNull(resultingUri);
}
}

View File

@ -1,104 +1,299 @@
{ {"access": {
"access": { "token": {
"token": { "expires": "2014-04-24T08:52:18.113Z",
"expires": "2012-01-18T21:35:59.050Z", "id": "myToken",
"id": "Auth_4f173437e4b013bee56d1007", "tenant": {
"tenant": { "id": "myTenantId",
"id": "40806637803162", "name": "myTenantName"
"name": "user@jclouds.org-default-tenant" }
} },
"user": {
"id": "myUserId",
"name": "myUsername",
"otherAttributes": {
"domainStatus": "enabled",
"domainStatusCode": "00"
}, },
"user": { "roles": [
"id": "36980896575174", {
"name": "user@jclouds.org", "id": "00000000004004",
"roles": [ "serviceId": "100",
"name": "domainuser"
},
{
"id": "00000000004016",
"serviceId": "120",
"name": "netadmin",
"tenantId": "myTenantId"
},
{
"id": "00000000004014",
"serviceId": "150",
"name": "cdn-admin",
"tenantId": "myTenantId"
},
{
"id": "00000000004022",
"serviceId": "110",
"name": "Admin",
"tenantId": "myTenantId"
},
{
"id": "00000000004024",
"serviceId": "140",
"name": "user",
"tenantId": "myTenantId"
},
{
"id": "00000000004013",
"serviceId": "130",
"name": "block-admin",
"tenantId": "myTenantId"
},
{
"id": "00000000004025",
"serviceId": "120",
"name": "sysadmin",
"tenantId": "myTenantId"
},
{
"id": "91643347410087",
"serviceId": "240",
"name": "dns-admin",
"tenantId": "myTenantId"
},
{
"id": "00000000004003",
"serviceId": "100",
"name": "domainadmin"
},
{
"id": "10419409370304",
"serviceId": "170",
"name": "net-admin",
"tenantId": "myTenantId"
}
]
},
"serviceCatalog": [
{
"name": "Usage Reporting",
"type": "metering",
"endpoints": [
{ {
"id": "00000000004022", "publicURL": "",
"serviceId": "110", "region": "region-a.geo-1",
"name": "Admin", "versionId": "2",
"tenantName": "40806637803162" "versionInfo": "https:\/\/region-a.geo-1.usage-reporting-internal.hpcloudsvc.com:8777",
"versionList": "https:\/\/region-a.geo-1.usage-reporting-internal.hpcloudsvc.com:8777"
}, },
{ {
"id": "00000000004024", "publicURL": "",
"serviceId": "140", "region": "region-b.geo-1",
"name": "user", "versionId": "2",
"tenantName": "40806637803162" "versionInfo": "https:\/\/region-b.geo-1.usage-reporting-internal.hpcloudsvc.com:8777",
}, "versionList": "https:\/\/region-b.geo-1.usage-reporting-internal.hpcloudsvc.com:8777"
{
"id": "00000000004004",
"serviceId": "100",
"name": "domainuser"
},
{
"id": "00000000004016",
"serviceId": "120",
"name": "netadmin",
"tenantName": "40806637803162"
} }
] ]
}, },
"serviceCatalog": [ {
{ "name": "Networking",
"name": "Object Storage", "type": "network",
"type": "object-store", "endpoints": [
"endpoints": [ {
{ "tenantId": "myTenantId",
"tenantName": "40806637803162", "publicURL": "",
"adminURL": "https://objects.jclouds.org/v1.0/", "publicURL2": "",
"publicURL": "https://objects.jclouds.org/v1.0/40806637803162", "region": "az-1.region-a.geo-1",
"region": "region-a.geo-1", "versionId": "",
"id": "1.0" "versionInfo": "",
} "versionList": ""
] },
}, {
{ "tenantId": "myTenantId",
"name": "Identity", "publicURL": "https:\/\/region-a.geo-1.network.hpcloudsvc.com",
"type": "identity", "publicURL2": "",
"endpoints": [ "region": "region-a.geo-1",
{ "versionId": "2.0",
"publicURL": "https://csnode.jclouds.org/v2.0/", "versionInfo": "https:\/\/region-a.geo-1.network.hpcloudsvc.com",
"region": "region-a.geo-1", "versionList": "https:\/\/region-a.geo-1.network.hpcloudsvc.com"
"id": "2.0", },
"list": "https://csnode.jclouds.org/extension" {
} "tenantId": "myTenantId",
] "publicURL": "https:\/\/region-b.geo-1.network.hpcloudsvc.com",
}, "publicURL2": "",
{ "region": "region-b.geo-1",
"name": "Image Management", "versionId": "2.0",
"type": "image", "versionInfo": "https:\/\/region-b.geo-1.network.hpcloudsvc.com",
"endpoints": [ "versionList": "https:\/\/region-b.geo-1.network.hpcloudsvc.com"
{ }
"tenantName": "40806637803162", ]
"publicURL": "https://glance.jclouds.org:9292/v1.0", },
"region": "az-1.region-a.geo-1", {
"id": "1.0" "name": "Object Storage",
} "type": "object-store",
] "endpoints": [
}, {
{ "tenantId": "myTenantId",
"name":"Cloud Servers", "publicURL": "https:\/\/region-a.geo-1.objects.hpcloudsvc.com\/v1\/myTenantId",
"type":"compute", "region": "region-a.geo-1",
"endpoints":[{ "versionId": "1.0",
"tenantId":"1", "versionInfo": "https:\/\/region-a.geo-1.objects.hpcloudsvc.com\/v1.0\/",
"publicURL":"https://compute.north.host/v1/1234", "versionList": "https:\/\/region-a.geo-1.objects.hpcloudsvc.com"
"internalURL":"https://compute.north.host/v1/1234", },
"region":"az-1.region-a.geo-1", {
"versionId":"1.0", "tenantId": "myTenantId",
"versionInfo":"https://compute.north.host/v1.0/", "publicURL": "https:\/\/region-b.geo-1.objects.hpcloudsvc.com:443\/v1\/myTenantId",
"versionList":"https://compute.north.host/" "region": "region-b.geo-1",
}, "versionId": "1",
{ "versionInfo": "https:\/\/region-b.geo-1.objects.hpcloudsvc.com:443\/v1\/",
"tenantId":"2", "versionList": "https:\/\/region-b.geo-1.objects.hpcloudsvc.com:443"
"publicURL":"https://compute.north.host/v1.1/3456", }
"internalURL":"https://compute.north.host/v1.1/3456", ]
"region":"az-1.region-a.geo-1", },
"versionId":"1.1", {
"versionInfo":"https://compute.north.host/v1.1/", "name": "Identity",
"versionList":"https://compute.north.host/" "type": "identity",
} "endpoints": [
], {
"endpoints_links":[] "publicURL": "https:\/\/region-a.geo-1.identity.hpcloudsvc.com:35357\/v2.0\/",
} "region": "region-a.geo-1",
] "versionId": "2.0",
} "versionInfo": "https:\/\/region-a.geo-1.identity.hpcloudsvc.com:35357\/v2.0\/",
} "versionList": "https:\/\/region-a.geo-1.identity.hpcloudsvc.com:35357"
},
{
"publicURL": "https:\/\/region-a.geo-1.identity.hpcloudsvc.com:35357\/v3\/",
"region": "region-a.geo-1",
"versionId": "3.0",
"versionInfo": "https:\/\/region-a.geo-1.identity.hpcloudsvc.com:35357\/v3\/",
"versionList": "https:\/\/region-a.geo-1.identity.hpcloudsvc.com:35357"
},
{
"publicURL": "https:\/\/region-b.geo-1.identity.hpcloudsvc.com:35357\/v2.0\/",
"region": "region-b.geo-1",
"versionId": "2.0",
"versionInfo": "https:\/\/region-b.geo-1.identity.hpcloudsvc.com:35357\/v2.0\/",
"versionList": "https:\/\/region-b.geo-1.identity.hpcloudsvc.com:35357"
},
{
"publicURL": "https:\/\/region-b.geo-1.identity.hpcloudsvc.com:35357\/v3\/",
"region": "region-b.geo-1",
"versionId": "3.0",
"versionInfo": "https:\/\/region-b.geo-1.identity.hpcloudsvc.com:35357\/v3\/",
"versionList": "https:\/\/region-b.geo-1.identity.hpcloudsvc.com:35357"
}
]
},
{
"name": "Image Management",
"type": "image",
"endpoints": [
{
"tenantId": "myTenantId",
"publicURL": "https:\/\/glance1.uswest.hpcloud.net:9292\/v1.0",
"publicURL2": "",
"region": "az-1.region-a.geo-1",
"versionId": "1.0",
"versionInfo": "https:\/\/glance1.uswest.hpcloud.net:9292\/v1.0\/",
"versionList": "https:\/\/glance1.uswest.hpcloud.net:9292"
},
{
"tenantId": "myTenantId",
"publicURL": "https:\/\/region-a.geo-1.images.hpcloudsvc.com:443\/v1.0",
"publicURL2": "",
"region": "region-a.geo-1",
"versionId": "1.0",
"versionInfo": "https:\/\/region-a.geo-1.images.hpcloudsvc.com:443\/v1.0",
"versionList": "https:\/\/region-a.geo-1.images.hpcloudsvc.com:443"
},
{
"tenantId": "myTenantId",
"publicURL": "https:\/\/region-b.geo-1.images.hpcloudsvc.com:443\/v1.0",
"publicURL2": "",
"region": "region-b.geo-1",
"versionId": "1.0",
"versionInfo": "https:\/\/region-b.geo-1.images.hpcloudsvc.com:443\/v1.0",
"versionList": "https:\/\/region-b.geo-1.images.hpcloudsvc.com:443"
}
]
},
{
"name": "DNS",
"type": "hpext:dns",
"endpoints": [{
"tenantId": "myTenantId",
"publicURL": "https:\/\/region-a.geo-1.dns.hpcloudsvc.com\/v1\/",
"publicURL2": "",
"region": "region-a.geo-1",
"versionId": "1",
"versionInfo": "https:\/\/region-a.geo-1.dns.hpcloudsvc.com\/v1\/",
"versionList": "https:\/\/region-a.geo-1.dns.hpcloudsvc.com\/"
}]
},
{
"name": "Block Storage",
"type": "volume",
"endpoints": [
{
"tenantId": "myTenantId",
"publicURL": "https:\/\/az-1.region-a.geo-1.compute.hpcloudsvc.com\/v1.1\/myTenantId",
"publicURL2": "",
"region": "az-1.region-a.geo-1",
"versionId": "1.1",
"versionInfo": "https:\/\/az-1.region-a.geo-1.compute.hpcloudsvc.com\/v1.1\/",
"versionList": "https:\/\/az-1.region-a.geo-1.compute.hpcloudsvc.com"
},
{
"tenantId": "myTenantId",
"publicURL": "https:\/\/region-a.geo-1.block.hpcloudsvc.com\/v1\/myTenantId",
"publicURL2": "",
"region": "region-a.geo-1",
"versionId": "1.0",
"versionInfo": "https:\/\/region-a.geo-1.block.hpcloudsvc.com\/v1",
"versionList": "https:\/\/region-a.geo-1.block.hpcloudsvc.com"
},
{
"tenantId": "myTenantId",
"publicURL": "https:\/\/region-b.geo-1.block.hpcloudsvc.com\/v1\/myTenantId",
"publicURL2": "",
"region": "region-b.geo-1",
"versionId": "1.0",
"versionInfo": "https:\/\/region-b.geo-1.block.hpcloudsvc.com\/v1",
"versionList": "https:\/\/region-b.geo-1.block.hpcloudsvc.com"
}
]
},
{
"name": "Compute",
"type": "compute",
"endpoints": [
{
"tenantId": "myTenantId",
"publicURL": "https:\/\/az-1.region-a.geo-1.compute.hpcloudsvc.com\/v1.1\/myTenantId",
"publicURL2": "https:\/\/az-1.region-a.geo-1.ec2-compute.hpcloudsvc.com\/services\/Cloud",
"region": "az-1.region-a.geo-1",
"versionId": "1.1",
"versionInfo": "https:\/\/az-1.region-a.geo-1.compute.hpcloudsvc.com\/v1.1\/",
"versionList": "https:\/\/az-1.region-a.geo-1.compute.hpcloudsvc.com"
},
{
"tenantId": "myTenantId",
"publicURL": "https:\/\/region-a.geo-1.compute.hpcloudsvc.com\/v2\/myTenantId",
"region": "region-a.geo-1",
"versionId": "2",
"versionInfo": "https:\/\/region-a.geo-1.compute.hpcloudsvc.com\/v2\/",
"versionList": "https:\/\/region-a.geo-1.compute.hpcloudsvc.com"
},
{
"tenantId": "myTenantId",
"publicURL": "https:\/\/region-b.geo-1.compute.hpcloudsvc.com\/v2\/myTenantId",
"region": "region-b.geo-1",
"versionId": "2",
"versionInfo": "https:\/\/region-b.geo-1.compute.hpcloudsvc.com\/v2\/",
"versionList": "https:\/\/region-b.geo-1.compute.hpcloudsvc.com"
}
]
}
]
}}

View File

@ -1,116 +1,321 @@
{ {"access": {
"access": { "token": {
"token": { "expires": "2014-04-24T08:52:18.113Z",
"expires": "2012-01-18T21:35:59.050Z", "id": "myToken",
"id": "Auth_4f173437e4b013bee56d1007", "tenant": {
"tenant": { "id": "myTenantId",
"id": "40806637803162", "name": "myTenantName"
"name": "user@jclouds.org-default-tenant" }
} },
"user": {
"id": "myUserId",
"name": "myUsername",
"otherAttributes": {
"domainStatus": "enabled",
"domainStatusCode": "00"
}, },
"user": { "roles": [
"id": "36980896575174", {
"name": "user@jclouds.org", "id": "00000000004004",
"roles": [ "serviceId": "100",
"name": "domainuser"
},
{
"id": "00000000004016",
"serviceId": "120",
"name": "netadmin",
"tenantId": "myTenantId"
},
{
"id": "00000000004014",
"serviceId": "150",
"name": "cdn-admin",
"tenantId": "myTenantId"
},
{
"id": "00000000004022",
"serviceId": "110",
"name": "Admin",
"tenantId": "myTenantId"
},
{
"id": "00000000004024",
"serviceId": "140",
"name": "user",
"tenantId": "myTenantId"
},
{
"id": "00000000004013",
"serviceId": "130",
"name": "block-admin",
"tenantId": "myTenantId"
},
{
"id": "00000000004025",
"serviceId": "120",
"name": "sysadmin",
"tenantId": "myTenantId"
},
{
"id": "91643347410087",
"serviceId": "240",
"name": "dns-admin",
"tenantId": "myTenantId"
},
{
"id": "00000000004003",
"serviceId": "100",
"name": "domainadmin"
},
{
"id": "10419409370304",
"serviceId": "170",
"name": "net-admin",
"tenantId": "myTenantId"
}
]
},
"serviceCatalog": [
{
"name": "Usage Reporting",
"type": "metering",
"endpoints": [
{ {
"id": "00000000004022", "publicURL": "",
"serviceId": "110", "region": "region-a.geo-1",
"name": "Admin", "versionId": "2",
"tenantName": "40806637803162" "versionInfo": "https://region-a.geo-1.usage-reporting-internal.hpcloudsvc.com:8777",
"versionList": "https://region-a.geo-1.usage-reporting-internal.hpcloudsvc.com:8777"
}, },
{ {
"id": "00000000004024", "publicURL": "",
"serviceId": "140", "region": "region-b.geo-1",
"name": "user", "versionId": "2",
"tenantName": "40806637803162" "versionInfo": "https://region-b.geo-1.usage-reporting-internal.hpcloudsvc.com:8777",
}, "versionList": "https://region-b.geo-1.usage-reporting-internal.hpcloudsvc.com:8777"
{
"id": "00000000004004",
"serviceId": "100",
"name": "domainuser"
},
{
"id": "00000000004016",
"serviceId": "120",
"name": "netadmin",
"tenantName": "40806637803162"
} }
] ]
}, },
"serviceCatalog": [ {
{ "name": "Networking",
"name": "CDN", "type": "network",
"type": "hpext:cdn", "endpoints": [
"endpoints": [{ {
"tenantId": "1", "tenantId": "myTenantId",
"publicURL": "https://cdnmgmt.jclouds.org/v1.0/40806637803162", "publicURL": "",
"publicURL2": "",
"region": "az-1.region-a.geo-1",
"versionId": "",
"versionInfo": "",
"versionList": ""
},
{
"tenantId": "myTenantId",
"publicURL": "https://region-a.geo-1.network.hpcloudsvc.com",
"publicURL2": "",
"region": "region-a.geo-1",
"versionId": "2.0",
"versionInfo": "https://region-a.geo-1.network.hpcloudsvc.com",
"versionList": "https://region-a.geo-1.network.hpcloudsvc.com"
},
{
"tenantId": "myTenantId",
"publicURL": "https://region-b.geo-1.network.hpcloudsvc.com",
"publicURL2": "",
"region": "region-b.geo-1",
"versionId": "2.0",
"versionInfo": "https://region-b.geo-1.network.hpcloudsvc.com",
"versionList": "https://region-b.geo-1.network.hpcloudsvc.com"
}
]
},
{
"name": "CDN",
"type": "hpext:cdn",
"endpoints": [
{
"tenantId": "myTenantId",
"publicURL": "https://region-a.geo-1.cdnmgmt.hpcloudsvc.com/v1.0/myTenantId",
"region": "region-a.geo-1", "region": "region-a.geo-1",
"versionId": "1.0", "versionId": "1.0",
"versionInfo":"https://cdnmgmt.jclouds.org/v1.0/", "versionInfo": "https://region-a.geo-1.cdnmgmt.hpcloudsvc.com/v1.0/",
"versionList":"https://cdnmgmt.jclouds.org" "versionList": "https://region-a.geo-1.cdnmgmt.hpcloudsvc.com/"
}] },
}, {
{ "tenantId": "myTenantId",
"name": "Object Storage", "publicURL": "https://region-b.geo-1.cdnmgmt.hpcloudsvc.com/v1.0/myTenantId",
"type": "object-store", "region": "region-b.geo-1",
"endpoints": [ "versionId": "1.0",
{ "versionInfo": "https://region-b.geo-1.cdnmgmt.hpcloudsvc.com/v1.0/",
"tenantName": "40806637803162", "versionList": "https://region-b.geo-1.cdnmgmt.hpcloudsvc.com/"
"adminURL": "https://objects.jclouds.org/v1.0/", }
"publicURL": "https://objects.jclouds.org/v1.0/40806637803162", ]
"region": "region-a.geo-1", },
"id": "1.0" {
} "name": "Object Storage",
] "type": "object-store",
}, "endpoints": [
{ {
"name": "Identity", "tenantId": "myTenantId",
"type": "identity", "publicURL": "https://region-a.geo-1.objects.hpcloudsvc.com/v1/myTenantId",
"endpoints": [ "region": "region-a.geo-1",
{ "versionId": "1.0",
"publicURL": "https://csnode.jclouds.org/v2.0/", "versionInfo": "https://region-a.geo-1.objects.hpcloudsvc.com/v1.0/",
"region": "region-a.geo-1", "versionList": "https://region-a.geo-1.objects.hpcloudsvc.com"
"id": "2.0", },
"list": "https://csnode.jclouds.org/extension" {
} "tenantId": "myTenantId",
] "publicURL": "https://region-b.geo-1.objects.hpcloudsvc.com:443/v1/myTenantId",
}, "region": "region-b.geo-1",
{ "versionId": "1",
"name": "Image Management", "versionInfo": "https://region-b.geo-1.objects.hpcloudsvc.com:443/v1/",
"type": "image", "versionList": "https://region-b.geo-1.objects.hpcloudsvc.com:443"
"endpoints": [ }
{ ]
"tenantName": "40806637803162", },
"publicURL": "https://glance.jclouds.org:9292/v1.0", {
"region": "az-1.region-a.geo-1", "name": "Identity",
"id": "1.0" "type": "identity",
} "endpoints": [
] {
}, "publicURL": "https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/",
{ "region": "region-a.geo-1",
"name":"Cloud Servers", "versionId": "2.0",
"type":"compute", "versionInfo": "https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/",
"endpoints":[{ "versionList": "https://region-a.geo-1.identity.hpcloudsvc.com:35357"
"tenantId":"1", },
"publicURL":"https://compute.north.host/v1/1234", {
"internalURL":"https://compute.north.host/v1/1234", "publicURL": "https://region-a.geo-1.identity.hpcloudsvc.com:35357/v3/",
"region":"az-1.region-a.geo-1", "region": "region-a.geo-1",
"versionId":"1.0", "versionId": "3.0",
"versionInfo":"https://compute.north.host/v1.0/", "versionInfo": "https://region-a.geo-1.identity.hpcloudsvc.com:35357/v3/",
"versionList":"https://compute.north.host/" "versionList": "https://region-a.geo-1.identity.hpcloudsvc.com:35357"
}, },
{ {
"tenantId":"2", "publicURL": "https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/",
"publicURL":"https://compute.north.host/v1.1/3456", "region": "region-b.geo-1",
"internalURL":"https://compute.north.host/v1.1/3456", "versionId": "2.0",
"region":"az-1.region-a.geo-1", "versionInfo": "https://region-b.geo-1.identity.hpcloudsvc.com:35357/v2.0/",
"versionId":"1.1", "versionList": "https://region-b.geo-1.identity.hpcloudsvc.com:35357"
"versionInfo":"https://compute.north.host/v1.1/", },
"versionList":"https://compute.north.host/" {
} "publicURL": "https://region-b.geo-1.identity.hpcloudsvc.com:35357/v3/",
], "region": "region-b.geo-1",
"endpoints_links":[] "versionId": "3.0",
} "versionInfo": "https://region-b.geo-1.identity.hpcloudsvc.com:35357/v3/",
] "versionList": "https://region-b.geo-1.identity.hpcloudsvc.com:35357"
} }
} ]
},
{
"name": "Image Management",
"type": "image",
"endpoints": [
{
"tenantId": "myTenantId",
"publicURL": "https://glance1.uswest.hpcloud.net:9292/v1.0",
"publicURL2": "",
"region": "az-1.region-a.geo-1",
"versionId": "1.0",
"versionInfo": "https://glance1.uswest.hpcloud.net:9292/v1.0/",
"versionList": "https://glance1.uswest.hpcloud.net:9292"
},
{
"tenantId": "myTenantId",
"publicURL": "https://region-a.geo-1.images.hpcloudsvc.com:443/v1.0",
"publicURL2": "",
"region": "region-a.geo-1",
"versionId": "1.0",
"versionInfo": "https://region-a.geo-1.images.hpcloudsvc.com:443/v1.0",
"versionList": "https://region-a.geo-1.images.hpcloudsvc.com:443"
},
{
"tenantId": "myTenantId",
"publicURL": "https://region-b.geo-1.images.hpcloudsvc.com:443/v1.0",
"publicURL2": "",
"region": "region-b.geo-1",
"versionId": "1.0",
"versionInfo": "https://region-b.geo-1.images.hpcloudsvc.com:443/v1.0",
"versionList": "https://region-b.geo-1.images.hpcloudsvc.com:443"
}
]
},
{
"name": "DNS",
"type": "hpext:dns",
"endpoints": [{
"tenantId": "myTenantId",
"publicURL": "https://region-a.geo-1.dns.hpcloudsvc.com/v1/",
"publicURL2": "",
"region": "region-a.geo-1",
"versionId": "1",
"versionInfo": "https://region-a.geo-1.dns.hpcloudsvc.com/v1/",
"versionList": "https://region-a.geo-1.dns.hpcloudsvc.com/"
}]
},
{
"name": "Block Storage",
"type": "volume",
"endpoints": [
{
"tenantId": "myTenantId",
"publicURL": "https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/myTenantId",
"publicURL2": "",
"region": "az-1.region-a.geo-1",
"versionId": "1.1",
"versionInfo": "https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/",
"versionList": "https://az-1.region-a.geo-1.compute.hpcloudsvc.com"
},
{
"tenantId": "myTenantId",
"publicURL": "https://region-a.geo-1.block.hpcloudsvc.com/v1/myTenantId",
"publicURL2": "",
"region": "region-a.geo-1",
"versionId": "1.0",
"versionInfo": "https://region-a.geo-1.block.hpcloudsvc.com/v1",
"versionList": "https://region-a.geo-1.block.hpcloudsvc.com"
},
{
"tenantId": "myTenantId",
"publicURL": "https://region-b.geo-1.block.hpcloudsvc.com/v1/myTenantId",
"publicURL2": "",
"region": "region-b.geo-1",
"versionId": "1.0",
"versionInfo": "https://region-b.geo-1.block.hpcloudsvc.com/v1",
"versionList": "https://region-b.geo-1.block.hpcloudsvc.com"
}
]
},
{
"name": "Compute",
"type": "compute",
"endpoints": [
{
"tenantId": "myTenantId",
"publicURL": "https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/myTenantId",
"publicURL2": "https://az-1.region-a.geo-1.ec2-compute.hpcloudsvc.com/services/Cloud",
"region": "az-1.region-a.geo-1",
"versionId": "1.1",
"versionInfo": "https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/",
"versionList": "https://az-1.region-a.geo-1.compute.hpcloudsvc.com"
},
{
"tenantId": "myTenantId",
"publicURL": "https://region-a.geo-1.compute.hpcloudsvc.com/v2/myTenantId",
"region": "region-a.geo-1",
"versionId": "2",
"versionInfo": "https://region-a.geo-1.compute.hpcloudsvc.com/v2/",
"versionList": "https://region-a.geo-1.compute.hpcloudsvc.com"
},
{
"tenantId": "myTenantId",
"publicURL": "https://region-b.geo-1.compute.hpcloudsvc.com/v2/myTenantId",
"region": "region-b.geo-1",
"versionId": "2",
"versionInfo": "https://region-b.geo-1.compute.hpcloudsvc.com/v2/",
"versionList": "https://region-b.geo-1.compute.hpcloudsvc.com"
}
]
}
]
}}

View File

@ -1,5 +1,5 @@
[ [
{"name":"hpcloud-blobstore.testCDNOperationsContainerWithCDN","cdnEnabled":"false","ttl":3600,"cdnUri":"http://h10cdf69e2913a87afe9ce721ceb35ca5.cdn.hpcloudsvc.com","cdnSslUri":"https://a248.e.akamai.net/cdn.hpcloudsvc.com/h10cdf69e2913a87afe9ce721ceb35ca5/aw2","referrerAcl":"","useragentAcl":"", "logRetention":"false"}, {"name":"hpcloud-blobstore.testCDNOperationsContainerWithCDN","cdn_enabled":"false","ttl":3600,"x-cdn-uri":"http://h10cdf69e2913a87afe9ce721ceb35ca5.cdn.hpcloudsvc.com","x-cdn-ssl-uri":"https://a248.e.akamai.net/cdn.hpcloudsvc.com/h10cdf69e2913a87afe9ce721ceb35ca5/aw2","referrerAcl":"","useragentAcl":"", "log_retention":"false"},
{"name":"hpcloud-blobstore5","cdnEnabled":"true","ttl":28800,"cdnUri":"http://h0bc2984e4ad8f8bec0ebf5b147c9fe55.cdn.hpcloudsvc.com","cdnSslUri":"https://a248.e.akamai.net/cdn.hpcloudsvc.com/h0bc2984e4ad8f8bec0ebf5b147c9fe55/aw2","referrerAcl":"","useragentAcl":"", "logRetention":"false"}, {"name":"hpcloud-blobstore5","cdn_enabled":"true","ttl":28800,"x-cdn-uri":"http://h0bc2984e4ad8f8bec0ebf5b147c9fe55.cdn.hpcloudsvc.com","x-cdn-ssl-uri":"https://a248.e.akamai.net/cdn.hpcloudsvc.com/h0bc2984e4ad8f8bec0ebf5b147c9fe55/aw2","referrerAcl":"","useragentAcl":"", "log_retention":"false"},
{"name":"hpcloud-cfcdnint.testCDNOperationsContainerWithCDN","cdnEnabled":"false","ttl":3600,"cdnUri":"http://h82d1ae1ee2ada5151c60e33f097294c2.cdn.hpcloudsvc.com","cdnSslUri":"https://a248.e.akamai.net/cdn.hpcloudsvc.com/h82d1ae1ee2ada5151c60e33f097294c2/aw2","referrerAcl":"","useragentAcl":"", "logRetention":"false"} {"name":"hpcloud-cfcdnint.testCDNOperationsContainerWithCDN","cdn_enabled":"false","ttl":3600,"x-cdn-uri":"http://h82d1ae1ee2ada5151c60e33f097294c2.cdn.hpcloudsvc.com","x-cdn-ssl-uri":"https://a248.e.akamai.net/cdn.hpcloudsvc.com/h82d1ae1ee2ada5151c60e33f097294c2/aw2","referrerAcl":"","useragentAcl":"", "log_retention":"false"}
] ]