From 4a88ce008161f29499bcf5f6a291ca1e2a9d5ba6 Mon Sep 17 00:00:00 2001 From: ParthaI Date: Wed, 29 Nov 2023 19:51:02 +0530 Subject: [PATCH] Added the doc for the table --- .../azure_reservation_recommendation.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 docs/tables/azure_reservation_recommendation.md diff --git a/docs/tables/azure_reservation_recommendation.md b/docs/tables/azure_reservation_recommendation.md new file mode 100644 index 00000000..8966405d --- /dev/null +++ b/docs/tables/azure_reservation_recommendation.md @@ -0,0 +1,108 @@ +# Table: azure_reservation_recommendation + +Azure Reservations help you save money by committing to one-year or three-year plans for multiple products. Committing allows you to get a discount on the resources you use. Reservations can significantly reduce your resource costs by up to 72% from pay-as-you-go prices. Reservations provide a billing discount and don't affect the runtime state of your resources. After you purchase a reservation, the discount automatically applies to matching resources. + +**Note:** We can filter out the recommendations by using the columns `look_back_period`, `resource_type` or `scope` values in the query parameter. By default the table returns the data of resource type `VirtualMachines` with the scope `Single` for the last seven days of usage to look back for recommendation. + +## Examples + +### Basic info + +```sql +select + name, + id, + region, + scope, + etag, + type +from + azure_reservation_recommendation; +``` + +### Get reservation recommendation details for the last 30 days + +```sql +select + name, + tags, + sku, + look_back_period +from + azure_reservation_recommendation +where + look_back_period = 'Last30Days'; +``` + +### List reservation recommendation of the resource type MySQL + +```sql +select + name, + tags, + sku, + look_back_period, + resource_type +from + azure_reservation_recommendation +where + resource_type = 'MySQL'; +``` + +### Get legacy resrvation recommendation properties + +```sql +select + name, + id, + legacy_recommendation_properties ->> 'LookBackPeriod' as look_back_period, + legacy_recommendation_properties ->> 'InstanceFlexibilityRatio' as instance_flexibility_ratio, + legacy_recommendation_properties ->> 'InstanceFlexibilityGroup' as instance_flexibility_group, + legacy_recommendation_properties ->> 'NormalizedSize' as normalized_size, + legacy_recommendation_properties ->> 'RecommendedQuantityNormalized' as recommended_quantity_normalized, + legacy_recommendation_properties -> 'MeterID' as meter_id, + legacy_recommendation_properties ->> 'ResourceType' as resource_type, + legacy_recommendation_properties ->> 'Term' as term, + legacy_recommendation_properties -> 'CostWithNoReservedInstances' as cost_with_no_reserved_instances, + legacy_recommendation_properties -> 'RecommendedQuantity' as recommended_quantity, + legacy_recommendation_properties -> 'TotalCostWithReservedInstances' as total_cost_with_reserved_instances, + legacy_recommendation_properties -> 'NetSavings' as net_savings, + legacy_recommendation_properties ->> 'FirstUsageDate' as first_usage_date, + legacy_recommendation_properties ->> 'Scope' as scope, + legacy_recommendation_properties -> 'SkuProperties' as sku_properties +from + azure_reservation_recommendation +where + kind = 'legacy'; +``` + +### Get modern resrvation recommendation properties + +```sql +select + name, + id, + modern_recommendation_properties ->> 'Location' as location, + modern_recommendation_properties ->> 'LookBackPeriod' as look_back_period, + modern_recommendation_properties ->> 'InstanceFlexibilityRatio' as instance_flexibility_ratio, + modern_recommendation_properties ->> 'InstanceFlexibilityGroup' as instance_flexibility_group, + modern_recommendation_properties ->> 'NormalizedSize' as normalized_size, + modern_recommendation_properties ->> 'RecommendedQuantityNormalized' as recommended_quantity_normalized, + modern_recommendation_properties -> 'MeterID' as meter_id, + modern_recommendation_properties ->> 'ResourceType' as resource_type, + modern_recommendation_properties ->> 'Term' as term, + modern_recommendation_properties -> 'CostWithNoReservedInstances' as cost_with_no_reserved_instances, + modern_recommendation_properties -> 'RecommendedQuantity' as recommended_quantity, + modern_recommendation_properties -> 'TotalCostWithReservedInstances' as total_cost_with_reserved_instances, + modern_recommendation_properties -> 'NetSavings' as net_savings, + modern_recommendation_properties ->> 'FirstUsageDate' as first_usage_date, + modern_recommendation_properties ->> 'Scope' as scope, + modern_recommendation_properties -> 'SkuProperties' as sku_properties, + modern_recommendation_properties ->> 'SubscriptionID' as subscription_id, + modern_recommendation_properties ->> 'ResourceType' as resource_type, + modern_recommendation_properties ->> 'SkuName' as sku_name, +from + azure_reservation_recommendation +where + kind = 'modern'; +``` \ No newline at end of file