Cloud Info API

Phuc Vu
Smile Innovation
Published in
2 min readAug 8, 2022

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”}]}

Example for a request made through the Cloud Info API.

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
},]

--

--