public TemplateBuilder apply(TemplateBuilder b) { return b.any(); }}); return (T)this;
@Override public Set<? extends NodeMetadata> createNodesInGroup(String group, int count, TemplateOptions templateOptions) throws RunNodesException { return createNodesInGroup(group, count, templateBuilder().any().options(templateOptions).build()); }
@Override public Set<? extends NodeMetadata> createNodesInGroup(String group, int count, TemplateOptions templateOptions) throws RunNodesException { return createNodesInGroup(group, count, templateBuilder().any().options(templateOptions).build()); }
@Override public Set<? extends NodeMetadata> createNodesInGroup(String group, int count, TemplateOptions templateOptions) throws RunNodesException { return createNodesInGroup(group, count, templateBuilder().any().options(templateOptions).build()); }
@Override public Set<? extends NodeMetadata> createNodesInGroup(String group, int count, TemplateOptions templateOptions) throws RunNodesException { return createNodesInGroup(group, count, templateBuilder().any().options(templateOptions).build()); }
/** * Create a node with the specified group. */ protected void createNode(Exchange exchange) throws CamelException { String group = getGroup(exchange); String imageId = getImageId(exchange); String locationId = getLocationId(exchange); String hardwareId = getHardwareId(exchange); if (ObjectHelper.isEmpty(group)) { throw new CamelExchangeException("Group must be specific in the URI or as exchange property for the destroy node operation.", exchange); } TemplateBuilder builder = computeService.templateBuilder(); builder.any(); if (ObjectHelper.isNotEmpty(locationId)) { builder.locationId(locationId); } if (ObjectHelper.isNotEmpty(imageId)) { builder.imageId(imageId); } if (ObjectHelper.isNotEmpty(hardwareId)) { 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); } }
public static Template apply(CreateJCloudsContainerOptions options) { ComputeService service = options.getComputeService(); TemplateOptions templateOptions = service.templateOptions(); TemplateBuilder builder = service.templateBuilder().any(); applyInstanceType(builder, options); applyImageType(builder, options); applyLocation(builder, options); applyProviderSpecificOptions(templateOptions, options); Optional<AdminAccess> adminAccess = ToAdminAccess.apply(options); if (adminAccess.isPresent()) { templateOptions.runScript(adminAccess.get()); } builder = builder.options(templateOptions); return builder.build(); }
builder.any(); if (smallest) { builder.smallest();