Per SKU Pricing
In this exercise, you will perform the following:
- Configure instance based pricing for a SKU
- Verify cost estimates
- Use APIs to programmatically retrieve usage metrics for the SKU
This data can then be used by the cloud provider's billing platform to generate a bill for the SKU.
Important
This guide assumes that you have already setup a working SKU (i.e. compute or service profile) based on other/existing Get Started guides.
1. Configure SKU Based Pricing¶
In this step, you will configure SKU based pricing on an existing profile. Pricing will be configured within the Global Settings of the default Org.
- In your Default Org, navigate to System -> Global Settings
- Enter YAML similar to the following being sure to update the name of the profile with a working profile in your environment.
profiles:
- name: <Profile Name>
billing:
currency:
- USD
dimensions:
- instance
ratecard:
instance:
- price: 1
time_unit: h
currency: USD
- Click Save
In this example, we wish to set the following details for our SKU:
- Billing currency = USD
- By using
"instance"
for dimensions, we are specifying SKU based pricing- A rate card of $1 per hour
2. Validate Cost Estimates¶
Next you will validate the cost estimates for the SKU that will be shown to the end user on the end user self service portal (i.e. Developer Hub).
- In your Default Org, navigate to Developer Hub
- Select the project where your profile resides
- Select the Compute Type of your profile
- Click New \<ComputeType>
Within the Profile Catalog, the profile card will be displayed with the cost that was set previously within Global Settings.
- Click Select on the profile card
You will now see the estimated monthly cost of the instance.
- Enter a name for the instance
- Click Deploy
3. Retrieve Usage Metrics¶
Info
It can take up to 1 hour for usage metrics to be aggregated and available on the Rafay Controller.
Next you will programmatically retrieve the usage metrics for the SKU.
- In your Default Org, navigate to Documentation -> API Docs -> V3 APIs
- Click Authorize
- Enter the API key. The API Key can be obtained My Tools -> Manage Keys
- Click Authorize
- Click Close
- Locate the APIs under Billing Paas Profile Usage API For Partner
- Expand GET /apis/billing.envmgmt.io/v1/metrics/partner/profile/kind/{kind}/usage
- Click Try it out
- Enter the following parameters
Name | Value |
---|---|
kind | Kind of profile (compute, service) |
profile_name | The name of the SKU profile to filter on |
range_from | The date range FROM in the format 2025-07-29T00:00:00.157Z |
range_to | The date range To in the format 2025-07-29T00:00:00.157Z |
- Click Execute
Next Exercise¶
In the next part of the exercise, you will create a SKU with different pricing for the dimensions.