use of com.sequenceiq.cloudbreak.api.model.CloudbreakEventsJson in project cloudbreak by hortonworks.
the class InteractiveCredentialCreationHandler method sendErrorNotification.
public void sendErrorNotification(String owner, String account, String cloudPlatform, String errorMessage) {
CloudbreakEventsJson notification = new CloudbreakEventsJson();
notification.setEventType("CREDENTIAL_CREATE_FAILED");
notification.setEventTimestamp(new Date().getTime());
notification.setEventMessage(errorMessage);
notification.setOwner(owner);
notification.setAccount(account);
notification.setCloud(cloudPlatform);
notificationSender.send(new Notification<>(notification));
}
use of com.sequenceiq.cloudbreak.api.model.CloudbreakEventsJson in project cloudbreak by hortonworks.
the class ImageStatusCheckerTask method getImageCopyNotification.
private Notification<CloudbreakEventsJson> getImageCopyNotification(ImageStatusResult result, Stack stack) {
CloudbreakEventsJson notification = new CloudbreakEventsJson();
notification.setEventType("IMAGE_COPY_STATE");
notification.setEventTimestamp(new Date().getTime());
notification.setEventMessage(String.valueOf(result.getStatusProgressValue()));
notification.setOwner(stack.getOwner());
notification.setAccount(stack.getAccount());
notification.setCloud(stack.cloudPlatform());
notification.setRegion(stack.getRegion());
notification.setStackId(stack.getId());
notification.setStackName(stack.getDisplayName());
notification.setStackStatus(stack.getStatus());
return new Notification<>(notification);
}
use of com.sequenceiq.cloudbreak.api.model.CloudbreakEventsJson in project cloudbreak by hortonworks.
the class AmbariOperationsStatusCheckerTask method getAmbariProgressNotification.
private Notification<CloudbreakEventsJson> getAmbariProgressNotification(Long progressValue, Stack stack, AmbariOperationType ambariOperationType) {
CloudbreakEventsJson notification = new CloudbreakEventsJson();
notification.setEventType(ambariOperationType.name());
notification.setEventTimestamp(new Date().getTime());
notification.setEventMessage(String.valueOf(progressValue));
notification.setOwner(stack.getOwner());
notification.setAccount(stack.getAccount());
notification.setCloud(stack.cloudPlatform());
notification.setRegion(stack.getRegion());
notification.setStackId(stack.getId());
notification.setStackName(stack.getDisplayName());
notification.setStackStatus(stack.getStatus());
if (stack.getCluster() != null) {
notification.setClusterId(stack.getCluster().getId());
notification.setClusterName(stack.getCluster().getName());
}
return new Notification<>(notification);
}
use of com.sequenceiq.cloudbreak.api.model.CloudbreakEventsJson in project cloudbreak by hortonworks.
the class StructuredNotificationEventToCloudbreakEventJsonConverter method convert.
@Override
public CloudbreakEventsJson convert(StructuredNotificationEvent source) {
CloudbreakEventsJson cloudbreakEvent = new CloudbreakEventsJson();
NotificationDetails notificationDetails = source.getNotificationDetails();
OperationDetails operationDetails = source.getOperation();
cloudbreakEvent.setEventType(notificationDetails.getNotificationType());
cloudbreakEvent.setEventTimestamp(operationDetails.getTimestamp());
cloudbreakEvent.setEventMessage(notificationDetails.getNotification());
cloudbreakEvent.setOwner(operationDetails.getUserId());
cloudbreakEvent.setAccount(operationDetails.getAccount());
cloudbreakEvent.setCloud(notificationDetails.getCloud());
cloudbreakEvent.setRegion(notificationDetails.getRegion());
cloudbreakEvent.setAvailabilityZone(notificationDetails.getAvailabiltyZone());
cloudbreakEvent.setBlueprintId(notificationDetails.getBlueprintId());
cloudbreakEvent.setBlueprintName(notificationDetails.getBlueprintName());
cloudbreakEvent.setClusterId(notificationDetails.getClusterId());
cloudbreakEvent.setClusterName(notificationDetails.getClusterName());
cloudbreakEvent.setStackId(notificationDetails.getStackId());
cloudbreakEvent.setStackName(notificationDetails.getStackName());
cloudbreakEvent.setStackStatus(Status.valueOf(notificationDetails.getStackStatus()));
cloudbreakEvent.setNodeCount(notificationDetails.getNodeCount());
cloudbreakEvent.setInstanceGroup(notificationDetails.getInstanceGroup());
if (notificationDetails.getClusterStatus() != null) {
cloudbreakEvent.setClusterStatus(Status.valueOf(notificationDetails.getClusterStatus()));
}
return cloudbreakEvent;
}
use of com.sequenceiq.cloudbreak.api.model.CloudbreakEventsJson in project cloudbreak by hortonworks.
the class StackCreationService method getImageCopyNotification.
private Notification<CloudbreakEventsJson> getImageCopyNotification(CheckImageResult result, Stack stack) {
CloudbreakEventsJson notification = new CloudbreakEventsJson();
notification.setEventType("IMAGE_COPY_STATE");
notification.setEventTimestamp(new Date().getTime());
notification.setEventMessage(String.valueOf(result.getStatusProgressValue()));
notification.setOwner(stack.getOwner());
notification.setAccount(stack.getAccount());
notification.setCloud(stack.cloudPlatform());
notification.setRegion(stack.getRegion());
notification.setStackId(stack.getId());
notification.setStackName(stack.getDisplayName());
notification.setStackStatus(stack.getStatus());
return new Notification<>(notification);
}
Aggregations