Search in sources :

Example 1 with AdminAccess

use of org.jclouds.scriptbuilder.statements.login.AdminAccess in project fabric8 by jboss-fuse.

the class ToTemplate method apply.

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();
}
Also used : TemplateBuilder(org.jclouds.compute.domain.TemplateBuilder) AdminAccess(org.jclouds.scriptbuilder.statements.login.AdminAccess) TemplateOptions(org.jclouds.compute.options.TemplateOptions) ComputeService(org.jclouds.compute.ComputeService)

Aggregations

ComputeService (org.jclouds.compute.ComputeService)1 TemplateBuilder (org.jclouds.compute.domain.TemplateBuilder)1 TemplateOptions (org.jclouds.compute.options.TemplateOptions)1 AdminAccess (org.jclouds.scriptbuilder.statements.login.AdminAccess)1