use of com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.InstanceMetadataType in project cloudbreak by hortonworks.
the class TestUtil method instanceMetaData.
public static InstanceMetaData instanceMetaData(Long serverNumber, Long instanceGroupId, InstanceStatus instanceStatus, boolean ambariServer, InstanceGroup instanceGroup, InstanceMetadataType instanceMetadataType) {
InstanceMetaData instanceMetaData = new InstanceMetaData();
instanceMetaData.setInstanceStatus(instanceStatus);
instanceMetaData.setServer(ambariServer);
instanceMetaData.setSshPort(22);
instanceMetaData.setDiscoveryFQDN("test-" + instanceGroup.getGroupName() + "-" + instanceGroupId + '-' + serverNumber);
instanceMetaData.setInstanceId("test-" + instanceGroupId + '-' + serverNumber);
instanceMetaData.setPrivateIp("1.1." + instanceGroupId + '.' + serverNumber);
instanceMetaData.setPublicIp("2.2." + instanceGroupId + '.' + serverNumber);
instanceMetaData.setId(instanceGroupId + serverNumber);
instanceMetaData.setInstanceGroup(instanceGroup);
instanceMetaData.setStartDate(new Date().getTime());
instanceMetaData.setLifeCycle(InstanceLifeCycle.SPOT);
boolean gatewayInstanceGroup = instanceGroup.getInstanceGroupType().equals(InstanceGroupType.GATEWAY);
InstanceMetadataType imType = gatewayInstanceGroup ? InstanceMetadataType.GATEWAY_PRIMARY : instanceMetadataType;
instanceMetaData.setInstanceMetadataType(imType);
return instanceMetaData;
}
Aggregations