Cloud Info API
Blog: Smile - Le blog des consultants
Cloud Info API
The Cloud Info API, available over our Github, includes public cloud services prices from three cloud providers: AWS, Azure and GCP. It also provides specification such as the amount of CPU, RAM and other resources. The prices table is automatically updated via a scheduled job every month.
Concepts
The API has two main types: Products and Prices.
The main properties of Products are:
Products
Prices
Installation
The API supports a deployment using Helm Chart to deploy into a Kubernetes cluster. Before going further, some of these requirements below need to be fulfilled:
- Kubernetes Cluster 1.12+
- Helm
- PV provisioner support in the underlying infrastructure
Once you get all the prerequisites, we can deploy it using the below command :
helm install cloud-pricing ./cloud-pricing
The deployment will take a few moments, we make sure the API is up and running by checking the status of pods changed to RUNNING.
Now the API should be accessible at:
localhost:5042
Use
To search for a VM price, the API endpoint query is put in place. There are 2 parameters expected by API: filter and query.
filter
The parameter filter allows us to find exactly the instance that we need based on the instance attributes. Let say we want to find the instance r5d.16xlarge of AWS EC2 service, the filter syntax would be the following:
{ “vendorName”: “aws”, “productFamily”: “Compute Instance”, “attributeFilters”: [{“key”: “instanceType”, “value”: “r5d.16xlarge”}, {“key”: “tenancy ”, “value”: “Shared”}, {“key”: “operatingSystem”, “value”: “Linux”}]}
purchase_option
This parameter separates the type of an instance commitment, a VM instance can be proposed as:
- On demand
- Reserved
- Spot
And we will get something like this as a result:
[{
“price”: 0.012,
CPU: 64
},]
Cloud Info API was originally published in Smile Innovation on Medium, where people are continuing the conversation by highlighting and responding to this story.
Leave a Comment
You must be logged in to post a comment.