Search in sources :

Example 6 with Instance

use of com.scaleset.cfbuilder.ec2.Instance in project TOSCAna by StuPro-TOSCAna.

the class OperationHandler method addCreate.

/**
 *     Manually adds a create command with the given input variables and file path to the given EC2 instance.
 *
 *     @param filePath   path to the artifact
 *     @param serverName name of the Instance
 */
public void addCreate(String filePath, String serverName) {
    markUtilFile(filePath);
    CFNFile cfnFile = handleOperationFile(filePath, MODE_500, serverName);
    CFNCommand cfnCommand = handleOperationCommand(filePath, new HashSet<>());
    // Add file to config and execution command
    cfnModule.getCFNInit(serverName).getOrAddConfig(CONFIG_SETS, CONFIG_CREATE).putFile(cfnFile).putCommand(cfnCommand);
}
Also used : CFNFile(com.scaleset.cfbuilder.ec2.metadata.CFNFile) CFNCommand(com.scaleset.cfbuilder.ec2.metadata.CFNCommand)

Example 7 with Instance

use of com.scaleset.cfbuilder.ec2.Instance in project omegat by omegat-org.

the class FilterMaster method getDefaultSettingsFromFilter.

/**
 * Create default filter's config.
 *
 * @param filterClassname
 *            filter's classname
 * @return default filter's config
 */
public static Filter getDefaultSettingsFromFilter(final String filterClassname) {
    IFilter f = getFilterInstance(filterClassname);
    if (f == null) {
        return null;
    }
    Filter fc = new Filter();
    fc.setClassName(f.getClass().getName());
    fc.setEnabled(true);
    for (Instance ins : f.getDefaultInstances()) {
        Files ff = new Files();
        ff.setSourceEncoding(ins.getSourceEncoding());
        ff.setSourceFilenameMask(ins.getSourceFilenameMask());
        ff.setTargetEncoding(ins.getTargetEncoding());
        ff.setTargetFilenamePattern(ins.getTargetFilenamePattern());
        fc.getFiles().add(ff);
    }
    return fc;
}
Also used : IFilter(org.omegat.filters2.IFilter) IFilter(org.omegat.filters2.IFilter) Filter(gen.core.filters.Filter) AbstractFilter(org.omegat.filters2.AbstractFilter) Instance(org.omegat.filters2.Instance) Files(gen.core.filters.Files)

Aggregations

Instance (com.scaleset.cfbuilder.ec2.Instance)3 CFNCommand (com.scaleset.cfbuilder.ec2.metadata.CFNCommand)3 CFNFile (com.scaleset.cfbuilder.ec2.metadata.CFNFile)3 CFNInit (com.scaleset.cfbuilder.ec2.metadata.CFNInit)2 SdkClientException (com.amazonaws.SdkClientException)1 Authentication (com.scaleset.cfbuilder.cloudformation.Authentication)1 Resource (com.scaleset.cfbuilder.core.Resource)1 SecurityGroup (com.scaleset.cfbuilder.ec2.SecurityGroup)1 UserData (com.scaleset.cfbuilder.ec2.UserData)1 EC2BlockDeviceMapping (com.scaleset.cfbuilder.ec2.instance.EC2BlockDeviceMapping)1 EC2EBSBlockDevice (com.scaleset.cfbuilder.ec2.instance.ec2blockdevicemapping.EC2EBSBlockDevice)1 CFNPackage (com.scaleset.cfbuilder.ec2.metadata.CFNPackage)1 Role (com.scaleset.cfbuilder.iam.Role)1 DBInstance (com.scaleset.cfbuilder.rds.DBInstance)1 Files (gen.core.filters.Files)1 Filter (gen.core.filters.Filter)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1