Search in sources :

Example 1 with ListFunctionsResult

use of com.amazonaws.services.lambda.model.ListFunctionsResult in project aws-doc-sdk-examples by awsdocs.

the class ListFunctions method main.

public static void main(String[] args) {
    // snippet-start:[lambda.java1.list.main]
    ListFunctionsResult functionResult = null;
    try {
        AWSLambda awsLambda = AWSLambdaClientBuilder.standard().withCredentials(new ProfileCredentialsProvider()).withRegion(Regions.US_WEST_2).build();
        functionResult = awsLambda.listFunctions();
        List<FunctionConfiguration> list = functionResult.getFunctions();
        for (Iterator iter = list.iterator(); iter.hasNext(); ) {
            FunctionConfiguration config = (FunctionConfiguration) iter.next();
            System.out.println("The function name is " + config.getFunctionName());
        }
    } catch (ServiceException e) {
        System.out.println(e);
    }
// snippet-end:[lambda.java1.list.main]
}
Also used : ListFunctionsResult(com.amazonaws.services.lambda.model.ListFunctionsResult) AWSLambda(com.amazonaws.services.lambda.AWSLambda) ServiceException(com.amazonaws.services.lambda.model.ServiceException) FunctionConfiguration(com.amazonaws.services.lambda.model.FunctionConfiguration) Iterator(java.util.Iterator) ProfileCredentialsProvider(com.amazonaws.auth.profile.ProfileCredentialsProvider)

Aggregations

ProfileCredentialsProvider (com.amazonaws.auth.profile.ProfileCredentialsProvider)1 AWSLambda (com.amazonaws.services.lambda.AWSLambda)1 FunctionConfiguration (com.amazonaws.services.lambda.model.FunctionConfiguration)1 ListFunctionsResult (com.amazonaws.services.lambda.model.ListFunctionsResult)1 ServiceException (com.amazonaws.services.lambda.model.ServiceException)1 Iterator (java.util.Iterator)1