Search in sources :

Example 31 with InstanceGroupType

use of com.sequenceiq.common.api.type.InstanceGroupType in project cloudbreak by hortonworks.

the class ComponentTestUtil method getStackForLaunch.

public CloudStack getStackForLaunch(InstanceStatus createRequested, InstanceStatus createRequested1) throws IOException {
    InstanceAuthentication instanceAuthentication = new InstanceAuthentication(PUBLIC_KEY, "pubkeyid", LOGIN_USER_NAME);
    CloudInstance instance = getCloudInstance(instanceAuthentication, "group1", InstanceStatus.CREATE_REQUESTED, 0L, null);
    Security security = getSecurity();
    List<Group> groups = List.of(new Group("group1", InstanceGroupType.CORE, List.of(instance), security, null, instanceAuthentication, instanceAuthentication.getLoginUserName(), instanceAuthentication.getPublicKey(), ROOT_VOLUME_SIZE, Optional.empty(), createGroupNetwork(), emptyMap()));
    Network network = new Network(new Subnet(CIDR));
    Map<InstanceGroupType, String> userData = ImmutableMap.of(InstanceGroupType.CORE, CORE_CUSTOM_DATA, InstanceGroupType.GATEWAY, GATEWAY_CUSTOM_DATA);
    Image image = new Image("cb-centos66-amb200-2015-05-25", userData, "redhat6", "redhat6", "", "default", "default-id", new HashMap<>());
    String template = configuration.getTemplate(LATEST_AWS_CLOUD_FORMATION_TEMPLATE_PATH, "UTF-8").toString();
    SpiFileSystem efsFileSystem = getEfsFileSystem();
    return new CloudStack(groups, network, image, Map.of(), Map.of(), template, instanceAuthentication, LOGIN_USER_NAME, PUBLIC_KEY, efsFileSystem);
}
Also used : Group(com.sequenceiq.cloudbreak.cloud.model.Group) InstanceAuthentication(com.sequenceiq.cloudbreak.cloud.model.InstanceAuthentication) InstanceGroupType(com.sequenceiq.common.api.type.InstanceGroupType) CloudInstance(com.sequenceiq.cloudbreak.cloud.model.CloudInstance) SpiFileSystem(com.sequenceiq.cloudbreak.cloud.model.SpiFileSystem) Security(com.sequenceiq.cloudbreak.cloud.model.Security) Image(com.sequenceiq.cloudbreak.cloud.model.Image) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) GroupNetwork(com.sequenceiq.cloudbreak.cloud.model.GroupNetwork) Network(com.sequenceiq.cloudbreak.cloud.model.Network) Subnet(com.sequenceiq.cloudbreak.cloud.model.Subnet)

Aggregations

InstanceGroupType (com.sequenceiq.common.api.type.InstanceGroupType)31 Image (com.sequenceiq.cloudbreak.cloud.model.Image)17 CloudStack (com.sequenceiq.cloudbreak.cloud.model.CloudStack)10 HashMap (java.util.HashMap)10 Test (org.junit.Test)9 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)9 CloudInstance (com.sequenceiq.cloudbreak.cloud.model.CloudInstance)8 Network (com.sequenceiq.cloudbreak.cloud.model.Network)8 Security (com.sequenceiq.cloudbreak.cloud.model.Security)8 BeforeEach (org.junit.jupiter.api.BeforeEach)8 CcmConnectivityParameters (com.sequenceiq.cloudbreak.ccm.cloudinit.CcmConnectivityParameters)7 InstanceAuthentication (com.sequenceiq.cloudbreak.cloud.model.InstanceAuthentication)7 Group (com.sequenceiq.cloudbreak.cloud.model.Group)6 CloudResource (com.sequenceiq.cloudbreak.cloud.model.CloudResource)5 Json (com.sequenceiq.cloudbreak.common.json.Json)5 GroupNetwork (com.sequenceiq.cloudbreak.cloud.model.GroupNetwork)4 InstanceTemplate (com.sequenceiq.cloudbreak.cloud.model.InstanceTemplate)4 PortDefinition (com.sequenceiq.cloudbreak.cloud.model.PortDefinition)4 SecurityRule (com.sequenceiq.cloudbreak.cloud.model.SecurityRule)4 Volume (com.sequenceiq.cloudbreak.cloud.model.Volume)4