Examples of templateBuilder()


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

      } catch (Throwable t) {
         System.err.println(t.getMessage());
         return null;
      }

      TemplateBuilder builder = service.templateBuilder();
      builder.any();
      if (smallest) {
         builder.smallest();
      }
      if (fastest) {
View Full Code Here

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

      properties.setProperty("oauth.identity", "MOMMA");
      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
View Full Code Here

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

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

              .put(LIST_GOOGLE_IMAGES_REQUEST, LIST_GOOGLE_IMAGES_RESPONSE)
              .put(LIST_MACHINE_TYPES_REQUEST, LIST_MACHINE_TYPES_RESPONSE)
              .build();

      ComputeService client = requestsSendResponses(requestResponseMap);
      Template template = client.templateBuilder().build();
      Template toMatch = client.templateBuilder().imageId(template.getImage().getId()).build();
      assertEquals(toMatch.getImage(), template.getImage());
   }

   @Test
View Full Code Here

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

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

      ComputeService client = requestsSendResponses(requestResponseMap);
      Template template = client.templateBuilder().build();
      Template toMatch = client.templateBuilder().imageId(template.getImage().getId()).build();
      assertEquals(toMatch.getImage(), template.getImage());
   }

   @Test
   public void testNetworksAndFirewallDeletedWhenAllGroupNodesAreTerminated() throws IOException {
View Full Code Here

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

      ComputeService apiForOpenStack = requestsSendResponses(defaultTemplateOpenStack);

      Template defaultTemplate = apiForOpenStack.templateBuilder().imageId("RegionOne/15").build();
      checkTemplate(defaultTemplate);
      checkTemplate(apiForOpenStack.templateBuilder().fromTemplate(defaultTemplate).build());

   }

   private void checkTemplate(Template defaultTemplate) {
      assertEquals(defaultTemplate.getImage().getId(), "RegionOne/15");
View Full Code Here

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

      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

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

  
      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

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

   public void testDefaultTemplateOpenStack() throws Exception {

      ComputeService apiForOpenStack = requestsSendResponses(defaultTemplateOpenStack);

      Template defaultTemplate = apiForOpenStack.templateBuilder().imageId("RegionOne/15").build();
      checkTemplate(defaultTemplate);
      checkTemplate(apiForOpenStack.templateBuilder().fromTemplate(defaultTemplate).build());

   }
View Full Code Here

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

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

      NodeMetadata node = Iterables.getOnlyElement(
            apiThatCreatesNode.createNodesInGroup("test", 1,
            apiThatCreatesNode.templateBuilder().from("osDescriptionMatches=.*fedora.*,loginUser=ec2-user").build()));
      assertEquals(node.getCredentials().getUser(), "ec2-user");
      assertNotNull(node.getCredentials().getPrivateKey());
   }

}
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.