Example usage for com.amazonaws.services.lambda.model EventSourceMappingConfiguration getUUID

List of usage examples for com.amazonaws.services.lambda.model EventSourceMappingConfiguration getUUID

Introduction

In this page you can find the example usage for com.amazonaws.services.lambda.model EventSourceMappingConfiguration getUUID.

Prototype


public String getUUID() 

Source Link

Document

The identifier of the event source mapping.

Usage

From source file:com.netflix.spinnaker.clouddriver.lambda.deploy.ops.DeleteLambdaEventSourceAtomicOperation.java

License:Apache License

@Override
public Object operate(List priorOutputs) {
    LambdaFunction lambdaFunction = (LambdaFunction) lambdaFunctionProvider
            .getFunction(description.getAccount(), description.getRegion(), description.getFunctionName());

    List<EventSourceMappingConfiguration> eventSourceMappingConfigurations = lambdaFunction
            .getEventSourceMappings();/*  ww  w .  j av a2  s .  co  m*/

    for (EventSourceMappingConfiguration eventSourceMappingConfiguration : eventSourceMappingConfigurations) {
        if (eventSourceMappingConfiguration.getEventSourceArn()
                .equalsIgnoreCase(description.getEventSourceArn())) {
            description.setUuid(eventSourceMappingConfiguration.getUUID());
            return deleteEventSourceMappingResult();
        }
    }

    return null;
}

From source file:com.netflix.spinnaker.clouddriver.lambda.deploy.ops.UpsertLambdaEventSourceAtomicOperation.java

License:Apache License

@Override
public Object operate(List priorOutputs) {
    String functionName = description.getFunctionName();
    String region = description.getRegion();
    String account = description.getAccount();

    LambdaFunction cache = (LambdaFunction) lambdaFunctionProvider.getFunction(account, region, functionName);

    List<EventSourceMappingConfiguration> eventSourceMappingConfigurations = cache.getEventSourceMappings();
    for (EventSourceMappingConfiguration eventSourceMappingConfiguration : eventSourceMappingConfigurations) {
        if (eventSourceMappingConfiguration.getEventSourceArn()
                .equalsIgnoreCase(description.getEventSourceArn())) {
            description.setProperty("uuid", eventSourceMappingConfiguration.getUUID());
            return updateEventSourceMappingResult(cache);
        }/*from  w  ww.j  av a 2s  .co m*/
    }

    return createEventSourceMapping(cache);
}