Package org.jclouds.compute

Examples of org.jclouds.compute.ComputeService.templateBuilder()


      properties.setProperty("oauth.credential", "MiA");

      ComputeService client = requestsSendResponses(ImmutableMap.<HttpRequest, HttpResponse>of(), createModule(),
              properties);
      Template template = client.templateBuilder().build();
      Template toMatch = client.templateBuilder().imageId(template.getImage().getId()).build();
      assertEquals(toMatch.getImage(), template.getImage());
   }

   @Test
   public void testTemplateMatch() throws Exception {
View Full Code Here


              .put(LIST_MACHINE_TYPES_REQUEST, LIST_MACHINE_TYPES_RESPONSE)
              .put(LIST_CENTRAL1B_MACHINE_TYPES_REQUEST, LIST_CENTRAL1B_MACHINE_TYPES_RESPONSE)
              .build();

      ComputeService client = requestsSendResponses(requestResponseMap);
      Template template = client.templateBuilder().build();
      Hardware defaultSize = client.templateBuilder().build().getHardware();

      Hardware smallest = client.templateBuilder().smallest().build().getHardware();
      assertEquals(defaultSize, smallest);
View Full Code Here

              .put(LIST_CENTRAL1B_MACHINE_TYPES_REQUEST, LIST_CENTRAL1B_MACHINE_TYPES_RESPONSE)
              .build();

      ComputeService client = requestsSendResponses(requestResponseMap);
      Template template = client.templateBuilder().build();
      Hardware defaultSize = client.templateBuilder().build().getHardware();

      Hardware smallest = client.templateBuilder().smallest().build().getHardware();
      assertEquals(defaultSize, smallest);

      Hardware fastest = client.templateBuilder().fastest().build().getHardware();
View Full Code Here

      ComputeService client = requestsSendResponses(requestResponseMap);
      Template template = client.templateBuilder().build();
      Hardware defaultSize = client.templateBuilder().build().getHardware();

      Hardware smallest = client.templateBuilder().smallest().build().getHardware();
      assertEquals(defaultSize, smallest);

      Hardware fastest = client.templateBuilder().fastest().build().getHardware();
      assertNotNull(fastest);
View Full Code Here

      Hardware defaultSize = client.templateBuilder().build().getHardware();

      Hardware smallest = client.templateBuilder().smallest().build().getHardware();
      assertEquals(defaultSize, smallest);

      Hardware fastest = client.templateBuilder().fastest().build().getHardware();
      assertNotNull(fastest);

      assertEquals(client.listHardwareProfiles().size(), 5);

      Template toMatch = client.templateBuilder()
View Full Code Here

      Hardware fastest = client.templateBuilder().fastest().build().getHardware();
      assertNotNull(fastest);

      assertEquals(client.listHardwareProfiles().size(), 5);

      Template toMatch = client.templateBuilder()
              .imageId(template.getImage().getId())
              .build();
      assertEquals(toMatch.getImage(), template.getImage());
   }
View Full Code Here

      InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn starter = compute.getContext()
               .utils().injector().getInstance(
                        InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn.class);


      NodeAndInitialCredentials<VApp> appAndCreds = starter.createNodeWithGroupEncodedIntoName(group, name, compute
               .templateBuilder().build());

      assertEquals(appAndCreds.getNode().getName(), name);
      assertEquals(appAndCreds.getCredentials(), LoginCredentials.builder().user("root").password("fromVApp").build());
View Full Code Here

  
      InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn starter = compute.getContext()
               .utils().injector().getInstance(
                        InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn.class);

      Template template = compute.templateBuilder().build();
      template.getOptions().as(VCloudTemplateOptions.class).parentNetwork(parentNetwork).fenceMode(fenceMode);
      starter.instantiateVAppFromTemplate(name, template);

   }
}
View Full Code Here

      requestResponseMap.put(requestSpotInstancesRequest, requestSpotInstancesResponse);
      requestResponseMap.put(describeSpotInstanceRequest, describeSpotInstanceResponse);

      ComputeService createsVPCSpotInstance = requestsSendResponses(requestResponseMap.build());

      Template template = createsVPCSpotInstance.templateBuilder().locationId("us-east-1a").build();

      template.getOptions().as(AWSEC2TemplateOptions.class).spotPrice(1f).subnetId("subnet-xyz").keyPair("Demo").blockUntilRunning(false);

      NodeMetadata node = Iterables.getOnlyElement(createsVPCSpotInstance.createNodesInGroup("test", 1, template));
      assertEquals(node.getId(), "us-east-1/sir-228e6406");
View Full Code Here

      requestResponseMap.put(requestSpotInstancesRequest, requestSpotInstancesResponse);
      requestResponseMap.put(describeSpotInstanceRequest, describeSpotInstanceResponse);

      ComputeService createsSpotInstance = requestsSendResponses(requestResponseMap.build());

      Template template = createsSpotInstance.templateBuilder().locationId("us-east-1a").build();

      template.getOptions().as(AWSEC2TemplateOptions.class).spotPrice(1f).iamInstanceProfileArn(iamInstanceProfileArn)
            .noKeyPair().blockUntilRunning(false);

      NodeMetadata node = Iterables.getOnlyElement(createsSpotInstance.createNodesInGroup("test", 1, template));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.