aws

http://status.aws.amazon.com/ https://www.expeditedssl.com/aws-in-plain-english
kenny 2021-01-21T16:17:08.003500Z

(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

2021-01-24T13:17:01.009300Z

I’m updating the issue so please check there for more info https://github.com/cognitect-labs/aws-api/issues/168

kenny 2021-01-24T15:20:49.009800Z

Great, thanks

kenny 2021-01-21T16:21:50.003600Z

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"}

2021-01-21T16:35:49.003800Z

What does (aws-api/doc sp :DescribeSavingsPlansOfferingRates) say?

kenny 2021-01-21T16:36:52.004Z

{: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}

kenny 2021-01-21T16:37:17.004200Z

^ for the request

2021-01-21T16:37:19.004400Z

What is required?

2021-01-21T16:37:28.004600Z

(below what you posted)

kenny 2021-01-21T16:37:49.004800Z

Nothing

kenny 2021-01-21T16:38:04.005Z

kenny 2021-01-21T16:38:37.005400Z

(aws-api/invoke sp
  {:op :DescribeSavingsPlansOfferingRates})
=> {:message "Unsupported Media Type", :cognitect.anomalies/category :cognitect.anomalies/incorrect}

2021-01-21T16:38:45.005600Z

> It seems the savingsplan API is not supported You’d be getting different errors if that were true.

kenny 2021-01-21T16:39:12.005800Z

Perhaps my definition of supported is different than yours? 🙂

2021-01-21T16:41:26.006Z

We don’t “support apis” in that definition, but we’re splitting hairs.

✔️ 1
2021-01-21T16:41:48.006300Z

Would you please report this as a bug?

kenny 2021-01-21T16:41:52.006500Z

Sure

2021-01-21T16:41:55.006700Z

I can’t really investigate it right now.

2021-01-21T16:41:56.006900Z

Thanks.

kenny 2021-01-21T16:42:07.007100Z

Do you have any idea where I could look to fix this?

2021-01-21T16:44:38.007300Z

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.

2021-01-21T16:46:16.007500Z

Also, we’ve had cases where required things are not listed as such e.g. https://github.com/cognitect-labs/aws-api/issues/158

kenny 2021-01-21T16:46:45.007800Z

I was thinking that, however, my call via the aws cli succeeds.

kenny 2021-01-21T16:46:58.008Z

Maybe they implicitly include some params?

2021-01-21T16:47:38.008200Z

That’s the problem in the issue I linked

kenny 2021-01-21T16:53:51.008400Z

Thanks for the info. Will dig in. Here's the issue https://github.com/cognitect-labs/aws-api/issues/168

kenny 2021-01-21T16:56:24.008700Z

> and check to see the headers align w/ the aws docs. Aren't headers common across all services?

alexmiller 2021-01-21T17:37:35.008900Z

:rolling_on_the_floor_laughing:

kenny 2021-01-21T17:42:55.009100Z

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.