Package org.jclouds.compute.domain

Examples of org.jclouds.compute.domain.TemplateBuilder.build()


    when(serviceContextFactory.createContext((String) any(), (String) any(), (String) any()
        (Iterable<? extends Module>) any(), (Properties) any())).thenReturn(serviceContext);
    when(serviceContext.getComputeService()).thenReturn(computeService);
    when(computeService.templateBuilder()).thenReturn(templateBuilder);
    when(templateBuilder.options((TemplateOptions) any())).thenReturn(templateBuilder);
    when(templateBuilder.build()).thenReturn(template);
   
    // here is a scenario when jt+nn does not fail
    // but the dn+tt one node fails 3, then in the retry fails 2
    // at the end result, the cluster will fail, throwing IOException
    Map<Set<String>, Stack<Integer>> reaction = Maps.newHashMap();
View Full Code Here


        clusterSpec.getPrivateKey(),
        statementBuilder);
    TemplateBuilder templateBuilder = computeService.templateBuilder()
      .options(runScript(runScript));
    strategy.configureTemplateBuilder(clusterSpec, templateBuilder);
    return templateBuilder.build();
   
  }
 
  private static Statement addUserAndAuthorizeSudo(String user,
      String publicKey, String privateKey, Statement statement) {
View Full Code Here

        Optional<AdminAccess> adminAccess = ToAdminAccess.apply(options);
        if (adminAccess.isPresent()) {
            templateOptions.runScript(adminAccess.get());
        }
        builder = builder.options(templateOptions);
        return builder.build();
    }


    /**
     * Applies node options to the template options. Currently only works for String key value pairs.
View Full Code Here

                    // template.
                    templateBuilder.options(runScript(bootInstructions));

                    NodeMetadata node =
                            getOnlyElement(compute.createNodesInGroup(groupName, 1,
                                    templateBuilder.build()));
                    System.out.printf("<< node %s: %s%n", node.getId(),
                            concat(node.getPrivateAddresses(), node.getPublicAddresses()));

                case SOLO:
                    System.out.printf(">> installing [%s] on group %s as %s%n", recipes, groupName,
View Full Code Here

            if(provider.equalsIgnoreCase("virtualbox"))
               templateBuilder.options(overrideLoginUser(loginUser).runScript(bootInstructions));
            else
               templateBuilder.options(runScript(bootInstructions));
           
            NodeMetadata node = getOnlyElement(compute.createNodesInGroup(groupName, 1, templateBuilder.build()));
            System.out.printf("<< node %s: %s%n", node.getId(),
                  concat(node.getPrivateAddresses(), node.getPublicAddresses()));

         case EXEC:
            System.out.printf(">> running [%s] on group %s as %s%n", command, groupName, login.identity);
View Full Code Here

        if (hardwareId != null) {
            builder.hardwareId(hardwareId);
        }

        try {
            Set<? extends NodeMetadata> nodeMetadatas = computeService.createNodesInGroup(group, 1, builder.build());
            exchange.getOut().setBody(nodeMetadatas);
            exchange.getOut().setHeaders(exchange.getIn().getHeaders());
        } catch (RunNodesException e) {
            throw new CamelExchangeException("Error creating jclouds node.", exchange, e);
        }
View Full Code Here

      //templateBuilder.osFamily(OsFamily.CENTOS);
      //templateBuilder.imageId("7bcd78dc-eb11-4e1b-8d93-111c62ed5fd1");
      //templateBuilder.locationId("dal01");
      //templateBuilder.minRam(8192);

      Template template = templateBuilder.build();
      // test passing custom options
      SoftLayerTemplateOptions options = template.getOptions().as(SoftLayerTemplateOptions.class);
      options.domainName("live.org");
      //options.diskType("SAN");
      //options.portSpeed(10);
View Full Code Here

        if (hardwareId != null) {
            builder.hardwareId(hardwareId);
        }

        try {
            Set<? extends NodeMetadata> nodeMetadatas = computeService.createNodesInGroup(group, 1, builder.build());
            exchange.getOut().setBody(nodeMetadatas);
            exchange.getOut().setHeaders(exchange.getIn().getHeaders());
        } catch (RunNodesException e) {
            throw new CamelException("Error creating jclouds node.", e);
        }
View Full Code Here

   public void createNodes() throws RunNodesException {
      try {
         TemplateBuilder builder = computeContext.getComputeService().templateBuilder();
         if (template != null)
            builder.from(template);
         nodes = computeContext.getComputeService().createNodesInGroup(group, 2, builder.build());
      } catch (RunNodesException e) {
         nodes = e.getSuccessfulNodes();
         throw e;
      }
   }
View Full Code Here

      TemplateBuilder templateBuilder = context.getComputeService().templateBuilder();
      templateBuilder.imageId("CENTOS_6_64");
      templateBuilder.locationId("dal01");

      Template template = templateBuilder.build();
      // test passing custom options
      SoftLayerTemplateOptions options = template.getOptions().as(SoftLayerTemplateOptions.class);
      options.domainName("live.org");
      // multi-disk option
      //options.blockDevices(ImmutableList.of(25, 400, 400));
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.