(def sp (aws-api/client {:api :savingsplans}))
(aws-api/invoke sp
{:op :DescribeSavingsPlansOfferingRates
:request {:products ["EC2"]}})
=> {:message "Unsupported Media Type", :cognitect.anomalies/category :cognitect.anomalies/incorrect}
It seems the savingsplan API is not supported? I can get a result back via the CLI *aws* savingsplans describe-savings-plans-offerings --product-types EC2
I’m updating the issue so please check there for more info https://github.com/cognitect-labs/aws-api/issues/168
Great, thanks
com.cognitect.aws/api {:mvn/version "0.8.498"}
com.cognitect.aws/endpoints {:mvn/version "1.1.11.934"}
com.cognitect.aws/savingsplans {:mvn/version "809.2.784.0"}
What does (aws-api/doc sp :DescribeSavingsPlansOfferingRates)
say?
{:serviceCodes
[:seq-of [:one-of ["AmazonEC2" "AmazonECS" "AWSLambda"]]],
:filters
[:seq-of
{:name
[:one-of
["region"
"instanceFamily"
"instanceType"
"productDescription"
"tenancy"
"productId"]],
:values [:seq-of string]}],
:savingsPlanOfferingIds [:seq-of string],
:savingsPlanPaymentOptions
[:seq-of [:one-of ["All Upfront" "Partial Upfront" "No Upfront"]]],
:products [:seq-of [:one-of ["EC2" "Fargate" "Lambda"]]],
:usageTypes [:seq-of string],
:savingsPlanTypes [:seq-of [:one-of ["Compute" "EC2Instance"]]],
:operations [:seq-of string],
:nextToken string,
:maxResults integer}
^ for the request
What is required?
(below what you posted)
Nothing
(aws-api/invoke sp
{:op :DescribeSavingsPlansOfferingRates})
=> {:message "Unsupported Media Type", :cognitect.anomalies/category :cognitect.anomalies/incorrect}
> It seems the savingsplan API is not supported You’d be getting different errors if that were true.
Perhaps my definition of supported is different than yours? 🙂
We don’t “support apis” in that definition, but we’re splitting hairs.
Would you please report this as a bug?
Sure
I can’t really investigate it right now.
Thanks.
Do you have any idea where I could look to fix this?
I’d look at the request info from
(meta (aws-api/invoke sp
{:op :DescribeSavingsPlansOfferingRates}))
and check to see the headers align w/ the aws docs.Also, we’ve had cases where required things are not listed as such e.g. https://github.com/cognitect-labs/aws-api/issues/158
I was thinking that, however, my call via the aws cli succeeds.
Maybe they implicitly include some params?
That’s the problem in the issue I linked
Thanks for the info. Will dig in. Here's the issue https://github.com/cognitect-labs/aws-api/issues/168
> and check to see the headers align w/ the aws docs. Aren't headers common across all services?
:rolling_on_the_floor_laughing:
I know s3 is a monster. Was somewhat hoping newer aws apis would be mostly very similar. Do you know of service specific docs for the headers? The regular API references only point to the "CommonParameters" section.