Example usage for com.amazonaws.services.lambda.model ListVersionsByFunctionRequest setMarker

List of usage examples for com.amazonaws.services.lambda.model ListVersionsByFunctionRequest setMarker

Introduction

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

Prototype


public void setMarker(String marker) 

Source Link

Document

Specify the pagination token that's returned by a previous request to retrieve the next page of results.

Usage

From source file:com.netflix.spinnaker.clouddriver.lambda.provider.agent.LambdaCachingAgent.java

License:Apache License

private Map<String, String> listFunctionRevisions(String functionArn) {
    AWSLambda lambda = amazonClientProvider.getAmazonLambda(account, region);
    String nextMarker = null;//from w  w w .  j av a2  s .c  om
    Map<String, String> listRevionIds = new HashMap<String, String>();
    do {
        ListVersionsByFunctionRequest listVersionsByFunctionRequest = new ListVersionsByFunctionRequest();
        listVersionsByFunctionRequest.setFunctionName(functionArn);
        if (nextMarker != null) {
            listVersionsByFunctionRequest.setMarker(nextMarker);
        }

        ListVersionsByFunctionResult listVersionsByFunctionResult = lambda
                .listVersionsByFunction(listVersionsByFunctionRequest);
        for (FunctionConfiguration x : listVersionsByFunctionResult.getVersions()) {
            listRevionIds.put(x.getRevisionId(), x.getVersion());
        }
        nextMarker = listVersionsByFunctionResult.getNextMarker();

    } while (nextMarker != null && nextMarker.length() != 0);
    return listRevionIds;
}