mirror of
https://github.com/apache/jclouds.git
synced 2025-02-16 06:56:45 +00:00
Issue 1022:Move naming convention to Api from Client or Services:: joyent-cloudapi joyentcloud
This commit is contained in:
parent
6d13652338
commit
199d39e093
@ -23,11 +23,11 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.jclouds.concurrent.Timeout;
|
||||
import org.jclouds.javax.annotation.Nullable;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatacenterClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatasetClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.KeyClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.MachineClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.PackageClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatacenterApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatasetApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.KeyApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.MachineApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.PackageApi;
|
||||
import org.jclouds.location.Zone;
|
||||
import org.jclouds.location.functions.ZoneToEndpoint;
|
||||
import org.jclouds.rest.annotations.Delegate;
|
||||
@ -39,12 +39,12 @@ import com.google.inject.Provides;
|
||||
* Provides synchronous access to JoyentCloud.
|
||||
* <p/>
|
||||
*
|
||||
* @see JoyentCloudAsyncClient
|
||||
* @see JoyentCloudAsyncApi
|
||||
* @see <a href="http://cloudApi.joyent.org/cloudApiapi.html">api doc</a>
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
|
||||
public interface JoyentCloudClient {
|
||||
public interface JoyentCloudApi {
|
||||
|
||||
/**
|
||||
*
|
||||
@ -58,32 +58,32 @@ public interface JoyentCloudClient {
|
||||
* Provides synchronous access to Datacenter features.
|
||||
*/
|
||||
@Delegate
|
||||
DatacenterClient getDatacenterClient();
|
||||
DatacenterApi getDatacenterApi();
|
||||
|
||||
/**
|
||||
* Provides synchronous access to Key features.
|
||||
*/
|
||||
@Delegate
|
||||
KeyClient getKeyClient();
|
||||
KeyApi getKeyApi();
|
||||
|
||||
/**
|
||||
* Provides synchronous access to Machine features.
|
||||
*/
|
||||
@Delegate
|
||||
MachineClient getMachineClientForDatacenter(
|
||||
MachineApi getMachineApiForDatacenter(
|
||||
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String datacenter);
|
||||
|
||||
/**
|
||||
* Provides synchronous access to Dataset features.
|
||||
*/
|
||||
@Delegate
|
||||
DatasetClient getDatasetClientForDatacenter(
|
||||
DatasetApi getDatasetApiForDatacenter(
|
||||
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String datacenter);
|
||||
|
||||
/**
|
||||
* Provides synchronous access to Package features.
|
||||
*/
|
||||
@Delegate
|
||||
PackageClient getPackageClientForDatacenter(
|
||||
PackageApi getPackageApiForDatacenter(
|
||||
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String datacenter);
|
||||
}
|
@ -44,7 +44,7 @@ public class JoyentCloudApiMetadata extends BaseRestApiMetadata {
|
||||
/** The serialVersionUID */
|
||||
private static final long serialVersionUID = 6725672099385580694L;
|
||||
|
||||
public static final TypeToken<RestContext<JoyentCloudClient, JoyentCloudAsyncClient>> CONTEXT_TOKEN = new TypeToken<RestContext<JoyentCloudClient, JoyentCloudAsyncClient>>() {
|
||||
public static final TypeToken<RestContext<JoyentCloudApi, JoyentCloudAsyncApi>> CONTEXT_TOKEN = new TypeToken<RestContext<JoyentCloudApi, JoyentCloudAsyncApi>>() {
|
||||
private static final long serialVersionUID = -5070937833892503232L;
|
||||
};
|
||||
|
||||
@ -70,7 +70,7 @@ public class JoyentCloudApiMetadata extends BaseRestApiMetadata {
|
||||
public static class Builder extends BaseRestApiMetadata.Builder {
|
||||
|
||||
protected Builder() {
|
||||
super(JoyentCloudClient.class, JoyentCloudAsyncClient.class);
|
||||
super(JoyentCloudApi.class, JoyentCloudAsyncApi.class);
|
||||
id("joyent-cloudapi")
|
||||
.name("Joyent Cloud API")
|
||||
.identityName("username")
|
||||
|
@ -21,11 +21,11 @@ package org.jclouds.joyent.cloudapi.v6_5;
|
||||
import java.util.Set;
|
||||
|
||||
import org.jclouds.javax.annotation.Nullable;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatacenterAsyncClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatasetAsyncClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.KeyAsyncClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.MachineAsyncClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.PackageAsyncClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatacenterAsyncApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatasetAsyncApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.KeyAsyncApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.MachineAsyncApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.PackageAsyncApi;
|
||||
import org.jclouds.location.Zone;
|
||||
import org.jclouds.location.functions.ZoneToEndpoint;
|
||||
import org.jclouds.rest.annotations.Delegate;
|
||||
@ -37,11 +37,11 @@ import com.google.inject.Provides;
|
||||
* Provides asynchronous access to JoyentCloud via their REST API.
|
||||
* <p/>
|
||||
*
|
||||
* @see JoyentCloudClient
|
||||
* @see JoyentCloudApi
|
||||
* @see <a href="http://cloudApi.joyent.org/cloudApiapi.html">api doc</a>
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
public interface JoyentCloudAsyncClient {
|
||||
public interface JoyentCloudAsyncApi {
|
||||
|
||||
/**
|
||||
*
|
||||
@ -55,32 +55,32 @@ public interface JoyentCloudAsyncClient {
|
||||
* Provides asynchronous access to Datacenter features.
|
||||
*/
|
||||
@Delegate
|
||||
DatacenterAsyncClient getDatacenterClient();
|
||||
DatacenterAsyncApi getDatacenterApi();
|
||||
|
||||
/**
|
||||
* Provides asynchronous access to Key features.
|
||||
*/
|
||||
@Delegate
|
||||
KeyAsyncClient getKeyClient();
|
||||
KeyAsyncApi getKeyApi();
|
||||
|
||||
/**
|
||||
* Provides asynchronous access to Machine features.
|
||||
*/
|
||||
@Delegate
|
||||
MachineAsyncClient getMachineClientForDatacenter(
|
||||
MachineAsyncApi getMachineApiForDatacenter(
|
||||
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String datacenter);
|
||||
|
||||
/**
|
||||
* Provides asynchronous access to Dataset features.
|
||||
*/
|
||||
@Delegate
|
||||
DatasetAsyncClient getDatasetClientForDatacenter(
|
||||
DatasetAsyncApi getDatasetApiForDatacenter(
|
||||
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String datacenter);
|
||||
|
||||
/**
|
||||
* Provides asynchronous access to Package features.
|
||||
*/
|
||||
@Delegate
|
||||
PackageAsyncClient getPackageClientForDatacenter(
|
||||
PackageAsyncApi getPackageApiForDatacenter(
|
||||
@EndpointParam(parser = ZoneToEndpoint.class) @Nullable String datacenter);
|
||||
}
|
@ -58,12 +58,12 @@ import org.jclouds.compute.strategy.ResumeNodeStrategy;
|
||||
import org.jclouds.compute.strategy.SuspendNodeStrategy;
|
||||
import org.jclouds.domain.Credentials;
|
||||
import org.jclouds.domain.Location;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.compute.internal.KeyAndPrivateKey;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.compute.options.JoyentCloudTemplateOptions;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.domain.Key;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.domain.datacenterscoped.DatacenterAndName;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.KeyClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.KeyApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.predicates.KeyPredicates;
|
||||
import org.jclouds.scriptbuilder.functions.InitAdminAccess;
|
||||
|
||||
@ -81,7 +81,7 @@ import com.google.common.collect.Multimap;
|
||||
*/
|
||||
@Singleton
|
||||
public class JoyentCloudComputeService extends BaseComputeService {
|
||||
protected final JoyentCloudClient novaClient;
|
||||
protected final JoyentCloudApi novaApi;
|
||||
protected final LoadingCache<DatacenterAndName, KeyAndPrivateKey> keyCache;
|
||||
protected final Function<Set<? extends NodeMetadata>, Multimap<String, String>> orphanedGroupsByDatacenterId;
|
||||
protected final GroupNamingConvention.Factory namingConvention;
|
||||
@ -101,7 +101,7 @@ public class JoyentCloudComputeService extends BaseComputeService {
|
||||
InitializeRunScriptOnNodeOrPlaceInBadMap.Factory initScriptRunnerFactory,
|
||||
RunScriptOnNode.Factory runScriptOnNodeFactory, InitAdminAccess initAdminAccess,
|
||||
PersistNodeCredentials persistNodeCredentials, Timeouts timeouts,
|
||||
@Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor, JoyentCloudClient novaClient,
|
||||
@Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor, JoyentCloudApi novaApi,
|
||||
LoadingCache<DatacenterAndName, KeyAndPrivateKey> keyCache,
|
||||
Function<Set<? extends NodeMetadata>, Multimap<String, String>> orphanedGroupsByDatacenterId,
|
||||
GroupNamingConvention.Factory namingConvention, Optional<ImageExtension> imageExtension) {
|
||||
@ -110,7 +110,7 @@ public class JoyentCloudComputeService extends BaseComputeService {
|
||||
startNodeStrategy, stopNodeStrategy, templateBuilderProvider, templateOptionsProvider, nodeRunning,
|
||||
nodeTerminated, nodeSuspended, initScriptRunnerFactory, initAdminAccess, runScriptOnNodeFactory,
|
||||
persistNodeCredentials, timeouts, executor, imageExtension);
|
||||
this.novaClient = checkNotNull(novaClient, "novaClient");
|
||||
this.novaApi = checkNotNull(novaApi, "novaApi");
|
||||
this.keyCache = checkNotNull(keyCache, "keyCache");
|
||||
this.orphanedGroupsByDatacenterId = checkNotNull(orphanedGroupsByDatacenterId, "orphanedGroupsByDatacenterId");
|
||||
this.namingConvention = checkNotNull(namingConvention, "namingConvention");
|
||||
@ -125,13 +125,13 @@ public class JoyentCloudComputeService extends BaseComputeService {
|
||||
}
|
||||
|
||||
private void cleanupOrphanedKeysInZone(Set<String> groups, String datacenterId) {
|
||||
KeyClient keyClient = novaClient.getKeyClient();
|
||||
KeyApi keyApi = novaApi.getKeyApi();
|
||||
for (String group : groups) {
|
||||
for (Key key : Iterables.filter(keyClient.list(),
|
||||
for (Key key : Iterables.filter(keyApi.list(),
|
||||
KeyPredicates.nameMatches(namingConvention.create().containsGroup(group)))) {
|
||||
DatacenterAndName datacenterAndName = DatacenterAndName.fromDatacenterAndName(datacenterId, key.getName());
|
||||
logger.debug(">> deleting key(%s)", datacenterAndName);
|
||||
keyClient.delete(key.getName());
|
||||
keyApi.delete(key.getName());
|
||||
// TODO: test this clear happens
|
||||
keyCache.invalidate(datacenterAndName);
|
||||
logger.debug("<< deleted key(%s)", datacenterAndName);
|
||||
|
@ -33,7 +33,7 @@ import org.jclouds.compute.domain.Template;
|
||||
import org.jclouds.compute.reference.ComputeServiceConstants;
|
||||
import org.jclouds.domain.Location;
|
||||
import org.jclouds.domain.LoginCredentials;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.domain.Dataset;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.domain.Machine;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.domain.datacenterscoped.DatacenterAndId;
|
||||
@ -62,12 +62,12 @@ public class JoyentCloudComputeServiceAdapter implements
|
||||
@Named(ComputeServiceConstants.COMPUTE_LOGGER)
|
||||
protected Logger logger = Logger.NULL;
|
||||
|
||||
protected final JoyentCloudClient cloudApiClient;
|
||||
protected final JoyentCloudApi cloudApiApi;
|
||||
protected final Supplier<Set<String>> datacenterIds;
|
||||
|
||||
@Inject
|
||||
public JoyentCloudComputeServiceAdapter(JoyentCloudClient cloudApiClient, @Zone Supplier<Set<String>> datacenterIds) {
|
||||
this.cloudApiClient = checkNotNull(cloudApiClient, "cloudApiClient");
|
||||
public JoyentCloudComputeServiceAdapter(JoyentCloudApi cloudApiApi, @Zone Supplier<Set<String>> datacenterIds) {
|
||||
this.cloudApiApi = checkNotNull(cloudApiApi, "cloudApiApi");
|
||||
this.datacenterIds = checkNotNull(datacenterIds, "datacenterIds");
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ public class JoyentCloudComputeServiceAdapter implements
|
||||
|
||||
logger.debug(">> creating new machine datacenter(%s) datasetURN(%s) options(%s)", datacenterId, datasetURN,
|
||||
options);
|
||||
Machine machine = cloudApiClient.getMachineClientForDatacenter(datacenterId).createWithDataset(datasetURN, options);
|
||||
Machine machine = cloudApiApi.getMachineApiForDatacenter(datacenterId).createWithDataset(datasetURN, options);
|
||||
|
||||
logger.trace("<< machine(%s)", machine.getId());
|
||||
|
||||
@ -105,7 +105,7 @@ public class JoyentCloudComputeServiceAdapter implements
|
||||
public Iterable<PackageInDatacenter> listHardwareProfiles() {
|
||||
Builder<PackageInDatacenter> builder = ImmutableSet.builder();
|
||||
for (final String datacenterId : datacenterIds.get()) {
|
||||
builder.addAll(transform(cloudApiClient.getPackageClientForDatacenter(datacenterId).list(),
|
||||
builder.addAll(transform(cloudApiApi.getPackageApiForDatacenter(datacenterId).list(),
|
||||
new Function<org.jclouds.joyent.cloudapi.v6_5.domain.Package, PackageInDatacenter>() {
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class JoyentCloudComputeServiceAdapter implements
|
||||
public Iterable<DatasetInDatacenter> listImages() {
|
||||
Builder<DatasetInDatacenter> builder = ImmutableSet.builder();
|
||||
for (final String datacenterId : datacenterIds.get()) {
|
||||
builder.addAll(transform(cloudApiClient.getDatasetClientForDatacenter(datacenterId).list(),
|
||||
builder.addAll(transform(cloudApiApi.getDatasetApiForDatacenter(datacenterId).list(),
|
||||
new Function<Dataset, DatasetInDatacenter>() {
|
||||
|
||||
@Override
|
||||
@ -139,7 +139,7 @@ public class JoyentCloudComputeServiceAdapter implements
|
||||
public Iterable<MachineInDatacenter> listNodes() {
|
||||
Builder<MachineInDatacenter> builder = ImmutableSet.builder();
|
||||
for (final String datacenterId : datacenterIds.get()) {
|
||||
builder.addAll(transform(cloudApiClient.getMachineClientForDatacenter(datacenterId).list(),
|
||||
builder.addAll(transform(cloudApiApi.getMachineApiForDatacenter(datacenterId).list(),
|
||||
new Function<Machine, MachineInDatacenter>() {
|
||||
|
||||
@Override
|
||||
@ -161,7 +161,7 @@ public class JoyentCloudComputeServiceAdapter implements
|
||||
@Override
|
||||
public MachineInDatacenter getNode(String id) {
|
||||
DatacenterAndId datacenterAndId = DatacenterAndId.fromSlashEncoded(id);
|
||||
Machine machine = cloudApiClient.getMachineClientForDatacenter(datacenterAndId.getDatacenter()).get(
|
||||
Machine machine = cloudApiApi.getMachineApiForDatacenter(datacenterAndId.getDatacenter()).get(
|
||||
datacenterAndId.getId());
|
||||
return machine == null ? null : new MachineInDatacenter(machine, datacenterAndId.getDatacenter());
|
||||
}
|
||||
@ -169,7 +169,7 @@ public class JoyentCloudComputeServiceAdapter implements
|
||||
@Override
|
||||
public DatasetInDatacenter getImage(String id) {
|
||||
DatacenterAndId datacenterAndId = DatacenterAndId.fromSlashEncoded(id);
|
||||
Dataset dataset = cloudApiClient.getDatasetClientForDatacenter(datacenterAndId.getDatacenter()).get(
|
||||
Dataset dataset = cloudApiApi.getDatasetApiForDatacenter(datacenterAndId.getDatacenter()).get(
|
||||
datacenterAndId.getId());
|
||||
return dataset == null ? null : new DatasetInDatacenter(dataset, datacenterAndId.getDatacenter());
|
||||
}
|
||||
@ -177,26 +177,26 @@ public class JoyentCloudComputeServiceAdapter implements
|
||||
@Override
|
||||
public void destroyNode(String id) {
|
||||
DatacenterAndId datacenterAndId = DatacenterAndId.fromSlashEncoded(id);
|
||||
cloudApiClient.getMachineClientForDatacenter(datacenterAndId.getDatacenter()).delete(datacenterAndId.getId());
|
||||
cloudApiApi.getMachineApiForDatacenter(datacenterAndId.getDatacenter()).delete(datacenterAndId.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rebootNode(String id) {
|
||||
DatacenterAndId datacenterAndId = DatacenterAndId.fromSlashEncoded(id);
|
||||
cloudApiClient.getMachineClientForDatacenter(datacenterAndId.getDatacenter()).reboot(datacenterAndId.getId());
|
||||
cloudApiApi.getMachineApiForDatacenter(datacenterAndId.getDatacenter()).reboot(datacenterAndId.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resumeNode(String id) {
|
||||
DatacenterAndId datacenterAndId = DatacenterAndId.fromSlashEncoded(id);
|
||||
cloudApiClient.getMachineClientForDatacenter(datacenterAndId.getDatacenter()).stop(datacenterAndId.getId());
|
||||
cloudApiApi.getMachineApiForDatacenter(datacenterAndId.getDatacenter()).stop(datacenterAndId.getId());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void suspendNode(String id) {
|
||||
DatacenterAndId datacenterAndId = DatacenterAndId.fromSlashEncoded(id);
|
||||
cloudApiClient.getMachineClientForDatacenter(datacenterAndId.getDatacenter()).start(datacenterAndId.getId());
|
||||
cloudApiApi.getMachineApiForDatacenter(datacenterAndId.getDatacenter()).start(datacenterAndId.getId());
|
||||
|
||||
}
|
||||
|
||||
|
@ -174,4 +174,4 @@ public class JoyentCloudComputeServiceContextModule extends
|
||||
return toPortableNodeStatus;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -73,4 +73,4 @@ public class OrphanedGroupsByDatacenterId implements Function<Set<? extends Node
|
||||
return datacenterToDatacenterAndGroupNames;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ import org.jclouds.compute.functions.GroupNamingConvention;
|
||||
import org.jclouds.compute.reference.ComputeServiceConstants;
|
||||
import org.jclouds.crypto.Crypto;
|
||||
import org.jclouds.crypto.SshKeys;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.compute.internal.KeyAndPrivateKey;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.domain.Key;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.domain.datacenterscoped.DatacenterAndName;
|
||||
@ -49,14 +49,14 @@ public class CreateUniqueKey extends CacheLoader<DatacenterAndName, KeyAndPrivat
|
||||
@Resource
|
||||
@Named(ComputeServiceConstants.COMPUTE_LOGGER)
|
||||
protected Logger logger = Logger.NULL;
|
||||
protected final JoyentCloudClient cloudApiClient;
|
||||
protected final JoyentCloudApi cloudApiApi;
|
||||
protected final GroupNamingConvention.Factory namingConvention;
|
||||
protected final Crypto crypto;
|
||||
protected final Provider<SecureRandom> secureRandom;
|
||||
|
||||
@Inject
|
||||
public CreateUniqueKey(JoyentCloudClient cloudApiClient, GroupNamingConvention.Factory namingConvention, Crypto crypto, Provider<SecureRandom> secureRandom) {
|
||||
this.cloudApiClient = checkNotNull(cloudApiClient, "cloudApiClient");
|
||||
public CreateUniqueKey(JoyentCloudApi cloudApiApi, GroupNamingConvention.Factory namingConvention, Crypto crypto, Provider<SecureRandom> secureRandom) {
|
||||
this.cloudApiApi = checkNotNull(cloudApiApi, "cloudApiApi");
|
||||
this.namingConvention = checkNotNull(namingConvention, "namingConvention");
|
||||
this.crypto = checkNotNull(crypto, "crypto");
|
||||
this.secureRandom = checkNotNull(secureRandom, "secureRandom");
|
||||
@ -77,7 +77,7 @@ public class CreateUniqueKey extends CacheLoader<DatacenterAndName, KeyAndPrivat
|
||||
while (key == null) {
|
||||
String name = namingConvention.createWithoutPrefix().uniqueNameForGroup(prefix);
|
||||
try {
|
||||
key = cloudApiClient.getKeyClient().create(Key.builder().name(name).key(publicKey).build());
|
||||
key = cloudApiApi.getKeyApi().create(Key.builder().name(name).key(publicKey).build());
|
||||
} catch (IllegalStateException e) {
|
||||
logger.trace("error creating keypair named %s, %s", name, e.getMessage());
|
||||
}
|
||||
|
@ -40,9 +40,9 @@ import com.google.common.base.Objects.ToStringHelper;
|
||||
* <code>
|
||||
* import static org.jclouds.joyent.cloudapi.v6_5.compute.options.JoyentCloudTemplateOptions.Builder.*;
|
||||
* <p/>
|
||||
* ComputeService client = // get connection
|
||||
* ComputeService api = // get connection
|
||||
* templateBuilder.options(inboundPorts(22, 80, 8080, 443));
|
||||
* Set<? extends NodeMetadata> set = client.createNodesInGroup(tag, 2, templateBuilder.build());
|
||||
* Set<? extends NodeMetadata> set = api.createNodesInGroup(tag, 2, templateBuilder.build());
|
||||
* <code>
|
||||
*
|
||||
* @author Adrian Cole
|
||||
|
@ -49,4 +49,4 @@ public class AllNodesInGroupTerminated implements Predicate<DatacenterAndName> {
|
||||
public boolean apply(DatacenterAndName input) {
|
||||
return all(computeService.listNodesDetailsMatching(locationId(input.getDatacenter())), and(inGroup(input.getName()), TERMINATED));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -92,4 +92,4 @@ public class ApplyJoyentCloudTemplateOptionsCreateNodesWithGroupEncodedIntoNameT
|
||||
"when specifying runScript, you must either set overrideLoginPrivateKey, or generateKey(true)");
|
||||
return super.execute(group, count, mutableTemplate, goodNodes, badNodes, customizationResponses);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,9 +20,9 @@ package org.jclouds.joyent.cloudapi.v6_5.config;
|
||||
|
||||
import static org.jclouds.rest.config.BinderUtils.bindClientAndAsyncClient;
|
||||
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatacenterAsyncClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatacenterClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.suppliers.ZoneIdToURIFromDatacentersClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatacenterAsyncApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatacenterApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.suppliers.ZoneIdToURIFromDatacentersApi;
|
||||
import org.jclouds.location.suppliers.ImplicitLocationSupplier;
|
||||
import org.jclouds.location.suppliers.ZoneIdToURISupplier;
|
||||
import org.jclouds.location.suppliers.ZoneIdsSupplier;
|
||||
@ -40,10 +40,10 @@ public class DatacentersAreZonesModule extends AbstractModule {
|
||||
|
||||
@Override
|
||||
protected void configure() {
|
||||
// datacenter client is needed for obtaining zone ids
|
||||
bindClientAndAsyncClient(binder(), DatacenterClient.class, DatacenterAsyncClient.class);
|
||||
// datacenter api is needed for obtaining zone ids
|
||||
bindClientAndAsyncClient(binder(), DatacenterApi.class, DatacenterAsyncApi.class);
|
||||
bind(ImplicitLocationSupplier.class).to(OnlyLocationOrFirstZone.class).in(Scopes.SINGLETON);
|
||||
bind(ZoneIdToURISupplier.class).to(ZoneIdToURIFromDatacentersClient.class).in(Scopes.SINGLETON);
|
||||
bind(ZoneIdToURISupplier.class).to(ZoneIdToURIFromDatacentersApi.class).in(Scopes.SINGLETON);
|
||||
bind(ZoneIdsSupplier.class).to(ZoneIdsFromZoneIdToURIKeySet.class).in(Scopes.SINGLETON);
|
||||
}
|
||||
}
|
||||
|
@ -24,18 +24,18 @@ 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.joyent.cloudapi.v6_5.JoyentCloudAsyncClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatacenterAsyncClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatacenterClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatasetAsyncClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatasetClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.KeyAsyncClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.KeyClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.MachineAsyncClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.MachineClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.PackageAsyncClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.PackageClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudAsyncApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatacenterAsyncApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatacenterApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatasetAsyncApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatasetApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.KeyAsyncApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.KeyApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.MachineAsyncApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.MachineApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.PackageAsyncApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.PackageApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.handlers.JoyentCloudErrorHandler;
|
||||
import org.jclouds.json.config.GsonModule.DateAdapter;
|
||||
import org.jclouds.json.config.GsonModule.Iso8601DateAdapter;
|
||||
@ -50,13 +50,13 @@ import com.google.common.collect.ImmutableMap;
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@ConfiguresRestClient
|
||||
public class JoyentCloudRestClientModule extends RestClientModule<JoyentCloudClient, JoyentCloudAsyncClient> {
|
||||
public class JoyentCloudRestClientModule extends RestClientModule<JoyentCloudApi, JoyentCloudAsyncApi> {
|
||||
public static final Map<Class<?>, Class<?>> DELEGATE_MAP = ImmutableMap.<Class<?>, Class<?>> builder()
|
||||
.put(DatacenterClient.class, DatacenterAsyncClient.class)
|
||||
.put(KeyClient.class, KeyAsyncClient.class)
|
||||
.put(MachineClient.class, MachineAsyncClient.class)
|
||||
.put(DatasetClient.class, DatasetAsyncClient.class)
|
||||
.put(PackageClient.class, PackageAsyncClient.class).build();
|
||||
.put(DatacenterApi.class, DatacenterAsyncApi.class)
|
||||
.put(KeyApi.class, KeyAsyncApi.class)
|
||||
.put(MachineApi.class, MachineAsyncApi.class)
|
||||
.put(DatasetApi.class, DatasetAsyncApi.class)
|
||||
.put(PackageApi.class, PackageAsyncApi.class).build();
|
||||
|
||||
public JoyentCloudRestClientModule() {
|
||||
super(DELEGATE_MAP);
|
||||
|
@ -27,12 +27,12 @@ import org.jclouds.concurrent.Timeout;
|
||||
/**
|
||||
* Datacenter Services
|
||||
*
|
||||
* @see DatacenterAsyncClient
|
||||
* @see DatacenterAsyncApi
|
||||
* @author Adrian Cole
|
||||
* @see <a href="http://cloudApi.joyent.org/cloudApiapi.html">api doc</a>
|
||||
*/
|
||||
@Timeout(duration = 30, timeUnit = TimeUnit.SECONDS)
|
||||
public interface DatacenterClient {
|
||||
public interface DatacenterApi {
|
||||
|
||||
/**
|
||||
* Provides a list of all datacenters this cloud is aware of.
|
@ -38,17 +38,17 @@ import com.google.common.util.concurrent.ListenableFuture;
|
||||
/**
|
||||
* Datacenter Services
|
||||
*
|
||||
* @see DatacenterClient
|
||||
* @see DatacenterApi
|
||||
* @author Adrian Cole
|
||||
* @see <a href="http://cloudApi.joyent.org/cloudApiapi.html">api doc</a>
|
||||
*/
|
||||
@SkipEncoding({ '/', '=' })
|
||||
@Headers(keys = "X-Api-Version", values = "{jclouds.api-version}")
|
||||
@RequestFilters(BasicAuthentication.class)
|
||||
public interface DatacenterAsyncClient {
|
||||
public interface DatacenterAsyncApi {
|
||||
|
||||
/**
|
||||
* @see DatacenterClient#getDatacenters
|
||||
* @see DatacenterApi#getDatacenters
|
||||
*/
|
||||
@GET
|
||||
@Path("/my/datacenters")
|
@ -11,11 +11,11 @@ import org.jclouds.joyent.cloudapi.v6_5.domain.Dataset;
|
||||
* <p/>
|
||||
*
|
||||
* @author Gerald Pereira
|
||||
* @see DatasetAsyncClient
|
||||
* @see DatasetAsyncApi
|
||||
* @see <a href="http://apidocs.joyent.com/cloudApiapidoc/cloudapi">api doc</a>
|
||||
*/
|
||||
@Timeout(duration = 30, timeUnit = TimeUnit.SECONDS)
|
||||
public interface DatasetClient {
|
||||
public interface DatasetApi {
|
||||
|
||||
/**
|
||||
* Provides a list of datasets available in this datacenter.
|
@ -24,15 +24,15 @@ import com.google.common.util.concurrent.ListenableFuture;
|
||||
* <p/>
|
||||
*
|
||||
* @author Gerald Pereira
|
||||
* @see DatasetClient
|
||||
* @see DatasetApi
|
||||
* @see <a href="http://apidocs.joyent.com/cloudApiapidoc/cloudapi">api doc</a>
|
||||
*/
|
||||
@SkipEncoding({ '/', '=' })
|
||||
@Headers(keys = "X-Api-Version", values = "{jclouds.api-version}")
|
||||
@RequestFilters(BasicAuthentication.class)
|
||||
public interface DatasetAsyncClient {
|
||||
public interface DatasetAsyncApi {
|
||||
/**
|
||||
* @see DatasetClient#list
|
||||
* @see DatasetApi#list
|
||||
*/
|
||||
@GET
|
||||
@Path("/my/datasets")
|
||||
@ -41,7 +41,7 @@ public interface DatasetAsyncClient {
|
||||
ListenableFuture<Set<Dataset>> list();
|
||||
|
||||
/**
|
||||
* @see DatasetClient#get
|
||||
* @see DatasetApi#get
|
||||
*/
|
||||
@GET
|
||||
@Path("/my/datasets/{id}")
|
@ -11,11 +11,11 @@ import org.jclouds.joyent.cloudapi.v6_5.domain.Key;
|
||||
* CloudAPI supports uploads of public keys in the OpenSSH format.
|
||||
*
|
||||
* @author Adrian Cole
|
||||
* @see KeyAsyncClient
|
||||
* @see KeyAsyncApi
|
||||
* @see <a href="http://apidocs.joyent.com/cloudApiapidoc/cloudapi/#keys">api doc</a>
|
||||
*/
|
||||
@Timeout(duration = 30, timeUnit = TimeUnit.SECONDS)
|
||||
public interface KeyClient {
|
||||
public interface KeyApi {
|
||||
|
||||
/**
|
||||
* Lists all public keys we have on record for the specified account.
|
@ -25,15 +25,15 @@ import com.google.common.util.concurrent.ListenableFuture;
|
||||
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
* @see KeyClient
|
||||
* @see KeyApi
|
||||
* @see <a href="http://apidocs.joyent.com/cloudApiapidoc/cloudapi/#keys">api doc</a>
|
||||
*/
|
||||
@SkipEncoding({ '/', '=' })
|
||||
@Headers(keys = "X-Api-Version", values = "{jclouds.api-version}")
|
||||
@RequestFilters(BasicAuthentication.class)
|
||||
public interface KeyAsyncClient {
|
||||
public interface KeyAsyncApi {
|
||||
/**
|
||||
* @see KeyClient#list
|
||||
* @see KeyApi#list
|
||||
*/
|
||||
@GET
|
||||
@Path("/my/keys")
|
||||
@ -42,7 +42,7 @@ public interface KeyAsyncClient {
|
||||
ListenableFuture<Set<Key>> list();
|
||||
|
||||
/**
|
||||
* @see KeyClient#get
|
||||
* @see KeyApi#get
|
||||
*/
|
||||
@GET
|
||||
@Path("/my/keys/{name}")
|
||||
@ -51,7 +51,7 @@ public interface KeyAsyncClient {
|
||||
ListenableFuture<Key> get(@PathParam("name") String name);
|
||||
|
||||
/**
|
||||
* @see KeyClient#create
|
||||
* @see KeyApi#create
|
||||
*/
|
||||
@POST
|
||||
@Path("/my/keys")
|
||||
@ -59,7 +59,7 @@ public interface KeyAsyncClient {
|
||||
ListenableFuture<Key> create(@BinderParam(BindKeyToJsonPayload.class) Key key);
|
||||
|
||||
/**
|
||||
* @see KeyClient#delete
|
||||
* @see KeyApi#delete
|
||||
*/
|
||||
@DELETE
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
@ -30,11 +30,11 @@ import org.jclouds.joyent.cloudapi.v6_5.options.CreateMachineOptions;
|
||||
* <p/>
|
||||
*
|
||||
* @author Gerald Pereira
|
||||
* @see MachineAsyncClient
|
||||
* @see MachineAsyncApi
|
||||
* @see <a href="http://apidocs.joyent.com/cloudApiapidoc/cloudapi">api doc</a>
|
||||
*/
|
||||
@Timeout(duration = 30, timeUnit = TimeUnit.SECONDS)
|
||||
public interface MachineClient {
|
||||
public interface MachineApi {
|
||||
|
||||
/**
|
||||
* Lists all machines we have on record for your account.
|
||||
@ -135,4 +135,4 @@ public interface MachineClient {
|
||||
*/
|
||||
void delete(String id);
|
||||
|
||||
}
|
||||
}
|
@ -49,16 +49,16 @@ import com.google.common.util.concurrent.ListenableFuture;
|
||||
* <p/>
|
||||
*
|
||||
* @author Gerald Pereira
|
||||
* @see MachineClient
|
||||
* @see MachineApi
|
||||
* @see <a href="http://apidocs.joyent.com/cloudApiapidoc/cloudapi">api doc</a>
|
||||
*/
|
||||
@SkipEncoding({ '/', '=' })
|
||||
@Headers(keys = "X-Api-Version", values = "{jclouds.api-version}")
|
||||
@RequestFilters(BasicAuthentication.class)
|
||||
public interface MachineAsyncClient {
|
||||
public interface MachineAsyncApi {
|
||||
|
||||
/**
|
||||
* @see MachineClient#list
|
||||
* @see MachineApi#list
|
||||
*/
|
||||
@GET
|
||||
@Path("/my/machines")
|
||||
@ -67,7 +67,7 @@ public interface MachineAsyncClient {
|
||||
ListenableFuture<Set<Machine>> list();
|
||||
|
||||
/**
|
||||
* @see MachineClient#get
|
||||
* @see MachineApi#get
|
||||
*/
|
||||
@GET
|
||||
@Path("/my/machines/{id}")
|
||||
@ -76,7 +76,7 @@ public interface MachineAsyncClient {
|
||||
ListenableFuture<Machine> get(@PathParam("id") String id);
|
||||
|
||||
/**
|
||||
* @see MachineClient#createWithDataset(String)
|
||||
* @see MachineApi#createWithDataset(String)
|
||||
*/
|
||||
@POST
|
||||
@Path("/my/machines")
|
||||
@ -84,7 +84,7 @@ public interface MachineAsyncClient {
|
||||
ListenableFuture<Machine> createWithDataset(@QueryParam("dataset") String datasetURN);
|
||||
|
||||
/**
|
||||
* @see MachineClient#createWithDataset(String, CreateMachineOptions)
|
||||
* @see MachineApi#createWithDataset(String, CreateMachineOptions)
|
||||
*/
|
||||
@POST
|
||||
@Path("/my/machines")
|
||||
@ -92,7 +92,7 @@ public interface MachineAsyncClient {
|
||||
ListenableFuture<Machine> createWithDataset(@QueryParam("dataset") String datasetURN, CreateMachineOptions options);
|
||||
|
||||
/**
|
||||
* @see MachineClient#stop
|
||||
* @see MachineApi#stop
|
||||
*/
|
||||
@POST
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ -102,7 +102,7 @@ public interface MachineAsyncClient {
|
||||
ListenableFuture<Void> stop(@PathParam("id") String id);
|
||||
|
||||
/**
|
||||
* @see MachineClient#start
|
||||
* @see MachineApi#start
|
||||
*/
|
||||
@POST
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ -112,7 +112,7 @@ public interface MachineAsyncClient {
|
||||
ListenableFuture<Void> start(@PathParam("id") String id);
|
||||
|
||||
/**
|
||||
* @see MachineClient#reboot
|
||||
* @see MachineApi#reboot
|
||||
*/
|
||||
@POST
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ -122,7 +122,7 @@ public interface MachineAsyncClient {
|
||||
ListenableFuture<Void> reboot(@PathParam("id") String id);
|
||||
|
||||
/**
|
||||
* @see MachineClient#resize
|
||||
* @see MachineApi#resize
|
||||
*/
|
||||
@POST
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
@ -132,7 +132,7 @@ public interface MachineAsyncClient {
|
||||
ListenableFuture<Void> resize(@PathParam("id") String id,@PayloadParam("package") String packageJoyentCloud);
|
||||
|
||||
/**
|
||||
* @see MachineClient#delete
|
||||
* @see MachineApi#delete
|
||||
*/
|
||||
@DELETE
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
@ -10,11 +10,11 @@ import org.jclouds.concurrent.Timeout;
|
||||
* <p/>
|
||||
*
|
||||
* @author Gerald Pereira
|
||||
* @see PackageAsyncClient
|
||||
* @see PackageAsyncApi
|
||||
* @see <a href="http://apidocs.joyent.com/cloudApiapidoc/cloudapi">api doc</a>
|
||||
*/
|
||||
@Timeout(duration = 30, timeUnit = TimeUnit.SECONDS)
|
||||
public interface PackageClient {
|
||||
public interface PackageApi {
|
||||
|
||||
/**
|
||||
* Provides a list of packages available in this datacenter.
|
@ -23,15 +23,15 @@ import com.google.common.util.concurrent.ListenableFuture;
|
||||
* <p/>
|
||||
*
|
||||
* @author Gerald Pereira
|
||||
* @see PackageClient
|
||||
* @see PackageApi
|
||||
* @see <a href="http://apidocs.joyent.com/cloudApiapidoc/cloudapi">api doc</a>
|
||||
*/
|
||||
@SkipEncoding({ '/', '=' })
|
||||
@Headers(keys = "X-Api-Version", values = "{jclouds.api-version}")
|
||||
@RequestFilters(BasicAuthentication.class)
|
||||
public interface PackageAsyncClient {
|
||||
public interface PackageAsyncApi {
|
||||
/**
|
||||
* @see PackageClient#list
|
||||
* @see PackageApi#list
|
||||
*/
|
||||
@GET
|
||||
@Path("/my/packages")
|
||||
@ -40,7 +40,7 @@ public interface PackageAsyncClient {
|
||||
ListenableFuture<Set<org.jclouds.joyent.cloudapi.v6_5.domain.Package>> list();
|
||||
|
||||
/**
|
||||
* @see PackageClient#get
|
||||
* @see PackageApi#get
|
||||
*/
|
||||
@GET
|
||||
@Path("/my/packages/{name}")
|
@ -56,4 +56,4 @@ public class JoyentCloudTypeAdapters {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jclouds.http.options.BaseHttpRequestOptions;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.PackageClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.PackageApi;
|
||||
import org.jclouds.util.Maps2;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
@ -99,7 +99,7 @@ public class CreateMachineOptions extends BaseHttpRequestOptions {
|
||||
|
||||
/**
|
||||
* Name of the package to use on provisioning; default is indicated in
|
||||
* {@link PackageClient#list}
|
||||
* {@link PackageApi#list}
|
||||
*/
|
||||
public CreateMachineOptions packageName(String packageName) {
|
||||
this.pkg = checkNotNull(packageName, "packageName");
|
||||
|
@ -6,7 +6,7 @@ import java.util.Map;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatacenterClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatacenterApi;
|
||||
import org.jclouds.location.suppliers.ZoneIdToURISupplier;
|
||||
import org.jclouds.util.Suppliers2;
|
||||
|
||||
@ -14,22 +14,22 @@ import com.google.common.base.Supplier;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
@Singleton
|
||||
public class ZoneIdToURIFromDatacentersClient implements ZoneIdToURISupplier {
|
||||
public class ZoneIdToURIFromDatacentersApi implements ZoneIdToURISupplier {
|
||||
|
||||
private final DatacenterClient client;
|
||||
private final DatacenterApi api;
|
||||
|
||||
@Inject
|
||||
public ZoneIdToURIFromDatacentersClient(DatacenterClient client) {
|
||||
this.client = client;
|
||||
public ZoneIdToURIFromDatacentersApi(DatacenterApi api) {
|
||||
this.api = api;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Supplier<URI>> get() {
|
||||
return Maps.transformValues(client.getDatacenters(), Suppliers2.<URI> ofInstanceFunction());
|
||||
return Maps.transformValues(api.getDatacenters(), Suppliers2.<URI> ofInstanceFunction());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "getDatacenters()";
|
||||
}
|
||||
}
|
||||
}
|
@ -20,8 +20,8 @@ package org.jclouds.joyent.cloudapi.v6_5;
|
||||
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudClientExpectTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudApiExpectTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
@ -29,15 +29,15 @@ import com.google.common.collect.ImmutableSet;
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "unit", testName = "JoyentCloudClientExpectTest")
|
||||
public class JoyentCloudClientExpectTest extends BaseJoyentCloudClientExpectTest {
|
||||
@Test(groups = "unit", testName = "JoyentCloudApiExpectTest")
|
||||
public class JoyentCloudApiExpectTest extends BaseJoyentCloudApiExpectTest {
|
||||
|
||||
public void testGetConfiguredDatacenters() {
|
||||
|
||||
JoyentCloudClient clientWhenDatacentersExists = requestSendsResponse(getDatacenters, getDatacentersResponse);
|
||||
JoyentCloudApi apiWhenDatacentersExists = requestSendsResponse(getDatacenters, getDatacentersResponse);
|
||||
|
||||
assertEquals(
|
||||
clientWhenDatacentersExists.getConfiguredDatacenters(),
|
||||
apiWhenDatacentersExists.getConfiguredDatacenters(),
|
||||
ImmutableSet.<String> builder()
|
||||
.add("us-east-1")
|
||||
.add("us-west-1")
|
@ -22,17 +22,17 @@ import static org.testng.Assert.assertEquals;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudClientLiveTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudApiLiveTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "live", testName = "JoyentCloudClientLiveTest")
|
||||
public class JoyentCloudClientLiveTest extends BaseJoyentCloudClientLiveTest {
|
||||
@Test(groups = "live", testName = "JoyentCloudApiLiveTest")
|
||||
public class JoyentCloudApiLiveTest extends BaseJoyentCloudApiLiveTest {
|
||||
|
||||
public void testGetDatacenters() {
|
||||
Set<String> dcs = cloudApiContext.getApi().getConfiguredDatacenters();
|
||||
assertEquals(dcs, cloudApiContext.getApi().getDatacenterClient().getDatacenters().keySet());
|
||||
assertEquals(dcs, cloudApiContext.getApi().getDatacenterApi().getDatacenters().keySet());
|
||||
}
|
||||
}
|
@ -43,12 +43,12 @@ import org.jclouds.crypto.Crypto;
|
||||
import org.jclouds.crypto.Pems;
|
||||
import org.jclouds.crypto.SshKeys;
|
||||
import org.jclouds.io.Payloads;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.compute.internal.KeyAndPrivateKey;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.compute.loaders.CreateUniqueKey;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.domain.Key;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.domain.datacenterscoped.DatacenterAndName;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.KeyClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.KeyApi;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@ -90,8 +90,8 @@ public class CreateUniqueKeyTest {
|
||||
|
||||
@Test
|
||||
public void testApply() {
|
||||
JoyentCloudClient cloudApiClient = createMock(JoyentCloudClient.class);
|
||||
KeyClient keyClient = createMock(KeyClient.class);
|
||||
JoyentCloudApi cloudApiApi = createMock(JoyentCloudApi.class);
|
||||
KeyApi keyApi = createMock(KeyApi.class);
|
||||
Crypto crypto = createMock(Crypto.class);
|
||||
KeyPairGenerator rsaKeyPairGenerator = createMock(KeyPairGenerator.class);
|
||||
SecureRandom secureRandom = createMock(SecureRandom.class);
|
||||
@ -102,18 +102,18 @@ public class CreateUniqueKeyTest {
|
||||
rsaKeyPairGenerator.initialize(2048, secureRandom);
|
||||
expect(rsaKeyPairGenerator.genKeyPair()).andReturn(keyPair);
|
||||
|
||||
expect(cloudApiClient.getKeyClient()).andReturn(keyClient);
|
||||
expect(cloudApiApi.getKeyApi()).andReturn(keyApi);
|
||||
|
||||
expect(keyClient.create(key)).andReturn(key);
|
||||
expect(keyApi.create(key)).andReturn(key);
|
||||
|
||||
replay(cloudApiClient, keyClient, crypto, rsaKeyPairGenerator, secureRandom);
|
||||
replay(cloudApiApi, keyApi, crypto, rsaKeyPairGenerator, secureRandom);
|
||||
|
||||
CreateUniqueKey parser = new CreateUniqueKey(cloudApiClient, namingConvention, crypto, Providers.of(secureRandom));
|
||||
CreateUniqueKey parser = new CreateUniqueKey(cloudApiApi, namingConvention, crypto, Providers.of(secureRandom));
|
||||
|
||||
assertEquals(parser.load(DatacenterAndName.fromDatacenterAndName("datacenter", "group")),
|
||||
KeyAndPrivateKey.fromKeyAndPrivateKey(key, PRIVATE_KEY));
|
||||
|
||||
verify(cloudApiClient, keyClient, crypto, rsaKeyPairGenerator, secureRandom);
|
||||
verify(cloudApiApi, keyApi, crypto, rsaKeyPairGenerator, secureRandom);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,8 +23,8 @@ import static org.testng.Assert.assertEquals;
|
||||
import java.net.URI;
|
||||
|
||||
import org.jclouds.http.HttpResponse;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudClientExpectTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudApiExpectTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
@ -32,15 +32,15 @@ import com.google.common.collect.ImmutableMap;
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "unit", testName = "DatacenterClientExpectTest")
|
||||
public class DatacenterClientExpectTest extends BaseJoyentCloudClientExpectTest {
|
||||
@Test(groups = "unit", testName = "DatacenterApiExpectTest")
|
||||
public class DatacenterApiExpectTest extends BaseJoyentCloudApiExpectTest {
|
||||
|
||||
public void testGetDatacentersWhenResponseIs2xx() {
|
||||
|
||||
JoyentCloudClient clientWhenDatacentersExists = requestSendsResponse(getDatacenters, getDatacentersResponse);
|
||||
JoyentCloudApi apiWhenDatacentersExists = requestSendsResponse(getDatacenters, getDatacentersResponse);
|
||||
|
||||
assertEquals(
|
||||
clientWhenDatacentersExists.getDatacenterClient().getDatacenters(),
|
||||
apiWhenDatacentersExists.getDatacenterApi().getDatacenters(),
|
||||
ImmutableMap.<String, URI> builder().put("us-east-1", URI.create("https://us-east-1.api.joyentcloud.com"))
|
||||
.put("us-west-1", URI.create("https://us-west-1.api.joyentcloud.com"))
|
||||
.put("us-sw-1", URI.create("https://us-sw-1.api.joyentcloud.com"))
|
||||
@ -50,8 +50,8 @@ public class DatacenterClientExpectTest extends BaseJoyentCloudClientExpectTest
|
||||
public void testGetDatacentersWhenResponseIs404() {
|
||||
HttpResponse getDatacentersResponse = HttpResponse.builder().statusCode(404).build();
|
||||
|
||||
JoyentCloudClient getDatacentersWhenNone = requestSendsResponse(getDatacenters, getDatacentersResponse);
|
||||
JoyentCloudApi getDatacentersWhenNone = requestSendsResponse(getDatacenters, getDatacentersResponse);
|
||||
|
||||
assertEquals(getDatacentersWhenNone.getDatacenterClient().getDatacenters(), ImmutableMap.of());
|
||||
assertEquals(getDatacentersWhenNone.getDatacenterApi().getDatacenters(), ImmutableMap.of());
|
||||
}
|
||||
}
|
@ -24,17 +24,17 @@ import static org.testng.Assert.assertTrue;
|
||||
import java.net.URI;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudClientLiveTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudApiLiveTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "live", testName = "DatacenterClientLiveTest")
|
||||
public class DatacenterClientLiveTest extends BaseJoyentCloudClientLiveTest {
|
||||
@Test(groups = "live", testName = "DatacenterApiLiveTest")
|
||||
public class DatacenterApiLiveTest extends BaseJoyentCloudApiLiveTest {
|
||||
|
||||
public void testGetDatacenters() {
|
||||
Map<String, URI> dcs = cloudApiContext.getApi().getDatacenterClient().getDatacenters();
|
||||
Map<String, URI> dcs = cloudApiContext.getApi().getDatacenterApi().getDatacenters();
|
||||
assertNotNull(dcs);
|
||||
assertTrue(dcs.size() > 0);
|
||||
}
|
@ -24,8 +24,8 @@ import java.net.URI;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.HttpResponse;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudClientExpectTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudApiExpectTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.parse.ParseDatasetListTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@ -35,8 +35,8 @@ import com.google.common.collect.ImmutableSet;
|
||||
/**
|
||||
* @author Gerald Pereira
|
||||
*/
|
||||
@Test(groups = "unit", testName = "DatasetClientExpectTest")
|
||||
public class DatasetClientExpectTest extends BaseJoyentCloudClientExpectTest {
|
||||
@Test(groups = "unit", testName = "DatasetApiExpectTest")
|
||||
public class DatasetApiExpectTest extends BaseJoyentCloudApiExpectTest {
|
||||
HttpRequest list = HttpRequest.builder().method("GET").endpoint(
|
||||
URI.create("https://us-sw-1.api.joyentcloud.com/my/datasets")).headers(
|
||||
ImmutableMultimap.<String, String> builder().put("X-Api-Version", "~6.5").put("Accept", "application/json")
|
||||
@ -46,18 +46,18 @@ public class DatasetClientExpectTest extends BaseJoyentCloudClientExpectTest {
|
||||
HttpResponse listResponse = HttpResponse.builder().statusCode(200).payload(
|
||||
payloadFromResource("/dataset_list.json")).build();
|
||||
|
||||
JoyentCloudClient clientWhenDatasetsExists = requestsSendResponses(getDatacenters, getDatacentersResponse, list, listResponse);
|
||||
JoyentCloudApi apiWhenDatasetsExists = requestsSendResponses(getDatacenters, getDatacentersResponse, list, listResponse);
|
||||
|
||||
assertEquals(clientWhenDatasetsExists.getDatasetClientForDatacenter("us-sw-1").list().toString(), new ParseDatasetListTest()
|
||||
assertEquals(apiWhenDatasetsExists.getDatasetApiForDatacenter("us-sw-1").list().toString(), new ParseDatasetListTest()
|
||||
.expected().toString());
|
||||
}
|
||||
|
||||
public void testListDatasetsWhenResponseIs404() {
|
||||
HttpResponse listResponse = HttpResponse.builder().statusCode(404).build();
|
||||
|
||||
JoyentCloudClient listWhenNone = requestsSendResponses(getDatacenters, getDatacentersResponse, list, listResponse);
|
||||
JoyentCloudApi listWhenNone = requestsSendResponses(getDatacenters, getDatacentersResponse, list, listResponse);
|
||||
|
||||
assertEquals(listWhenNone.getDatasetClientForDatacenter("us-sw-1").list(), ImmutableSet.of());
|
||||
assertEquals(listWhenNone.getDatasetApiForDatacenter("us-sw-1").list(), ImmutableSet.of());
|
||||
}
|
||||
|
||||
// [id=e4cd7b9e-4330-11e1-81cf-3bb50a972bda, name=centos-6, type=VIRTUALMACHINE, version=1.0.1,
|
@ -23,24 +23,24 @@ import static org.testng.Assert.assertEquals;
|
||||
import java.util.Set;
|
||||
|
||||
import org.jclouds.joyent.cloudapi.v6_5.domain.Dataset;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatasetClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudClientLiveTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatasetApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudApiLiveTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Gerald Pereira
|
||||
*/
|
||||
@Test(groups = "live", testName = "DatasetClientLiveTest")
|
||||
public class DatasetClientLiveTest extends BaseJoyentCloudClientLiveTest {
|
||||
@Test(groups = "live", testName = "DatasetApiLiveTest")
|
||||
public class DatasetApiLiveTest extends BaseJoyentCloudApiLiveTest {
|
||||
|
||||
@Test
|
||||
public void testListAndGetDatasets() throws Exception {
|
||||
for (String datacenterId : cloudApiContext.getApi().getConfiguredDatacenters()) {
|
||||
DatasetClient client = cloudApiContext.getApi().getDatasetClientForDatacenter(datacenterId);
|
||||
Set<Dataset> response = client.list();
|
||||
DatasetApi api = cloudApiContext.getApi().getDatasetApiForDatacenter(datacenterId);
|
||||
Set<Dataset> response = api.list();
|
||||
assert null != response;
|
||||
for (Dataset dataset : response) {
|
||||
Dataset newDetails = client.get(dataset.getId());
|
||||
Dataset newDetails = api.get(dataset.getId());
|
||||
assertEquals(newDetails.getId(), dataset.getId());
|
||||
assertEquals(newDetails.getName(), dataset.getName());
|
||||
assertEquals(newDetails.getType(), dataset.getType());
|
@ -22,8 +22,8 @@ import static org.testng.Assert.assertEquals;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.HttpResponse;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudClientExpectTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudApiExpectTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.parse.ParseKeyListTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.parse.ParseKeyTest;
|
||||
import org.testng.annotations.Test;
|
||||
@ -33,8 +33,8 @@ import com.google.common.collect.ImmutableSet;
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "unit", testName = "KeyClientExpectTest")
|
||||
public class KeyClientExpectTest extends BaseJoyentCloudClientExpectTest {
|
||||
@Test(groups = "unit", testName = "KeyApiExpectTest")
|
||||
public class KeyApiExpectTest extends BaseJoyentCloudApiExpectTest {
|
||||
HttpRequest list = HttpRequest.builder().method("GET")
|
||||
.endpoint("https://api.joyentcloud.com/my/keys")
|
||||
.addHeader("X-Api-Version", "~6.5")
|
||||
@ -45,17 +45,17 @@ public class KeyClientExpectTest extends BaseJoyentCloudClientExpectTest {
|
||||
HttpResponse listResponse = HttpResponse.builder().statusCode(200).payload(
|
||||
payloadFromResource("/key_list.json")).build();
|
||||
|
||||
JoyentCloudClient clientWhenKeysExists = requestsSendResponses(getDatacenters, getDatacentersResponse, list, listResponse);
|
||||
JoyentCloudApi apiWhenKeysExists = requestsSendResponses(getDatacenters, getDatacentersResponse, list, listResponse);
|
||||
|
||||
assertEquals(clientWhenKeysExists.getKeyClient().list(), new ParseKeyListTest().expected());
|
||||
assertEquals(apiWhenKeysExists.getKeyApi().list(), new ParseKeyListTest().expected());
|
||||
}
|
||||
|
||||
public void testListKeysWhenResponseIs404() {
|
||||
HttpResponse listResponse = HttpResponse.builder().statusCode(404).build();
|
||||
|
||||
JoyentCloudClient listWhenNone = requestsSendResponses(getDatacenters, getDatacentersResponse, list, listResponse);
|
||||
JoyentCloudApi listWhenNone = requestsSendResponses(getDatacenters, getDatacentersResponse, list, listResponse);
|
||||
|
||||
assertEquals(listWhenNone.getKeyClient().list(), ImmutableSet.of());
|
||||
assertEquals(listWhenNone.getKeyApi().list(), ImmutableSet.of());
|
||||
}
|
||||
|
||||
public void testCreateKeyWhenResponseIs202() throws Exception {
|
||||
@ -74,9 +74,9 @@ public class KeyClientExpectTest extends BaseJoyentCloudClientExpectTest {
|
||||
.payload(payloadFromResourceWithContentType("/key.json", "application/json; charset=UTF-8"))
|
||||
.build();
|
||||
|
||||
JoyentCloudClient clientWithNewKey = requestsSendResponses(getDatacenters, getDatacentersResponse, create, createResponse);
|
||||
JoyentCloudApi apiWithNewKey = requestsSendResponses(getDatacenters, getDatacentersResponse, create, createResponse);
|
||||
|
||||
assertEquals(clientWithNewKey.getKeyClient().create(new ParseKeyTest().expected())
|
||||
assertEquals(apiWithNewKey.getKeyApi().create(new ParseKeyTest().expected())
|
||||
.toString(), new ParseKeyTest().expected().toString());
|
||||
}
|
||||
}
|
@ -24,24 +24,24 @@ import java.util.Set;
|
||||
|
||||
import org.jclouds.crypto.SshKeys;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.domain.Key;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.KeyClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudClientLiveTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.KeyApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudApiLiveTest;
|
||||
import org.testng.annotations.BeforeTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "live", singleThreaded = true, testName = "KeyClientLiveTest")
|
||||
public class KeyClientLiveTest extends BaseJoyentCloudClientLiveTest {
|
||||
@Test(groups = "live", singleThreaded = true, testName = "KeyApiLiveTest")
|
||||
public class KeyApiLiveTest extends BaseJoyentCloudApiLiveTest {
|
||||
|
||||
@Test
|
||||
public void testListAndGetKeys() throws Exception {
|
||||
KeyClient client = cloudApiContext.getApi().getKeyClient();
|
||||
Set<Key> response = client.list();
|
||||
KeyApi api = cloudApiContext.getApi().getKeyApi();
|
||||
Set<Key> response = api.list();
|
||||
assert null != response;
|
||||
for (Key key : response) {
|
||||
Key newDetails = client.get(key.getName());
|
||||
Key newDetails = api.get(key.getName());
|
||||
assertEquals(newDetails.getName(), key.getName());
|
||||
assertEquals(newDetails.get(), key.get());
|
||||
assertEquals(newDetails.getCreated(), key.getCreated());
|
||||
@ -59,27 +59,27 @@ public class KeyClientLiveTest extends BaseJoyentCloudClientLiveTest {
|
||||
}
|
||||
|
||||
public void testCreateKey() {
|
||||
KeyClient client = cloudApiContext.getApi().getKeyClient();
|
||||
KeyApi api = cloudApiContext.getApi().getKeyApi();
|
||||
|
||||
Key newKey = client.create(Key.builder().name(fingerprint).key(keyText).build());
|
||||
Key newKey = api.create(Key.builder().name(fingerprint).key(keyText).build());
|
||||
assertEquals(newKey.getName(), fingerprint);
|
||||
assertEquals(newKey.get(), keyText);
|
||||
|
||||
newKey = client.get(fingerprint);
|
||||
newKey = api.get(fingerprint);
|
||||
assertEquals(newKey.getName(), fingerprint);
|
||||
assertEquals(newKey.get(), keyText);
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "testCreateKey", expectedExceptions = IllegalStateException.class)
|
||||
public void testDuplicateKey() {
|
||||
KeyClient client = cloudApiContext.getApi().getKeyClient();
|
||||
client.create(Key.builder().name(fingerprint).key(keyText).build());
|
||||
KeyApi api = cloudApiContext.getApi().getKeyApi();
|
||||
api.create(Key.builder().name(fingerprint).key(keyText).build());
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "testDuplicateKey")
|
||||
public void testDestroyKey() {
|
||||
final KeyClient client = cloudApiContext.getApi().getKeyClient();
|
||||
client.delete(fingerprint);
|
||||
final KeyApi api = cloudApiContext.getApi().getKeyApi();
|
||||
api.delete(fingerprint);
|
||||
// not that eventhough the key is destroyed it is visible via GET for at
|
||||
// least 45 seconds. This may be a cache issue on the server
|
||||
}
|
@ -22,8 +22,8 @@ import static org.testng.Assert.assertEquals;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.HttpResponse;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudClientExpectTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudApiExpectTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.options.CreateMachineOptions;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.parse.ParseCreatedMachineTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.parse.ParseMachineListTest;
|
||||
@ -34,8 +34,8 @@ import com.google.common.collect.ImmutableSet;
|
||||
/**
|
||||
* @author Gerald Pereira
|
||||
*/
|
||||
@Test(groups = "unit", testName = "MachineClientExpectTest")
|
||||
public class MachineClientExpectTest extends BaseJoyentCloudClientExpectTest {
|
||||
@Test(groups = "unit", testName = "MachineApiExpectTest")
|
||||
public class MachineApiExpectTest extends BaseJoyentCloudApiExpectTest {
|
||||
HttpRequest list = HttpRequest.builder().method("GET")
|
||||
.endpoint("https://us-sw-1.api.joyentcloud.com/my/machines")
|
||||
.addHeader("X-Api-Version", "~6.5")
|
||||
@ -46,17 +46,17 @@ public class MachineClientExpectTest extends BaseJoyentCloudClientExpectTest {
|
||||
HttpResponse listResponse = HttpResponse.builder().statusCode(200).payload(
|
||||
payloadFromResource("/machine_list.json")).build();
|
||||
|
||||
JoyentCloudClient clientWhenMachinesExists = requestsSendResponses(getDatacenters, getDatacentersResponse, list, listResponse);
|
||||
JoyentCloudApi apiWhenMachinesExists = requestsSendResponses(getDatacenters, getDatacentersResponse, list, listResponse);
|
||||
|
||||
assertEquals(clientWhenMachinesExists.getMachineClientForDatacenter("us-sw-1").list(), new ParseMachineListTest().expected());
|
||||
assertEquals(apiWhenMachinesExists.getMachineApiForDatacenter("us-sw-1").list(), new ParseMachineListTest().expected());
|
||||
}
|
||||
|
||||
public void testListMachinesWhenResponseIs404() {
|
||||
HttpResponse listResponse = HttpResponse.builder().statusCode(404).build();
|
||||
|
||||
JoyentCloudClient listWhenNone = requestsSendResponses(getDatacenters, getDatacentersResponse, list, listResponse);
|
||||
JoyentCloudApi listWhenNone = requestsSendResponses(getDatacenters, getDatacentersResponse, list, listResponse);
|
||||
|
||||
assertEquals(listWhenNone.getMachineClientForDatacenter("us-sw-1").list(), ImmutableSet.of());
|
||||
assertEquals(listWhenNone.getMachineApiForDatacenter("us-sw-1").list(), ImmutableSet.of());
|
||||
}
|
||||
|
||||
public void testCreateMachineWhenResponseIs202() throws Exception {
|
||||
@ -72,11 +72,11 @@ public class MachineClientExpectTest extends BaseJoyentCloudClientExpectTest {
|
||||
.payload(payloadFromResourceWithContentType("/new_machine.json", "application/json; charset=UTF-8"))
|
||||
.build();
|
||||
|
||||
JoyentCloudClient clientWithNewMachine = requestsSendResponses(getDatacenters, getDatacentersResponse, createWithDataset, createWithDatasetResponse);
|
||||
JoyentCloudApi apiWithNewMachine = requestsSendResponses(getDatacenters, getDatacentersResponse, createWithDataset, createWithDatasetResponse);
|
||||
|
||||
assertEquals(
|
||||
clientWithNewMachine
|
||||
.getMachineClientForDatacenter("us-sw-1")
|
||||
apiWithNewMachine
|
||||
.getMachineApiForDatacenter("us-sw-1")
|
||||
.createWithDataset("sdc:sdc:centos-5.7:1.2.1",
|
||||
CreateMachineOptions.Builder.name("sample-e92").packageName("Small 1GB")).toString(),
|
||||
new ParseCreatedMachineTest().expected().toString());
|
@ -31,8 +31,8 @@ import org.jclouds.crypto.SshKeys;
|
||||
import org.jclouds.domain.LoginCredentials;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.domain.Key;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.domain.Machine;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.MachineClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudClientLiveTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.MachineApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudApiLiveTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.options.CreateMachineOptions;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.reference.Metadata;
|
||||
import org.jclouds.predicates.InetSocketAddressConnect;
|
||||
@ -53,17 +53,17 @@ import com.google.inject.Module;
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "live", testName = "MachineClientLiveTest")
|
||||
public class MachineClientLiveTest extends BaseJoyentCloudClientLiveTest {
|
||||
@Test(groups = "live", testName = "MachineApiLiveTest")
|
||||
public class MachineApiLiveTest extends BaseJoyentCloudApiLiveTest {
|
||||
|
||||
@Test
|
||||
public void testListAndGetMachines() throws Exception {
|
||||
for (String datacenterId : cloudApiContext.getApi().getConfiguredDatacenters()) {
|
||||
MachineClient client = cloudApiContext.getApi().getMachineClientForDatacenter(datacenterId);
|
||||
Set<Machine> response = client.list();
|
||||
MachineApi api = cloudApiContext.getApi().getMachineApiForDatacenter(datacenterId);
|
||||
Set<Machine> response = api.list();
|
||||
assert null != response;
|
||||
for (Machine machine : response) {
|
||||
Machine newDetails = client.get(machine.getId());
|
||||
Machine newDetails = api.get(machine.getId());
|
||||
assertEquals(newDetails.getId(), machine.getId());
|
||||
assertEquals(newDetails.getName(), machine.getName());
|
||||
assertEquals(newDetails.getType(), machine.getType());
|
||||
@ -83,7 +83,7 @@ public class MachineClientLiveTest extends BaseJoyentCloudClientLiveTest {
|
||||
private String fingerprint;
|
||||
private RetryablePredicate<HostAndPort> socketTester;
|
||||
private Predicate<Machine> machineRunning;
|
||||
private MachineClient client;
|
||||
private MachineApi api;
|
||||
private Machine machine;
|
||||
protected String datasetURN = System.getProperty("test." + provider + ".image-id", "sdc:sdc:ubuntu-10.04:1.0.1");
|
||||
private String name;
|
||||
@ -94,15 +94,15 @@ public class MachineClientLiveTest extends BaseJoyentCloudClientLiveTest {
|
||||
super.setupContext();
|
||||
key = SshKeys.generate();
|
||||
fingerprint = SshKeys.fingerprintPublicKey(key.get("public"));
|
||||
cloudApiContext.getApi().getKeyClient().create(Key.builder().name(fingerprint).key(key.get("public")).build());
|
||||
client = cloudApiContext.getApi().getMachineClientForDatacenter(
|
||||
cloudApiContext.getApi().getKeyApi().create(Key.builder().name(fingerprint).key(key.get("public")).build());
|
||||
api = cloudApiContext.getApi().getMachineApiForDatacenter(
|
||||
Iterables.get(cloudApiContext.getApi().getConfiguredDatacenters(), 0));
|
||||
socketTester = new RetryablePredicate<HostAndPort>(new InetSocketAddressConnect(), 180, 1, 1, TimeUnit.SECONDS);
|
||||
machineRunning = new RetryablePredicate<Machine>(new Predicate<Machine>() {
|
||||
|
||||
@Override
|
||||
public boolean apply(Machine input) {
|
||||
return client.get(input.getId()).getState() == Machine.State.RUNNING;
|
||||
return api.get(input.getId()).getState() == Machine.State.RUNNING;
|
||||
}
|
||||
|
||||
}, 600, 5, 5, TimeUnit.SECONDS);
|
||||
@ -110,14 +110,14 @@ public class MachineClientLiveTest extends BaseJoyentCloudClientLiveTest {
|
||||
|
||||
@Override
|
||||
public boolean apply(Machine input) {
|
||||
return client.get(input.getId()).getState() == Machine.State.RUNNING;
|
||||
return api.get(input.getId()).getState() == Machine.State.RUNNING;
|
||||
}
|
||||
|
||||
}, 600, 5, 5, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
public void testCreateMachine() {
|
||||
Machine newMachine = client.createWithDataset(datasetURN,
|
||||
Machine newMachine = api.createWithDataset(datasetURN,
|
||||
CreateMachineOptions.Builder.metadata(ImmutableMap.of("foo", "bar")));
|
||||
machine = newMachine;
|
||||
name = newMachine.getName();
|
||||
@ -128,13 +128,13 @@ public class MachineClientLiveTest extends BaseJoyentCloudClientLiveTest {
|
||||
newMachine + "; key: " + key.get("public"));
|
||||
|
||||
assertTrue(machineRunning.apply(newMachine), newMachine.toString());
|
||||
machine = client.get(newMachine.getId());
|
||||
machine = api.get(newMachine.getId());
|
||||
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "testCreateMachine", expectedExceptions = IllegalStateException.class)
|
||||
public void testDuplicateMachineThrowsIllegalStateException() {
|
||||
client.createWithDataset(datasetURN, CreateMachineOptions.Builder.name(name));
|
||||
api.createWithDataset(datasetURN, CreateMachineOptions.Builder.name(name));
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "testCreateMachine")
|
||||
@ -142,30 +142,30 @@ public class MachineClientLiveTest extends BaseJoyentCloudClientLiveTest {
|
||||
String publicAddress = Iterables.find(machine.getIps(), not(InetAddresses2.IsPrivateIPAddress.INSTANCE));
|
||||
HostAndPort socket = HostAndPort.fromParts(publicAddress, 22);
|
||||
assertTrue(socketTester.apply(socket), socket.toString());
|
||||
SshClient client = context.utils().injector().getInstance(SshClient.Factory.class)
|
||||
SshClient api = context.utils().injector().getInstance(SshClient.Factory.class)
|
||||
.create(socket, LoginCredentials.builder().user("root").privateKey(key.get("private")).build());
|
||||
try {
|
||||
client.connect();
|
||||
ExecResponse exec = client.exec("echo hello");
|
||||
api.connect();
|
||||
ExecResponse exec = api.exec("echo hello");
|
||||
System.out.println(exec);
|
||||
assertEquals(exec.getOutput().trim(), "hello");
|
||||
} finally {
|
||||
if (client != null)
|
||||
client.disconnect();
|
||||
if (api != null)
|
||||
api.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
@Test(dependsOnMethods = "testSsh")
|
||||
public void testDeleteMachine() {
|
||||
client.delete(machine.getId());
|
||||
api.delete(machine.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
@AfterGroups(groups = "live")
|
||||
protected void tearDown() {
|
||||
if (machine != null)
|
||||
client.delete(machine.getId());
|
||||
cloudApiContext.getApi().getKeyClient().delete(fingerprint);
|
||||
api.delete(machine.getId());
|
||||
cloudApiContext.getApi().getKeyApi().delete(fingerprint);
|
||||
super.tearDown();
|
||||
}
|
||||
|
@ -22,8 +22,8 @@ import static org.testng.Assert.assertEquals;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.HttpResponse;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudClientExpectTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudApiExpectTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.parse.ParsePackageListTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@ -32,8 +32,8 @@ import com.google.common.collect.ImmutableSet;
|
||||
/**
|
||||
* @author Gerald Pereira
|
||||
*/
|
||||
@Test(groups = "unit", testName = "PackageClientExpectTest")
|
||||
public class PackageClientExpectTest extends BaseJoyentCloudClientExpectTest {
|
||||
@Test(groups = "unit", testName = "PackageApiExpectTest")
|
||||
public class PackageApiExpectTest extends BaseJoyentCloudApiExpectTest {
|
||||
HttpRequest list = HttpRequest.builder().method("GET")
|
||||
.endpoint("https://us-sw-1.api.joyentcloud.com/my/packages")
|
||||
.addHeader("X-Api-Version", "~6.5")
|
||||
@ -44,16 +44,16 @@ public class PackageClientExpectTest extends BaseJoyentCloudClientExpectTest {
|
||||
HttpResponse listResponse = HttpResponse.builder().statusCode(200)
|
||||
.payload(payloadFromResource("/package_list.json")).build();
|
||||
|
||||
JoyentCloudClient clientWhenPackagesExists = requestsSendResponses(getDatacenters, getDatacentersResponse, list, listResponse);
|
||||
JoyentCloudApi apiWhenPackagesExists = requestsSendResponses(getDatacenters, getDatacentersResponse, list, listResponse);
|
||||
|
||||
assertEquals(clientWhenPackagesExists.getPackageClientForDatacenter("us-sw-1").list(), new ParsePackageListTest().expected());
|
||||
assertEquals(apiWhenPackagesExists.getPackageApiForDatacenter("us-sw-1").list(), new ParsePackageListTest().expected());
|
||||
}
|
||||
|
||||
public void testListPackagesWhenResponseIs404() {
|
||||
HttpResponse listResponse = HttpResponse.builder().statusCode(404).build();
|
||||
|
||||
JoyentCloudClient listWhenNone = requestsSendResponses(getDatacenters, getDatacentersResponse, list, listResponse);
|
||||
JoyentCloudApi listWhenNone = requestsSendResponses(getDatacenters, getDatacentersResponse, list, listResponse);
|
||||
|
||||
assertEquals(listWhenNone.getPackageClientForDatacenter("us-sw-1").list(), ImmutableSet.of());
|
||||
assertEquals(listWhenNone.getPackageApiForDatacenter("us-sw-1").list(), ImmutableSet.of());
|
||||
}
|
||||
}
|
@ -23,24 +23,24 @@ import static org.testng.Assert.assertEquals;
|
||||
import java.util.Set;
|
||||
|
||||
import org.jclouds.joyent.cloudapi.v6_5.domain.Package;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.PackageClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudClientLiveTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.PackageApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.internal.BaseJoyentCloudApiLiveTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Gerald Pereira
|
||||
*/
|
||||
@Test(groups = "live", testName = "PackageClientLiveTest")
|
||||
public class PackageClientLiveTest extends BaseJoyentCloudClientLiveTest {
|
||||
@Test(groups = "live", testName = "PackageApiLiveTest")
|
||||
public class PackageApiLiveTest extends BaseJoyentCloudApiLiveTest {
|
||||
|
||||
@Test
|
||||
public void testListAndGetPackages() throws Exception {
|
||||
for (String datacenterId : cloudApiContext.getApi().getConfiguredDatacenters()) {
|
||||
PackageClient client = cloudApiContext.getApi().getPackageClientForDatacenter(datacenterId);
|
||||
Set<Package> response = client.list();
|
||||
PackageApi api = cloudApiContext.getApi().getPackageApiForDatacenter(datacenterId);
|
||||
Set<Package> response = api.list();
|
||||
assert null != response;
|
||||
for (Package pkg : response) {
|
||||
Package newDetails = client.get(pkg.getName());
|
||||
Package newDetails = api.get(pkg.getName());
|
||||
assertEquals(newDetails.getName(), pkg.getName());
|
||||
assertEquals(newDetails.getMemorySizeMb(), pkg.getMemorySizeMb());
|
||||
assertEquals(newDetails.getDiskSizeGb(), pkg.getDiskSizeGb());
|
@ -20,14 +20,14 @@ package org.jclouds.joyent.cloudapi.v6_5.internal;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.HttpResponse;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudApi;
|
||||
|
||||
/**
|
||||
* Base class for writing Cloud Api Rest Client Expect tests
|
||||
* Base class for writing Cloud Api Rest Api Expect tests
|
||||
*
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
public class BaseJoyentCloudClientExpectTest extends BaseJoyentCloudExpectTest<JoyentCloudClient> {
|
||||
public class BaseJoyentCloudApiExpectTest extends BaseJoyentCloudExpectTest<JoyentCloudApi> {
|
||||
protected HttpRequest getDatacenters = HttpRequest.builder()
|
||||
.method("GET")
|
||||
.endpoint("https://api.joyentcloud.com/my/datacenters")
|
@ -19,8 +19,8 @@
|
||||
package org.jclouds.joyent.cloudapi.v6_5.internal;
|
||||
|
||||
import org.jclouds.compute.internal.BaseComputeServiceContextLiveTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudAsyncClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudAsyncApi;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudApi;
|
||||
import org.jclouds.rest.RestContext;
|
||||
import org.jclouds.sshj.config.SshjSshClientModule;
|
||||
import org.testng.annotations.AfterGroups;
|
||||
@ -30,18 +30,18 @@ import org.testng.annotations.Test;
|
||||
import com.google.inject.Module;
|
||||
|
||||
/**
|
||||
* Tests behavior of {@code JoyentCloudClient}
|
||||
* Tests behavior of {@code JoyentCloudApi}
|
||||
*
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "live")
|
||||
public class BaseJoyentCloudClientLiveTest extends BaseComputeServiceContextLiveTest {
|
||||
public class BaseJoyentCloudApiLiveTest extends BaseComputeServiceContextLiveTest {
|
||||
|
||||
public BaseJoyentCloudClientLiveTest() {
|
||||
public BaseJoyentCloudApiLiveTest() {
|
||||
provider = "joyent-cloudapi";
|
||||
}
|
||||
|
||||
protected RestContext<JoyentCloudClient, JoyentCloudAsyncClient> cloudApiContext;
|
||||
protected RestContext<JoyentCloudApi, JoyentCloudAsyncApi> cloudApiContext;
|
||||
|
||||
@BeforeGroups(groups = { "integration", "live" })
|
||||
@Override
|
@ -22,18 +22,18 @@ import java.util.Properties;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.HttpResponse;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudAsyncClient;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudAsyncApi;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.inject.Module;
|
||||
|
||||
/**
|
||||
* Base class for writing Cloud Api Rest Client Expect tests
|
||||
* Base class for writing Cloud Api Rest Api Expect tests
|
||||
*
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
public class BaseJoyentCloudAsyncClientExpectTest extends BaseJoyentCloudExpectTest<JoyentCloudAsyncClient> {
|
||||
public JoyentCloudAsyncClient createClient(Function<HttpRequest, HttpResponse> fn, Module module, Properties props) {
|
||||
return createInjector(fn, module, props).getInstance(JoyentCloudAsyncClient.class);
|
||||
public class BaseJoyentCloudAsyncApiExpectTest extends BaseJoyentCloudExpectTest<JoyentCloudAsyncApi> {
|
||||
public JoyentCloudAsyncApi createClient(Function<HttpRequest, HttpResponse> fn, Module module, Properties props) {
|
||||
return createInjector(fn, module, props).getInstance(JoyentCloudAsyncApi.class);
|
||||
}
|
||||
}
|
@ -18,14 +18,14 @@
|
||||
*/
|
||||
package org.jclouds.joyent.cloudapi.v6_5.internal;
|
||||
|
||||
import org.jclouds.rest.internal.BaseRestClientExpectTest;
|
||||
import org.jclouds.rest.internal.BaseRestApiExpectTest;
|
||||
|
||||
/**
|
||||
* Base class for writing JoyentCloud Expect tests
|
||||
*
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
public class BaseJoyentCloudExpectTest<T> extends BaseRestClientExpectTest<T> {
|
||||
public class BaseJoyentCloudExpectTest<T> extends BaseRestApiExpectTest<T> {
|
||||
|
||||
public BaseJoyentCloudExpectTest() {
|
||||
provider = "joyent-cloudapi";
|
||||
|
@ -90,4 +90,4 @@ public class JoyentCloudProviderMetadata extends BaseProviderMetadata {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,14 +18,14 @@
|
||||
*/
|
||||
package org.jclouds.joyent.joyentcloud;
|
||||
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudClientLiveTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.JoyentCloudApiLiveTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "live", testName = "JoyentCloudLiveTest")
|
||||
public class JoyentCloudLiveTest extends JoyentCloudClientLiveTest {
|
||||
public class JoyentCloudLiveTest extends JoyentCloudApiLiveTest {
|
||||
public JoyentCloudLiveTest() {
|
||||
provider = "joyentcloud";
|
||||
}
|
||||
|
@ -18,15 +18,15 @@
|
||||
*/
|
||||
package org.jclouds.joyent.joyentcloud.features;
|
||||
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.MachineClientLiveTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatacenterApiLiveTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "live", testName = "JoyentCloudMachineClientLiveTest")
|
||||
public class JoyentCloudMachineClientLiveTest extends MachineClientLiveTest {
|
||||
public JoyentCloudMachineClientLiveTest() {
|
||||
@Test(groups = "live", testName = "JoyentCloudDatacenterApiLiveTest")
|
||||
public class JoyentCloudDatacenterApiLiveTest extends DatacenterApiLiveTest {
|
||||
public JoyentCloudDatacenterApiLiveTest() {
|
||||
provider = "joyentcloud";
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds 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.joyent.joyentcloud.features;
|
||||
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatacenterClientLiveTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "live", testName = "JoyentCloudDatacenterClientLiveTest")
|
||||
public class JoyentCloudDatacenterClientLiveTest extends DatacenterClientLiveTest {
|
||||
public JoyentCloudDatacenterClientLiveTest() {
|
||||
provider = "joyentcloud";
|
||||
}
|
||||
}
|
@ -18,15 +18,15 @@
|
||||
*/
|
||||
package org.jclouds.joyent.joyentcloud.features;
|
||||
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatasetClientLiveTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.DatasetApiLiveTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "live", testName = "JoyentCloudDatasetClientLiveTest")
|
||||
public class JoyentCloudDatasetClientLiveTest extends DatasetClientLiveTest {
|
||||
public JoyentCloudDatasetClientLiveTest() {
|
||||
@Test(groups = "live", testName = "JoyentCloudDatasetApiLiveTest")
|
||||
public class JoyentCloudDatasetApiLiveTest extends DatasetApiLiveTest {
|
||||
public JoyentCloudDatasetApiLiveTest() {
|
||||
provider = "joyentcloud";
|
||||
}
|
||||
}
|
@ -18,15 +18,15 @@
|
||||
*/
|
||||
package org.jclouds.joyent.joyentcloud.features;
|
||||
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.KeyClientLiveTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.KeyApiLiveTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "live", testName = "JoyentCloudKeyClientLiveTest")
|
||||
public class JoyentCloudKeyClientLiveTest extends KeyClientLiveTest {
|
||||
public JoyentCloudKeyClientLiveTest() {
|
||||
@Test(groups = "live", testName = "JoyentCloudKeyApiLiveTest")
|
||||
public class JoyentCloudKeyApiLiveTest extends KeyApiLiveTest {
|
||||
public JoyentCloudKeyApiLiveTest() {
|
||||
provider = "joyentcloud";
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Licensed to jclouds, Inc. (jclouds) under one or more
|
||||
* contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. jclouds 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.joyent.joyentcloud.features;
|
||||
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.MachineApiLiveTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "live", testName = "JoyentCloudMachineApiLiveTest")
|
||||
public class JoyentCloudMachineApiLiveTest extends MachineApiLiveTest {
|
||||
public JoyentCloudMachineApiLiveTest() {
|
||||
provider = "joyentcloud";
|
||||
}
|
||||
}
|
@ -18,16 +18,16 @@
|
||||
*/
|
||||
package org.jclouds.joyent.joyentcloud.features;
|
||||
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.PackageClientLiveTest;
|
||||
import org.jclouds.joyent.cloudapi.v6_5.features.PackageApiLiveTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Adrian Cole
|
||||
*/
|
||||
@Test(groups = "live", testName = "JoyentCloudPackageClientLiveTest")
|
||||
public class JoyentCloudPackageClientLiveTest extends PackageClientLiveTest {
|
||||
@Test(groups = "live", testName = "JoyentCloudPackageApiLiveTest")
|
||||
public class JoyentCloudPackageApiLiveTest extends PackageApiLiveTest {
|
||||
|
||||
public JoyentCloudPackageClientLiveTest(){
|
||||
public JoyentCloudPackageApiLiveTest(){
|
||||
provider = "joyentcloud";
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user