Package org.jclouds.joyent.cloudapi.v6_5.domain

Examples of org.jclouds.joyent.cloudapi.v6_5.domain.Key


   }

   public void testGetDatacentersWhenResponseIs404() {
      HttpResponse getDatacentersResponse = HttpResponse.builder().statusCode(404).build();

      JoyentCloudApi getDatacentersWhenNone = requestSendsResponse(getDatacenters, getDatacentersResponse);

      assertEquals(getDatacentersWhenNone.getDatacenterApi().getDatacenters(), ImmutableMap.of());
   }
View Full Code Here


   public HttpResponse listResponse = HttpResponse.builder().statusCode(200).payload(
            payloadFromResource("/machine_list.json")).build();

   public void testListMachinesWhenResponseIs2xx() {

      JoyentCloudApi apiWhenMachinesExists = requestsSendResponses(getDatacenters, getDatacentersResponse, list, listResponse);

      assertEquals(apiWhenMachinesExists.getMachineApiForDatacenter("us-sw-1").list(), new ParseMachineListTest().expected());
   }
View Full Code Here

      return createInjector(fn, module, props).getInstance(ComputeServiceContext.class);
   }
  
   @Override
   protected ApiMetadata createApiMetadata() {
      return new JoyentCloudApiMetadata();
   }
View Full Code Here

*/
@Test(groups = "unit", testName = "JoyentCloudProviderMetadataTest")
public class JoyentCloudProviderMetadataTest extends BaseProviderMetadataTest {

   public JoyentCloudProviderMetadataTest() {
      super(new JoyentCloudProviderMetadata(), new JoyentCloudApiMetadata());
   }
View Full Code Here

   public static class Builder extends BaseProviderMetadata.Builder {

      protected Builder() {
         id("joyentcloud")
         .name("JoyentCloud")
         .apiMetadata(new JoyentCloudApiMetadata())
         .homepage(URI.create("http://www.joyent.com/products/smartdatacenter/"))
         .console(URI.create("https://my.joyentcloud.com/login"))
         .iso3166Codes("US-VA", "US-CA", "US-NV", "NL-NH")
         .endpoint("https://api.joyentcloud.com")
         .defaultProperties(JoyentCloudProviderMetadata.defaultProperties());
View Full Code Here

@Test(groups = "unit", testName = "JoyentCloudProviderMetadataTest")
public class JoyentCloudProviderMetadataTest extends BaseProviderMetadataTest {

   public JoyentCloudProviderMetadataTest() {
      super(new JoyentCloudProviderMetadata(), new JoyentCloudApiMetadata());
   }
View Full Code Here

   public static class Builder extends BaseProviderMetadata.Builder {

      protected Builder() {
         id("joyentcloud")
         .name("JoyentCloud")
         .apiMetadata(new JoyentCloudApiMetadata())
         .homepage(URI.create("http://www.joyent.com/products/smartdatacenter/"))
         .console(URI.create("https://my.joyentcloud.com/login"))
         .iso3166Codes("US-VA", "US-CA", "US-NV", "NL-NH")
         .endpoint("https://api.joyentcloud.com")
         .defaultProperties(JoyentCloudProviderMetadata.defaultProperties());
View Full Code Here

      return createInjector(fn, module, props).getInstance(ComputeServiceContext.class);
   }
  
   @Override
   protected ApiMetadata createApiMetadata() {
      return new JoyentCloudApiMetadata();
   }
View Full Code Here

     
      if (!templateOptions.shouldGenerateKey().isPresent())
         templateOptions.generateKey(defaultToAutogenerateKeys);

      if (templateOptions.shouldGenerateKey().get()) {
         KeyAndPrivateKey keyPair = keyCache.getUnchecked(DatacenterAndName.fromDatacenterAndName(datacenter, namingConvention.create()
               .sharedNameForGroup(group)));
         // in order to delete the key later
         keyCache.asMap().put(DatacenterAndName.fromDatacenterAndName(datacenter, keyPair.getKey().getName()), keyPair);
         templateOptions.overrideLoginPrivateKey(keyPair.getPrivateKey());
      }
      checkArgument(templateOptions.getRunScript() == null || templateOptions.getLoginPrivateKey() != null,
            "when specifying runScript, you must either set overrideLoginPrivateKey, or generateKey(true)");
      return super.execute(group, count, mutableTemplate, goodNodes, badNodes, customizationResponses);
   }
View Full Code Here

   public Map<?, ListenableFuture<Void>> execute(String group, int count, Template template, Set<NodeMetadata> goodNodes,
         Map<NodeMetadata, Exception> badNodes, Multimap<NodeMetadata, CustomizationResponse> customizationResponses) {

      Template mutableTemplate = template.clone();

      JoyentCloudTemplateOptions templateOptions = JoyentCloudTemplateOptions.class.cast(mutableTemplate.getOptions());

      assert template.getOptions().equals(templateOptions) : "options didn't clone properly";

      templateOptions.userMetadata(ComputeServiceConstants.NODE_GROUP_KEY, group);

      String datacenter = mutableTemplate.getLocation().getId();
     
      if (!templateOptions.shouldGenerateKey().isPresent())
         templateOptions.generateKey(defaultToAutogenerateKeys);

      if (templateOptions.shouldGenerateKey().get()) {
         KeyAndPrivateKey keyPair = keyCache.getUnchecked(DatacenterAndName.fromDatacenterAndName(datacenter, namingConvention.create()
               .sharedNameForGroup(group)));
         // in order to delete the key later
         keyCache.asMap().put(DatacenterAndName.fromDatacenterAndName(datacenter, keyPair.getKey().getName()), keyPair);
         templateOptions.overrideLoginPrivateKey(keyPair.getPrivateKey());
      }
      checkArgument(templateOptions.getRunScript() == null || templateOptions.getLoginPrivateKey() != null,
            "when specifying runScript, you must either set overrideLoginPrivateKey, or generateKey(true)");
      return super.execute(group, count, mutableTemplate, goodNodes, badNodes, customizationResponses);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.joyent.cloudapi.v6_5.domain.Key

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