Search in sources :

Example 6 with MachineConfig

use of org.eclipse.che.api.core.model.workspace.config.MachineConfig in project che-server by eclipse-che.

the class TestObjects method createEnvironment.

public static EnvironmentImpl createEnvironment(String... machineRams) throws Exception {
    final Map<String, MachineConfig> machines = new HashMap<>();
    for (String machineRam : machineRams) {
        final MachineConfigImpl machineConfig = new MachineConfigImpl();
        machineConfig.setAttributes(ImmutableMap.of(MachineConfig.MEMORY_LIMIT_ATTRIBUTE, machineRam));
        machines.put("dev-machine", machineConfig);
    }
    final RecipeImpl recipe = new RecipeImpl("compose", "application/x-yaml", "", null);
    return new EnvironmentImpl(recipe, machines);
}
Also used : MachineConfigImpl(org.eclipse.che.api.workspace.server.model.impl.MachineConfigImpl) MachineConfig(org.eclipse.che.api.core.model.workspace.config.MachineConfig) HashMap(java.util.HashMap) RecipeImpl(org.eclipse.che.api.workspace.server.model.impl.RecipeImpl) EnvironmentImpl(org.eclipse.che.api.workspace.server.model.impl.EnvironmentImpl)

Aggregations

MachineConfig (org.eclipse.che.api.core.model.workspace.config.MachineConfig)6 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)4 Map (java.util.Map)4 MachineConfigImpl (org.eclipse.che.api.workspace.server.model.impl.MachineConfigImpl)4 ImmutableMap (com.google.common.collect.ImmutableMap)2 Container (io.fabric8.kubernetes.api.model.Container)2 HasMetadata (io.fabric8.kubernetes.api.model.HasMetadata)2 KubernetesList (io.fabric8.kubernetes.api.model.KubernetesList)2 PersistentVolumeClaim (io.fabric8.kubernetes.api.model.PersistentVolumeClaim)2 Pod (io.fabric8.kubernetes.api.model.Pod)2 PodBuilder (io.fabric8.kubernetes.api.model.PodBuilder)2 Serialization.unmarshal (io.fabric8.kubernetes.client.utils.Serialization.unmarshal)2 IOException (java.io.IOException)2 Arrays (java.util.Arrays)2 Arrays.asList (java.util.Arrays.asList)2 Collections (java.util.Collections)2 Collections.emptyMap (java.util.Collections.emptyMap)2 Collections.singletonList (java.util.Collections.singletonList)2 Collections.singletonMap (java.util.Collections.singletonMap)2