I want list list APIs available on my AWS API Gateway instance using REST API. I tried:
I am using the same auth credentials for both calls.
Both respond with 200 OK.
aws apigateway get-rest-apis returns proper dataAny idea why v2 REST API returns empty response?
v1 api gateways and v2 api gateways are distinct resources in AWS. In v1 there are only REST API Gateways and in v2 there are two types: HTTP and WebSocket gateways. They can coexist but they are incompatible with each-other and have very different feature sets.
For an overview of the differences, see the comparison between the types of API gateway here: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html
But to more specifically answer your question, the response from https://apigateway.eu-central-1.amazonaws.com/v2/apis is empty because you do not have any v2 "HTTP" apis and "REST" apis do not exist in v2.
The reason you see them in the v2 cli is because the v2 cli tools support both through separate sub-commands. It's not the version of the cli that matters so much as which sub-command you use:
apigatewayv2apigateway.So using the v2 AWS-CLI with the apigateway sub-command is still accessing v1 apigateway resources.
You need to use aws apigatewayv2 get-apis for the equivalent functionality when working with the "HTTP" API gateway resources.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With