Search in sources :

Example 1 with DescribeFunctionRequest

use of software.amazon.awssdk.services.cloudfront.model.DescribeFunctionRequest in project aws-doc-sdk-examples by awsdocs.

the class DescribeFunction method describeSinFunction.

// snippet-start:[cloudfront.java2.des_function.main]
public static String describeSinFunction(CloudFrontClient cloudFrontClient, String functionName) {
    try {
        DescribeFunctionRequest functionRequest = DescribeFunctionRequest.builder().name(functionName).stage(FunctionStage.DEVELOPMENT).build();
        DescribeFunctionResponse functionResponse = cloudFrontClient.describeFunction(functionRequest);
        return functionResponse.eTag();
    } catch (CloudFrontException e) {
        System.err.println(e.awsErrorDetails().errorMessage());
        System.exit(1);
    }
    return "";
}
Also used : DescribeFunctionResponse(software.amazon.awssdk.services.cloudfront.model.DescribeFunctionResponse) CloudFrontException(software.amazon.awssdk.services.cloudfront.model.CloudFrontException) DescribeFunctionRequest(software.amazon.awssdk.services.cloudfront.model.DescribeFunctionRequest)

Aggregations

CloudFrontException (software.amazon.awssdk.services.cloudfront.model.CloudFrontException)1 DescribeFunctionRequest (software.amazon.awssdk.services.cloudfront.model.DescribeFunctionRequest)1 DescribeFunctionResponse (software.amazon.awssdk.services.cloudfront.model.DescribeFunctionResponse)1