簡體   English   中英

按需節點的 us-west-1 區域的 AWS Elasticache 價目表 REST api

[英]AWS Elasticache price list REST api for us-west-1 region of On-Demand nodes

我想要 JSON 或 CSV 格式的成本信息節點類型和每小時價格。 AWS 是否已將此信息作為 REST 端點提供?。

或者我是否必須抓取以下網頁才能獲取所需信息?。

https://aws.amazon.com/elasticache/pricing/

當然有一個 API(它是 AWS,幾乎總是有一個 API)。 以下是按地區獲取定價的方法。

import requests
url = "https://b0.p.awsstatic.com/pricing/2.0/meteredUnitMaps/elasticache/USD/current/elasticache.json?timestamp=1598870451424"
r = requests.get(url).json()

for region in r["regions"].values():
    for k, v in region.items():
        print(k)
        print(f"{v['Instance Type']} - {v['price']}")

這產生:

OnDemand Cache Instance Standard cache m3.2xlarge Memcached Previous Generation
cache.m3.2xlarge - 0.8550000000
OnDemand Cache Instance Standard cache m3.2xlarge Redis Previous Generation
cache.m3.2xlarge - 0.8550000000
OnDemand Cache Instance Standard cache m3.large Memcached Previous Generation
cache.m3.large - 0.2180000000
...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM