Cloud Billing Catalog API: GCP pricing in real-time
Cloud Billing Catalog API: GCP pricing in real-time
Getting ready to utilize GCP services and not sure about the pricing and the plans, this blog is for you. Before going into the depth, let’s have a basic terminology.
Understand about Cloud Billing
GCP Services:
GCP provides many services: Computing and hosting, Storage, Databases, Networking,Big data and Machine Learning. So if you use any GCP services you have to pay for each of them. It can be configured as per our requirement.
Cloud billing:
Cloud billing is applied for GCP resources. To use the GCP resources you need to create a billing account. These resources are organized hierchachially. A billing account belongs to a GCP project. It can be linked to one or more projects. Cloud billing account is controlled by Cloud Identity and Access management (Cloud IAM) roles. A cloud billing account is linked to Google payments Profile.
Note: If your project is not linked to a cloud billing account, you cannot be able to use GCP services that require billing.
Billing services:
From the above diagram, Billing account is linked to Projects 1, 2, 3, and 4, that means it pays for costs incurred by the three projects. Cloud Billing account is also linked to a Google payments profile, which gathers information like payment methods, address, and name.
There are two types of cloud billing account:
- Self service account:
It prefers the Payment instrument that can be done by credit or debit card. This is called an online payment account. - Invoiced account:
It prefers the payment instrument that can be a check or wire transfer. Here invoices are sent via mail or electronically.
Cloud Billing Catalog API
Google provides a real time pricing tool for cloud platforms that is called Cloud Billing Catalogue API where users can Predict bills, and Estimate the costs. Users can create and manage sub-accounts through the GCP API . API allows the user to connect to the GCP existing accounts and allow new users programmatically. It also stores the list of SKU (Stock Keeping Units) within a service.
SKU: It is a product code that helps to identify the price, product options, invoices and manufacturer of the merchandise. It tracks inventory in your retail store.
Using cloud billing API we get following
- Provides a list of all public services including relevant metadata about each service
- It is Human readable description of the SKU
- It provides Public pricing of the SKU
- It is Regions based, where the SKU is available for purchase
To access the billing API services, google provides several client libraries which can be installed into your application and access the services with your desired programming language. It can also be accessed by using REST API call. Use the following endpoint to access the REST API and can create, access, grant access, list all cloud services, update billing accounts.
https://cloudbilling.googleapis.com