Last active
March 8, 2018 13:31
-
-
Save brachi-wernick/2a548cba536cac5ad255dc038a1d07cc to your computer and use it in GitHub Desktop.
findAwsRestApiByName
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//prepare getway object | |
AmazonApiGateway gateway = AmazonApiGatewayClientBuilder.standard() | |
.withCredentials(new AWSStaticCredentialsProvider(awsCreds)).withRegion(region).build(); | |
//find all rest apis | |
GetRestApisResult restApis = gateway.getRestApis(new GetRestApisRequest()); | |
//find our predefined api by name | |
RestApi targetRestApi = restApis.getItems().stream() | |
.filter(item -> item.getName().equals(targetRestApiName)).findFirst() | |
.orElseThrow(RuntimeException::new); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment