简体   繁体   中英

Can't fix `NotFoundException` error when calling SendApiAsset in AWS CLI

Recently, I have been trying to access a data products from the AWS marketplace using the AWS CLI. I have an active subscription on the product; however, I get the NotFoundException error whenever I try to access any of the product's endpoints via an API call.

Similar to the AWS workshop training in Task 2 ie Make API call with AWS CLI, I attempted to make calls to SimilarWeb endpoints using the code below:

aws dataexchange send-api-asset \
--data-set-id **************************** \
--revision-id **************************** \
--asset-id ******************************* \
--method GET \
--path '' \
--query-string-parameters 'param1=value1,param2=value2' \
--output json | jq -r '.Body' | jq '.params.querystring'

but resulted in the following error:

An error occurred (NotFoundException) when calling the SendApiAsset operation: No method found matching route / for http method GET

How can I fix this error or correctly make API call to the SimilarWeb's endpoint from AWS CLI or using boto3? Please post your suggestions. Thanks.

Each API on AWS Data Exchange will have different signatures, which will inform what paths are supported and how to format any additional parameters. The NotFoundException typically occurs when the path does not exist within the provider's API. In this case, SimilarWeb, the provider, has a series of endpoints and they are generally described on their website , but none conform to the root path as specified in the example CLI invocation you provided. Depending on which endpoint you'd like to call, the values for path and query-string-parameters will need to change.

For example, for thewebsite description endpoint , the path would be something like /v1/website/bbc.com/general-data/description and the query-string-parameters would be something like domain=bbc.com . A call using the CLI would then look something like this:

aws dataexchange send-api-asset \
--data-set-id <dataset_id> \
--revision-id <revision_id> \
--asset-id <asset_id> \
--region us-east-1 \
--method GET \
--path '/v1/website/bbc.com/general-data/description' \
--query-string-parameters 'domain=bbc.com'

The API data product should contain an OpenAPI specification that helps illustrate supported paths and what parameters are associated with each.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM