Search in sources :

Example 6 with AuditEventV4Responses

use of com.sequenceiq.cloudbreak.api.endpoint.v4.audits.responses.AuditEventV4Responses in project cloudbreak by hortonworks.

the class DistroXTestDto method investigate.

@Override
public Clue investigate() {
    if (getResponse() == null || getResponse().getId() == null) {
        return null;
    }
    AuditEventV4Responses auditEvents = AuditUtil.getAuditEvents(getTestContext().getMicroserviceClient(CloudbreakClient.class), CloudbreakEventService.DATAHUB_RESOURCE_TYPE, getResponse().getId(), null);
    boolean hasSpotTermination = (getResponse().getInstanceGroups() == null) ? false : getResponse().getInstanceGroups().stream().flatMap(ig -> ig.getMetadata().stream()).anyMatch(metadata -> InstanceStatus.DELETED_BY_PROVIDER == metadata.getInstanceStatus());
    return new Clue("DistroX", auditEvents, getResponse(), hasSpotTermination);
}
Also used : STACK_DELETED(com.sequenceiq.it.cloudbreak.testcase.AbstractIntegrationTest.STACK_DELETED) DistroXUpgradeV1Request(com.sequenceiq.distrox.api.v1.distrox.model.upgrade.DistroXUpgradeV1Request) LoggerFactory(org.slf4j.LoggerFactory) RunningParameter.key(com.sequenceiq.it.cloudbreak.context.RunningParameter.key) ClusterTemplateTestDto(com.sequenceiq.it.cloudbreak.dto.clustertemplate.ClusterTemplateTestDto) InstanceMetaDataV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.instancegroup.instancemetadata.InstanceMetaDataV4Response) Prototype(com.sequenceiq.it.cloudbreak.Prototype) CloudbreakEventService(com.sequenceiq.cloudbreak.structuredevent.event.CloudbreakEventService) Map(java.util.Map) ListUtils(org.apache.commons.collections4.ListUtils) AwsInstanceTemplateV1SpotParameters(com.sequenceiq.distrox.api.v1.distrox.model.instancegroup.template.AwsInstanceTemplateV1SpotParameters) StackV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response) Purgable(com.sequenceiq.it.cloudbreak.context.Purgable) InstanceStatus(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.InstanceStatus) Status(com.sequenceiq.cloudbreak.api.endpoint.v4.common.Status) InstanceGroupV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.instancegroup.InstanceGroupV4Response) AuditUtil(com.sequenceiq.it.cloudbreak.util.AuditUtil) Collectors(java.util.stream.Collectors) NotFoundException(javax.ws.rs.NotFoundException) Objects(java.util.Objects) List(java.util.List) DistroXTestClient(com.sequenceiq.it.cloudbreak.client.DistroXTestClient) RunningParameter.emptyRunningParameter(com.sequenceiq.it.cloudbreak.context.RunningParameter.emptyRunningParameter) Optional(java.util.Optional) CloudbreakClient(com.sequenceiq.it.cloudbreak.CloudbreakClient) ResponseUtil(com.sequenceiq.it.cloudbreak.util.ResponseUtil) Investigable(com.sequenceiq.it.cloudbreak.context.Investigable) Supplier(java.util.function.Supplier) CloudPlatform(com.sequenceiq.cloudbreak.common.mappable.CloudPlatform) Sets(org.assertj.core.util.Sets) Inject(javax.inject.Inject) AwsInstanceTemplateV1Parameters(com.sequenceiq.distrox.api.v1.distrox.model.instancegroup.template.AwsInstanceTemplateV1Parameters) Searchable(com.sequenceiq.it.cloudbreak.search.Searchable) TestFailException(com.sequenceiq.it.cloudbreak.exception.TestFailException) DistroXUpgradeTestDto(com.sequenceiq.it.cloudbreak.dto.distrox.cluster.DistroXUpgradeTestDto) DistroXV1Request(com.sequenceiq.distrox.api.v1.distrox.model.DistroXV1Request) DistroXV1Endpoint(com.sequenceiq.distrox.api.v1.distrox.endpoint.DistroXV1Endpoint) InstanceGroupV1Request(com.sequenceiq.distrox.api.v1.distrox.model.instancegroup.InstanceGroupV1Request) Logger(org.slf4j.Logger) TestContext(com.sequenceiq.it.cloudbreak.context.TestContext) CloudbreakTestDto(com.sequenceiq.it.cloudbreak.dto.CloudbreakTestDto) StackViewV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackViewV4Response) Clue(com.sequenceiq.it.cloudbreak.context.Clue) AuditEventV4Responses(com.sequenceiq.cloudbreak.api.endpoint.v4.audits.responses.AuditEventV4Responses) EnvironmentTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto) RunningParameter(com.sequenceiq.it.cloudbreak.context.RunningParameter) GeneratedBlueprintV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.GeneratedBlueprintV4Response) DistroXDatabaseRequest(com.sequenceiq.distrox.api.v1.distrox.model.database.DistroXDatabaseRequest) Collections(java.util.Collections) InstanceUtil(com.sequenceiq.it.cloudbreak.util.InstanceUtil) CloudbreakClient(com.sequenceiq.it.cloudbreak.CloudbreakClient) AuditEventV4Responses(com.sequenceiq.cloudbreak.api.endpoint.v4.audits.responses.AuditEventV4Responses) Clue(com.sequenceiq.it.cloudbreak.context.Clue)

Example 7 with AuditEventV4Responses

use of com.sequenceiq.cloudbreak.api.endpoint.v4.audits.responses.AuditEventV4Responses in project cloudbreak by hortonworks.

the class StackTestDto method investigate.

@Override
public Clue investigate() {
    if (getResponse() == null || getResponse().getId() == null) {
        return null;
    }
    AuditEventV4Responses auditEvents = AuditUtil.getAuditEvents(getTestContext().getMicroserviceClient(CloudbreakClient.class), CloudbreakEventService.DATAHUB_RESOURCE_TYPE, getResponse().getId(), null);
    boolean hasSpotTermination = (getResponse().getInstanceGroups() == null) ? false : getResponse().getInstanceGroups().stream().flatMap(ig -> ig.getMetadata().stream()).anyMatch(metadata -> InstanceStatus.DELETED_BY_PROVIDER == metadata.getInstanceStatus());
    return new Clue("DistroX", auditEvents, getResponse(), hasSpotTermination);
}
Also used : STACK_DELETED(com.sequenceiq.it.cloudbreak.testcase.AbstractIntegrationTest.STACK_DELETED) ResponseUtil(com.sequenceiq.it.cloudbreak.util.ResponseUtil) Investigable(com.sequenceiq.it.cloudbreak.context.Investigable) LoggerFactory(org.slf4j.LoggerFactory) RunningParameter.key(com.sequenceiq.it.cloudbreak.context.RunningParameter.key) Inject(javax.inject.Inject) Prototype(com.sequenceiq.it.cloudbreak.Prototype) CloudbreakEventService(com.sequenceiq.cloudbreak.structuredevent.event.CloudbreakEventService) Searchable(com.sequenceiq.it.cloudbreak.search.Searchable) Map(java.util.Map) Assignable(com.sequenceiq.it.cloudbreak.assign.Assignable) StackV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response) StackV4Endpoint(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.StackV4Endpoint) Logger(org.slf4j.Logger) TestContext(com.sequenceiq.it.cloudbreak.context.TestContext) CloudbreakTestDto(com.sequenceiq.it.cloudbreak.dto.CloudbreakTestDto) Purgable(com.sequenceiq.it.cloudbreak.context.Purgable) InstanceStatus(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.InstanceStatus) Status(com.sequenceiq.cloudbreak.api.endpoint.v4.common.Status) Crn(com.sequenceiq.cloudbreak.auth.crn.Crn) StackTestClient(com.sequenceiq.it.cloudbreak.client.StackTestClient) AuditUtil(com.sequenceiq.it.cloudbreak.util.AuditUtil) Collectors(java.util.stream.Collectors) NotFoundException(javax.ws.rs.NotFoundException) Clue(com.sequenceiq.it.cloudbreak.context.Clue) List(java.util.List) AuditEventV4Responses(com.sequenceiq.cloudbreak.api.endpoint.v4.audits.responses.AuditEventV4Responses) EnvironmentTestDto(com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto) StackV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request) AttachRecipeV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.recipe.AttachRecipeV4Request) RunningParameter(com.sequenceiq.it.cloudbreak.context.RunningParameter) GeneratedBlueprintV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.GeneratedBlueprintV4Response) CloudbreakClient(com.sequenceiq.it.cloudbreak.CloudbreakClient) CloudbreakClient(com.sequenceiq.it.cloudbreak.CloudbreakClient) AuditEventV4Responses(com.sequenceiq.cloudbreak.api.endpoint.v4.audits.responses.AuditEventV4Responses) Clue(com.sequenceiq.it.cloudbreak.context.Clue)

Aggregations

AuditEventV4Responses (com.sequenceiq.cloudbreak.api.endpoint.v4.audits.responses.AuditEventV4Responses)6 InstanceStatus (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.InstanceStatus)5 CloudbreakEventService (com.sequenceiq.cloudbreak.structuredevent.event.CloudbreakEventService)5 CloudbreakClient (com.sequenceiq.it.cloudbreak.CloudbreakClient)5 Prototype (com.sequenceiq.it.cloudbreak.Prototype)5 Clue (com.sequenceiq.it.cloudbreak.context.Clue)5 Investigable (com.sequenceiq.it.cloudbreak.context.Investigable)5 Purgable (com.sequenceiq.it.cloudbreak.context.Purgable)5 RunningParameter (com.sequenceiq.it.cloudbreak.context.RunningParameter)5 RunningParameter.key (com.sequenceiq.it.cloudbreak.context.RunningParameter.key)5 TestContext (com.sequenceiq.it.cloudbreak.context.TestContext)5 EnvironmentTestDto (com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto)5 AuditUtil (com.sequenceiq.it.cloudbreak.util.AuditUtil)5 ResponseUtil (com.sequenceiq.it.cloudbreak.util.ResponseUtil)5 List (java.util.List)5 Inject (javax.inject.Inject)5 RunningParameter.emptyRunningParameter (com.sequenceiq.it.cloudbreak.context.RunningParameter.emptyRunningParameter)4 CloudbreakTestDto (com.sequenceiq.it.cloudbreak.dto.CloudbreakTestDto)4 Searchable (com.sequenceiq.it.cloudbreak.search.Searchable)4 Map (java.util.Map)4