From 04dc8f5c2d8f7e296ce633ac8c838d89d7d6c563 Mon Sep 17 00:00:00 2001 From: alprosms <92699124+alprosms@users.noreply.github.com> Date: Tue, 28 Mar 2023 15:48:30 -0700 Subject: [PATCH] Adding support for RU Alerts in new Budgets API version (#23140) * Updating budgets swagger definition to include modifications from RU Alert category * Adding new examples for all scenarios of RU Alerts, added new examples for all scopes for Cost Budgets * Spelling & lintdiff fixes * prettier-fix * Added more descriptions, and some light markdown to larger descripitons * Addressing comments * prettier-fix * Updating description for amount property * addressing Shravan's offline comments * spell check * removing aws scopes from scope description * Addressing comments from internal review, removed legacy tags for EA --- .../costmanagement.budgets.json | 253 ++++++++++++++---- ...ateOrUpdate-Cost-Subscription-Budget.json} | 12 +- ...countEA-AlertRule-ReservationIdFilter.json | 125 +++++++++ ...-AlertRule-ReservedResourceTypeFilter.json | 125 +++++++++ ...tilization-BillingAccountEA-AlertRule.json | 95 +++++++ ...Profile-AlertRule-ReservationIdFilter.json | 126 +++++++++ ...-AlertRule-ReservedResourceTypeFilter.json | 126 +++++++++ ...nUtilization-BillingProfile-AlertRule.json | 96 +++++++ .../Budgets/{ => Delete}/DeleteBudget.json | 0 .../Cost/Get-Cost-Budget.json} | 4 +- .../Get-ReservationUtilization-AlertRule.json | 51 ++++ ...ountBudgetsList-EA-CategoryTypeFilter.json | 44 +++ .../List/EA/BillingAccountBudgetsList-EA.json | 105 ++++++++ .../List/EA/DepartmentBudgetsList.json | 78 ++++++ .../List/EA/EnrollmentAccountBudgetsList.json | 78 ++++++ ...untBudgetsList-MCA-CategoryTypeFilter.json | 44 +++ .../MCA/BillingAccountBudgetsList-MCA.json | 105 ++++++++ ...ProfileBudgetsList-CategoryTypeFilter.json | 83 ++++++ .../List/MCA/BillingProfileBudgetsList.json | 144 ++++++++++ .../Budgets/List/MCA/CustomerBudgetsList.json | 78 ++++++ .../List/MCA/InvoiceSectionBudgetsList.json | 79 ++++++ .../List/RBAC/ManagementGroupBudgetsList.json | 222 +++++++++++++++ .../RBAC/ResourceGroupBudgetsList.json} | 55 +--- .../List/RBAC/SubscriptionBudgetsList.json | 191 +++++++++++++ 24 files changed, 2220 insertions(+), 99 deletions(-) rename specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/{CreateOrUpdateBudget.json => CreateOrUpdate/Cost/CreateOrUpdate-Cost-Subscription-Budget.json} (96%) create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/EA/CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule-ReservationIdFilter.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/EA/CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule-ReservedResourceTypeFilter.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/EA/CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/CreateOrUpdate-ReservationUtilization-BillingProfile-AlertRule-ReservationIdFilter.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/CreateOrUpdate-ReservationUtilization-BillingProfile-AlertRule-ReservedResourceTypeFilter.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/CreateOrUpdate-ReservationUtilization-BillingProfile-AlertRule.json rename specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/{ => Delete}/DeleteBudget.json (100%) rename specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/{Budget.json => Get/Cost/Get-Cost-Budget.json} (96%) create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Get/ReservationUtilization/Get-ReservationUtilization-AlertRule.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/EA/BillingAccountBudgetsList-EA-CategoryTypeFilter.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/EA/BillingAccountBudgetsList-EA.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/EA/DepartmentBudgetsList.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/EA/EnrollmentAccountBudgetsList.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/BillingAccountBudgetsList-MCA-CategoryTypeFilter.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/BillingAccountBudgetsList-MCA.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/BillingProfileBudgetsList-CategoryTypeFilter.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/BillingProfileBudgetsList.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/CustomerBudgetsList.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/InvoiceSectionBudgetsList.json create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/RBAC/ManagementGroupBudgetsList.json rename specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/{BudgetsList.json => List/RBAC/ResourceGroupBudgetsList.json} (75%) create mode 100644 specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/RBAC/SubscriptionBudgetsList.json diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json index 0252360f047b..1a92b4efdf27 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/costmanagement.budgets.json @@ -45,8 +45,44 @@ "url": "https://docs.microsoft.com/en-us/rest/api/CostManagement/" }, "x-ms-examples": { - "BudgetsList": { - "$ref": "./examples/Budgets/BudgetsList.json" + "SubscriptionBudgetsList": { + "$ref": "./examples/Budgets/List/RBAC/SubscriptionBudgetsList.json" + }, + "ResourceGroupBudgetsList": { + "$ref": "./examples/Budgets/List/RBAC/ResourceGroupBudgetsList.json" + }, + "ManagementGroupBudgetsList": { + "$ref": "./examples/Budgets/List/RBAC/ManagementGroupBudgetsList.json" + }, + "BillingAccountBudgetsList-EA": { + "$ref": "./examples/Budgets/List/EA/BillingAccountBudgetsList-EA.json" + }, + "BillingAccountBudgetsList-EA-CategoryTypeFilter": { + "$ref": "./examples/Budgets/List/EA/BillingAccountBudgetsList-EA-CategoryTypeFilter.json" + }, + "DepartmentBudgetsList-EA": { + "$ref": "./examples/Budgets/List/EA/DepartmentBudgetsList.json" + }, + "EnrollmentAccountBudgetsList-EA": { + "$ref": "./examples/Budgets/List/EA/EnrollmentAccountBudgetsList.json" + }, + "BillingAccountBudgetsList-MCA": { + "$ref": "./examples/Budgets/List/MCA/BillingAccountBudgetsList-MCA.json" + }, + "BillingAccountBudgetsList-MCA-CategoryTypeFilter": { + "$ref": "./examples/Budgets/List/MCA/BillingAccountBudgetsList-MCA-CategoryTypeFilter.json" + }, + "BillingProfileBudgetsList-MCA": { + "$ref": "./examples/Budgets/List/MCA/BillingProfileBudgetsList.json" + }, + "BillingProfileBudgetsList-MCA-CategoryTypeFilter": { + "$ref": "./examples/Budgets/List/MCA/BillingProfileBudgetsList-CategoryTypeFilter.json" + }, + "InvoiceSectionBudgetsList-MCA": { + "$ref": "./examples/Budgets/List/MCA/InvoiceSectionBudgetsList.json" + }, + "CustomerBudgetsList-MCA-CSP": { + "$ref": "./examples/Budgets/List/MCA/CustomerBudgetsList.json" } }, "parameters": [ @@ -55,6 +91,9 @@ }, { "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/budgetCategoryFilterParameter" } ], "responses": { @@ -87,8 +126,11 @@ "url": "https://docs.microsoft.com/en-us/rest/api/CostManagement/" }, "x-ms-examples": { - "Budget": { - "$ref": "./examples/Budgets/Budget.json" + "Get-Cost-Budget": { + "$ref": "./examples/Budgets/Get/Cost/Get-Cost-Budget.json" + }, + "Get-ReservationUtilization-AlertRule": { + "$ref": "./examples/Budgets/Get/ReservationUtilization/Get-ReservationUtilization-AlertRule.json" } }, "parameters": [ @@ -127,8 +169,26 @@ "url": "https://docs.microsoft.com/en-us/rest/api/CostManagement/" }, "x-ms-examples": { - "CreateOrUpdateBudget": { - "$ref": "./examples/Budgets/CreateOrUpdateBudget.json" + "CreateOrUpdate-Cost-Subscription-Budget": { + "$ref": "./examples/Budgets/CreateOrUpdate/Cost/CreateOrUpdate-Cost-Subscription-Budget.json" + }, + "CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule": { + "$ref": "./examples/Budgets/CreateOrUpdate/ReservationUtilization/EA/CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule.json" + }, + "CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule-ReservedResourceTypeFilter": { + "$ref": "./examples/Budgets/CreateOrUpdate/ReservationUtilization/EA/CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule-ReservedResourceTypeFilter.json" + }, + "CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule-ReservationIdFilter": { + "$ref": "./examples/Budgets/CreateOrUpdate/ReservationUtilization/EA/CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule-ReservationIdFilter.json" + }, + "CreateOrUpdate-ReservationUtilization-BillingProfileMCA-AlertRule.json": { + "$ref": "./examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/CreateOrUpdate-ReservationUtilization-BillingProfile-AlertRule.json" + }, + "CreateOrUpdate-ReservationUtilization-BillingProfileMCA-AlertRule-ReservedResourceTypeFilter": { + "$ref": "./examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/CreateOrUpdate-ReservationUtilization-BillingProfile-AlertRule-ReservedResourceTypeFilter.json" + }, + "CreateOrUpdate-ReservationUtilization-BillingProfile-AlertRule-ReservationIdFilter": { + "$ref": "./examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/CreateOrUpdate-ReservationUtilization-BillingProfile-AlertRule-ReservationIdFilter.json" } }, "parameters": [ @@ -183,7 +243,7 @@ }, "x-ms-examples": { "DeleteBudget": { - "$ref": "./examples/Budgets/DeleteBudget.json" + "$ref": "./examples/Budgets/Delete/DeleteBudget.json" } }, "parameters": [ @@ -252,22 +312,34 @@ "type": "object", "properties": { "category": { - "description": "The category of the budget.", + "description": "The category of the budget.\n- 'Cost' defines a Budget.\n- 'ReservationUtilization' defines a Reservation Utilization Alert Rule.", "type": "string", "enum": [ - "Cost" + "Cost", + "ReservationUtilization" ], "x-ms-enum": { "name": "CategoryType", - "modelAsString": true + "modelAsString": true, + "values": [ + { + "value": "Cost", + "description": "A Budget that evaluates monetary cost of Azure resources against an amount, and alerts based on a configured notification threshold.", + "name": "Cost" + }, + { + "value": "ReservationUtilization", + "description": "An Alert Rule that evaluates the utilization percentage of Azure Reservations, and alerts based on a configured notification threshold." + } + ] } }, "amount": { - "description": "The total amount of cost to track with the budget", + "description": "The total amount of cost to track with the budget.\n\n Supported for CategoryType(s): Cost.\n\n Required for CategoryType(s): Cost.", "type": "number" }, "timeGrain": { - "description": "The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers", + "description": "The time covered by a budget. Tracking of the amount will be reset based on the time grain.\n\nSupported for CategoryType(s): Cost, ReservationUtilization.\n\n Supported timeGrainTypes for **CategoryType: Cost**\n\n- Monthly\n- Quarterly\n- Annually\n- BillingMonth*\n- BillingQuarter*\n- BillingAnnual*\n\n *only supported for Web Direct customers.\n\n Supported timeGrainTypes for **CategoryType: ReservationUtilization**\n- Last7Days\n- Last30Days\n\n Required for CategoryType(s): Cost, ReservationUtilization.", "type": "string", "enum": [ "Monthly", @@ -275,59 +347,103 @@ "Annually", "BillingMonth", "BillingQuarter", - "BillingAnnual" + "BillingAnnual", + "Last7Days", + "Last30Days" ], "x-ms-enum": { "name": "TimeGrainType", - "modelAsString": true + "modelAsString": true, + "values": [ + { + "value": "Monthly", + "description": "The budget will track costs in the current calendar month against the amount.\n\n Supported for CategoryType: Cost only.", + "name": "Monthly" + }, + { + "value": "Quarterly", + "description": "The budget will track costs in the current calendar quarter against the amount.\n\n Supported for CategoryType: Cost only.", + "name": "Quarterly" + }, + { + "value": "Annually", + "description": "The budget will track costs in the current calendar year against the amount.\n\n Supported for CategoryType: Cost only.", + "name": "Annually" + }, + { + "value": "BillingMonth", + "description": "The budget will track costs in the current billing month against the amount.\n\n Supported for CategoryType: Cost and Web Direct customers only.", + "name": "BillingMonth" + }, + { + "value": "BillingQuarter", + "description": "The budget will track costs in the current billing quarter against the amount.\n\n Supported for CategoryType: Cost and Web Direct customers only.", + "name": "BillingQuarter" + }, + { + "value": "BillingAnnual", + "description": "The budget will track costs in the current billing year against the amount.\n\n Supported for CategoryType: Cost and Web Direct customers only.", + "name": "BillingAnnual" + }, + { + "value": "Last7Days", + "description": "The Reservation Utilization Alert Rule will evaluate reservations based on their 7-Day utilization percentage.\n\n Supported for CategoryType: ReservationUtilization only.", + "name": "Last7Days" + }, + { + "value": "Last30Days", + "description": "The Reservation Utilization Alert Rule will evaluate reservations based on their 30-Day utilization percentage.\n\n Supported for CategoryType: ReservationUtilization only.", + "name": "Last30Days" + } + ] } }, "timePeriod": { - "description": "Has start and end date of the budget. The start date must be first of the month and should be less than the end date. Budget start date must be on or after June 1, 2017. Future start date should not be more than twelve months. Past start date should be selected within the timegrain period. There are no restrictions on the end date.", + "description": "The time period that defines the active period of the budget. The budget will evaluate data on or after the startDate and will expire on the endDate.\n\n Supported for CategoryType(s): Cost, ReservationUtilization.\n\n Required for CategoryType(s): Cost, ReservationUtilization.", + "type": "object", "$ref": "#/definitions/BudgetTimePeriod" }, "filter": { - "description": "May be used to filter budgets by user-specified dimensions and/or tags.", + "description": "May be used to filter budgets by user-specified dimensions and/or tags.\n\n Supported for CategoryType(s): Cost, ReservationUtilization.", "type": "object", "$ref": "#/definitions/BudgetFilter" }, "currentSpend": { - "description": "The current amount of cost which is being tracked for a budget.", + "description": "The current amount of cost which is being tracked for a budget.\n\n Supported for CategoryType(s): Cost.", "$ref": "#/definitions/CurrentSpend", "readOnly": true }, "notifications": { "type": "object", - "description": "Dictionary of notifications associated with the budget. Budget can have up to five notifications.", + "description": "Dictionary of notifications associated with the budget.\n\n Supported for CategoryType(s): Cost, ReservationUtilization.\n\n- Constraints for **CategoryType: Cost** - Budget can have up to 5 notifications with thresholdType: Actual and 5 notifications with thresholdType: Forecasted.\n- Constraints for **CategoryType: ReservationUtilization** - Only one notification allowed. thresholdType is not applicable.", "additionalProperties": { "$ref": "#/definitions/Notification" }, "maxItems": 5 }, "forecastSpend": { - "description": "The forecasted cost which is being tracked for a budget.", + "description": "The forecasted cost which is being tracked for a budget.\n\n Supported for CategoryType(s): Cost.", "$ref": "#/definitions/ForecastSpend", "readOnly": true } }, "required": [ "category", - "amount", "timeGrain", "timePeriod" ] }, "BudgetTimePeriod": { - "description": "The start and end date for a budget.", + "description": "The time period that defines the active period of the budget. The budget will evaluate data on or after the startDate and will expire on the endDate.\n\n Supported for CategoryType(s): Cost, ReservationUtilization.\n\n Required for CategoryType(s): Cost, ReservationUtilization.", "type": "object", "properties": { "startDate": { - "description": "The start date for the budget.", + "description": "The start date for the budget.\n\n- Constraints for **CategoryType: Cost** - Must be first of the month and should be less than the end date. Budget start date must be on or after June 1, 2017. Future start date should not be more than twelve months. Past start date should be selected within the timegrain period.\n\n- Constraints for **CategoryType: ReservationUtilization** - Must be on or after the current date and less than the end date.", "type": "string", "format": "date-time" }, "endDate": { - "description": "The end date for the budget. If not provided, we default this to 10 years from the start date.", + "description": "The end date for the budget.\n\n- Constraints for **CategoryType: Cost** - No constraints. If not provided, we default this to 10 years from the start date.\n\n- Constraints for **CategoryType: ReservationUtilization** - End date cannot be more than 3 years after the start date.", "type": "string", "format": "date-time" } @@ -337,11 +453,11 @@ ] }, "BudgetFilter": { - "description": "May be used to filter budgets by resource group, resource, or meter.", + "description": "May be used to filter budgets by user-specified dimensions and/or tags.\n\n Supported for CategoryType(s): Cost, ReservationUtilization.", "type": "object", "properties": { "and": { - "description": "The logical \"AND\" expression. Must have at least 2 items.", + "description": "The logical \"AND\" expression. Must have at least 2 items.\n\n Supported for CategoryType(s): Cost.", "type": "array", "items": { "$ref": "#/definitions/BudgetFilterProperties" @@ -350,25 +466,25 @@ "minItems": 0 }, "dimensions": { - "description": "Has comparison expression for a dimension", + "description": "Has comparison expression for a dimension.\n\n Supported for CategoryType(s): Cost, ReservationUtilization.\n\nSupported dimension names for **CategoryType: ReservationUtilization** \n- ReservationId\n- ReservedResourceType", "$ref": "#/definitions/BudgetComparisonExpression" }, "tags": { - "description": "Has comparison expression for a tag", + "description": "Has comparison expression for a tag.\n\n Supported for CategoryType(s): Cost.", "$ref": "#/definitions/BudgetComparisonExpression" } } }, "BudgetFilterProperties": { - "description": "The Dimensions or Tags to filter a budget by.", + "description": "The Dimensions or Tags to filter a budget by.\n\n Supported for CategoryType(s): Cost, ReservationUtilization.", "type": "object", "properties": { "dimensions": { - "description": "Has comparison expression for a dimension", + "description": "Has comparison expression for a dimension.\n\n Supported for CategoryType(s): Cost, ReservationUtilization.\n\nSupported dimension names for **CategoryType: ReservationUtilization** \n- ReservationId\n- ReservedResourceType", "$ref": "#/definitions/BudgetComparisonExpression" }, "tags": { - "description": "Has comparison expression for a tag", + "description": "Has comparison expression for a tag.\n\n Supported for CategoryType(s): Cost.", "$ref": "#/definitions/BudgetComparisonExpression" } } @@ -408,7 +524,7 @@ ] }, "CurrentSpend": { - "description": "The current amount of cost which is being tracked for a budget.", + "description": "The current amount of cost which is being tracked for a budget.\n\n Supported for CategoryType(s): Cost.", "type": "object", "properties": { "amount": { @@ -424,7 +540,7 @@ } }, "ForecastSpend": { - "description": "The forecasted cost which is being tracked for a budget.", + "description": "The forecasted cost which is being tracked for a budget.\n\n Supported for CategoryType(s): Cost.", "type": "object", "properties": { "amount": { @@ -440,20 +556,21 @@ } }, "Notification": { - "description": "The notification associated with a budget.", + "description": "The notification associated with a budget.\n\n Supported for CategoryType(s): Cost, ReservationUtilization.", "type": "object", "properties": { "enabled": { - "description": "The notification is enabled or not.", + "description": "The notification is enabled or not.\n\n Supported for CategoryType(s): Cost, ReservationUtilization.", "type": "boolean" }, "operator": { - "description": "The comparison operator.", + "description": "The comparison operator.\n\n Supported for CategoryType(s): Cost, ReservationUtilization.\n\n Supported operators for **CategoryType: Cost**\n- GreaterThan\n- GreaterThanOrEqualTo\n\n Supported operators for **CategoryType: ReservationUtilization**\n- LessThan", "type": "string", "enum": [ "EqualTo", "GreaterThan", - "GreaterThanOrEqualTo" + "GreaterThanOrEqualTo", + "LessThan" ], "x-ms-enum": { "name": "BudgetNotificationOperatorType", @@ -461,28 +578,63 @@ "values": [ { "value": "EqualTo", - "description": "Alert will be triggered if the evaluated cost is the same as threshold value. Note: It’s not recommended to use this OperatorType as there’s low chance of cost being exactly the same as threshold value, leading to missing of your alert. This OperatorType will be deprecated in future. ", + "description": "Notification will be triggered if the evaluated cost is the same as threshold value. Note: It’s not recommended to use this OperatorType as there’s low chance of cost being exactly the same as threshold value, leading to missing of your alert. This OperatorType will be deprecated in future.\n\n Supported for CategoryType(s): Cost.", "name": "EqualTo" }, { "value": "GreaterThan", - "description": "Alert will be triggered if the evaluated cost is greater than the threshold value. Note: This is the recommended OperatorType while configuring Budget Alert.", + "description": "Notification will be triggered if the evaluated cost is greater than the threshold value. Note: This is the recommended OperatorType while configuring Budget Alert.\n\n Supported for CategoryType(s): Cost.", "name": "GreaterThan" }, { "value": "GreaterThanOrEqualTo", - "description": "Alert will be triggered if the evaluated cost is greater than or equal to the threshold value.", + "description": "Notification will be triggered if the evaluated cost is greater than or equal to the threshold value.\n\n Supported for CategoryType(s): Cost.", "name": "GreaterThanOrEqualTo" + }, + { + "value": "LessThan", + "description": "Notification will be triggered if any Reservations in the scope of the Reservation Utilization Alert Rule have a utilization less than the threshold percentage.\n\n Supported for CategoryType(s): ReservationUtilization.", + "name": "LessThan" } ] } }, "threshold": { - "description": "Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is always percent and has to be between 0 and 1000.", + "description": "Threshold value associated with a notification. It is always percent with a maximum of 2 decimal places.\n\n Supported for CategoryType(s): Cost, ReservationUtilization.\n\n **CategoryType: Cost** - Must be between 0 and 1000. Notification is sent when the cost exceeded the threshold.\n\n **CategoryType: ReservationUtilization** - Must be between 0 and 100. Notification is sent when a reservation has a utilization percentage below the threshold.", "type": "number" }, + "frequency": { + "description": "Frequency of a notification. Represents how long the notification will be silent after triggering an alert for a threshold breach. If not specified, the frequency will be set by default based on the timeGrain (Weekly when timeGrain: Last7Days, Monthly when timeGrain: Last30Days).\n\n Supported for CategoryType(s): ReservationUtilization.", + "type": "string", + "enum": [ + "Daily", + "Weekly", + "Monthly" + ], + "x-ms-enum": { + "name": "Frequency", + "modelAsString": true, + "values": [ + { + "value": "Daily", + "description": "After the threshold breaches and an Alert is fired, no further alerts will be sent until the next calendar day.", + "name": "Daily" + }, + { + "value": "Weekly", + "description": "After the threshold breaches and an Alert is fired, no further alerts will be sent for 7 calendar days.", + "name": "Weekly" + }, + { + "value": "Monthly", + "description": "After the threshold breaches and an Alert is fired, no further alerts will be sent for 30 calendar days.", + "name": "Monthly" + } + ] + } + }, "contactEmails": { - "description": "Email addresses to send the budget notification to when the threshold is exceeded. Must have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact email specified.", + "description": "Email addresses to send the notification to when the threshold is breached. Must have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact email specified.\n\n Supported for CategoryType(s): Cost, ReservationUtilization.", "type": "array", "items": { "type": "string" @@ -491,14 +643,14 @@ "maxItems": 50 }, "contactRoles": { - "description": "Contact roles to send the budget notification to when the threshold is exceeded.", + "description": "Subscription or Resource Group scopes only. Contact roles to send the notification to when the threshold is breached.\n\n Supported for CategoryType(s): Cost.", "type": "array", "items": { "type": "string" } }, "contactGroups": { - "description": "Action groups to send the budget notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id. Only supported at Subscription or Resource Group scopes.", + "description": "Subscription or Resource Group scopes only. Action groups to send the notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id.\n\n Supported for CategoryType(s): Cost.", "type": "array", "items": { "type": "string" @@ -507,7 +659,7 @@ "maxItems": 50 }, "thresholdType": { - "description": "The type of threshold", + "description": "The type of threshold.\n\n Supported for CategoryType(s): Cost.", "type": "string", "enum": [ "Actual", @@ -519,7 +671,7 @@ "values": [ { "value": "Actual", - "description": "Actual costs budget alerts notify when the actual accrued cost exceeds the allocated budget .", + "description": "Actual costs budget alerts notify when the actual accrued cost exceeds the allocated budget.", "name": "Actual" }, { @@ -532,7 +684,7 @@ "default": "Actual" }, "locale": { - "description": "Language in which the recipient will receive the notification", + "description": "Language in which the recipient will receive the notification, \n\n Supported for CategoryType(s): Cost, ReservationUtilization.", "type": "string", "enum": [ "en-us", @@ -577,7 +729,7 @@ "in": "path", "required": true, "type": "string", - "description": "The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope.", + "description": "The scope associated with budget operations.\n\n Supported scopes for **CategoryType: Cost**\n\n Azure RBAC Scopes:\n- '/subscriptions/{subscriptionId}/' for subscription scope\n- '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope\n- '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope\n\n EA (Enterprise Agreement) Scopes:\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope\n\n MCA (Modern Customer Agreement) Scopes:\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' for customer scope (CSP only)\n\n Supported scopes for **CategoryType: ReservationUtilization**\n\n EA (Enterprise Agreement) Scopes:\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account Scope\n\nMCA (Modern Customer Agreement) Scopes:\n- '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope", "x-ms-parameter-location": "method", "x-ms-skip-url-encoding": true }, @@ -591,6 +743,13 @@ "pattern": "^[a-zA-Z0-9_-]+$", "minLength": 1, "maxLength": 63 + }, + "budgetCategoryFilterParameter": { + "name": "$filter", + "description": "OData filter option. May be used to filter budgets by properties/category. The filter supports 'eq' only.", + "in": "query", + "required": false, + "type": "string" } } } diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdateBudget.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/Cost/CreateOrUpdate-Cost-Subscription-Budget.json similarity index 96% rename from specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdateBudget.json rename to specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/Cost/CreateOrUpdate-Cost-Subscription-Budget.json index 0d5b0d929f01..26d8d4715aac 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdateBudget.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/Cost/CreateOrUpdate-Cost-Subscription-Budget.json @@ -12,8 +12,8 @@ "amount": 100.65, "timeGrain": "Monthly", "timePeriod": { - "startDate": "2017-10-01T00:00:00Z", - "endDate": "2018-10-31T00:00:00Z" + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" }, "filter": { "and": [ @@ -84,8 +84,8 @@ "amount": 100.65, "timeGrain": "Monthly", "timePeriod": { - "startDate": "2017-10-01T00:00:00Z", - "endDate": "2018-10-31T00:00:00Z" + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" }, "filter": { "and": [ @@ -159,8 +159,8 @@ "amount": 100.65, "timeGrain": "Monthly", "timePeriod": { - "startDate": "2017-10-01T00:00:00Z", - "endDate": "2018-10-31T00:00:00Z" + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" }, "filter": { "and": [ diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/EA/CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule-ReservationIdFilter.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/EA/CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule-ReservationIdFilter.json new file mode 100644 index 000000000000..c3e3e715407e --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/EA/CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule-ReservationIdFilter.json @@ -0,0 +1,125 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "billingAccountId": "123456", + "budgetName": "TestAlertRule", + "scope": "providers/Microsoft.Billing/billingAccounts/123456", + "parameters": { + "eTag": "\"1d34d016a593709\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last7Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": { + "dimensions": { + "name": "ReservationId", + "operator": "In", + "values": [ + "00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000001", + "00000000-0000-0000-0000-000000000002" + ] + } + }, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Weekly", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + }, + "responses": { + "201": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/budgets/TestAlertRule", + "name": "TestAlertRule", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last7Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": { + "dimensions": { + "name": "ReservationId", + "operator": "In", + "values": [ + "00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000001", + "00000000-0000-0000-0000-000000000002" + ] + } + }, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Weekly", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + }, + "200": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/budgets/TestAlertRule", + "name": "TestAlertRule", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last7Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": { + "dimensions": { + "name": "ReservationId", + "operator": "In", + "values": [ + "00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000001", + "00000000-0000-0000-0000-000000000002" + ] + } + }, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Weekly", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/EA/CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule-ReservedResourceTypeFilter.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/EA/CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule-ReservedResourceTypeFilter.json new file mode 100644 index 000000000000..a4a3a177b2ba --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/EA/CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule-ReservedResourceTypeFilter.json @@ -0,0 +1,125 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "billingAccountId": "123456", + "budgetName": "TestAlertRule", + "scope": "providers/Microsoft.Billing/billingAccounts/123456", + "parameters": { + "eTag": "\"1d34d016a593709\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last7Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": { + "dimensions": { + "name": "ReservedResourceType", + "operator": "In", + "values": [ + "VirtualMachines", + "SqlDatabases", + "CosmosDb" + ] + } + }, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Weekly", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + }, + "responses": { + "201": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/budgets/TestAlertRule", + "name": "TestAlertRule", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last7Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": { + "dimensions": { + "name": "ReservedResourceType", + "operator": "In", + "values": [ + "VirtualMachines", + "SqlDatabases", + "CosmosDb" + ] + } + }, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Weekly", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + }, + "200": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/budgets/TestAlertRule", + "name": "TestAlertRule", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last7Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": { + "dimensions": { + "name": "ReservedResourceType", + "operator": "In", + "values": [ + "VirtualMachines", + "SqlDatabases", + "CosmosDb" + ] + } + }, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Weekly", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/EA/CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/EA/CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule.json new file mode 100644 index 000000000000..dd414df0a5fb --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/EA/CreateOrUpdate-ReservationUtilization-BillingAccountEA-AlertRule.json @@ -0,0 +1,95 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "billingAccountId": "123456", + "budgetName": "TestAlertRule", + "scope": "providers/Microsoft.Billing/billingAccounts/123456", + "parameters": { + "eTag": "\"1d34d016a593709\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last7Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": {}, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Weekly", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + }, + "responses": { + "201": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/budgets/TestAlertRule", + "name": "TestAlertRule", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last7Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": {}, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Weekly", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + }, + "200": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/budgets/TestAlertRule", + "name": "TestAlertRule", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last7Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": {}, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Weekly", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/CreateOrUpdate-ReservationUtilization-BillingProfile-AlertRule-ReservationIdFilter.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/CreateOrUpdate-ReservationUtilization-BillingProfile-AlertRule-ReservationIdFilter.json new file mode 100644 index 000000000000..2c0c875c0eff --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/CreateOrUpdate-ReservationUtilization-BillingProfile-AlertRule-ReservationIdFilter.json @@ -0,0 +1,126 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "billingAccountId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01", + "billingProfileId": "KKKK-LLLL-MMM-NNN", + "budgetName": "TestAlertRule", + "scope": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN", + "parameters": { + "eTag": "\"1d34d016a593709\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last30Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": { + "dimensions": { + "name": "ReservationId", + "operator": "In", + "values": [ + "00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000001", + "00000000-0000-0000-0000-000000000002" + ] + } + }, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Daily", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + }, + "responses": { + "201": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN/providers/Microsoft.CostManagement/budgets/TestAlertRule", + "name": "TestAlertRule", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last30Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": { + "dimensions": { + "name": "ReservationId", + "operator": "In", + "values": [ + "00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000001", + "00000000-0000-0000-0000-000000000002" + ] + } + }, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Daily", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + }, + "200": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN/providers/Microsoft.CostManagement/budgets/TestAlertRule", + "name": "TestAlertRule", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last30Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": { + "dimensions": { + "name": "ReservationId", + "operator": "In", + "values": [ + "00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000001", + "00000000-0000-0000-0000-000000000002" + ] + } + }, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Daily", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/CreateOrUpdate-ReservationUtilization-BillingProfile-AlertRule-ReservedResourceTypeFilter.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/CreateOrUpdate-ReservationUtilization-BillingProfile-AlertRule-ReservedResourceTypeFilter.json new file mode 100644 index 000000000000..65801ce4fab3 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/CreateOrUpdate-ReservationUtilization-BillingProfile-AlertRule-ReservedResourceTypeFilter.json @@ -0,0 +1,126 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "billingAccountId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01", + "billingProfileId": "KKKK-LLLL-MMM-NNN", + "budgetName": "TestAlertRule", + "scope": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN", + "parameters": { + "eTag": "\"1d34d016a593709\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last30Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": { + "dimensions": { + "name": "ReservedResourceType", + "operator": "In", + "values": [ + "VirtualMachines", + "SqlDatabases", + "CosmosDb" + ] + } + }, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Daily", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + }, + "responses": { + "201": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN/providers/Microsoft.CostManagement/budgets/TestAlertRule", + "name": "TestAlertRule", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last30Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": { + "dimensions": { + "name": "ReservedResourceType", + "operator": "In", + "values": [ + "VirtualMachines", + "SqlDatabases", + "CosmosDb" + ] + } + }, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Daily", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + }, + "200": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN/providers/Microsoft.CostManagement/budgets/TestAlertRule", + "name": "TestAlertRule", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last30Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": { + "dimensions": { + "name": "ReservedResourceType", + "operator": "In", + "values": [ + "VirtualMachines", + "SqlDatabases", + "CosmosDb" + ] + } + }, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Daily", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/CreateOrUpdate-ReservationUtilization-BillingProfile-AlertRule.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/CreateOrUpdate-ReservationUtilization-BillingProfile-AlertRule.json new file mode 100644 index 000000000000..44c2282c77c2 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/CreateOrUpdate/ReservationUtilization/MCA/CreateOrUpdate-ReservationUtilization-BillingProfile-AlertRule.json @@ -0,0 +1,96 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "billingAccountId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01", + "billingProfileId": "KKKK-LLLL-MMM-NNN", + "budgetName": "TestAlertRule", + "scope": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN", + "parameters": { + "eTag": "\"1d34d016a593709\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last30Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": {}, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Daily", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + }, + "responses": { + "201": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN/providers/Microsoft.CostManagement/budgets/TestAlertRule", + "name": "TestAlertRule", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last30Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": {}, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Daily", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + }, + "200": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN/providers/Microsoft.CostManagement/budgets/TestAlertRule", + "name": "TestAlertRule", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last30Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": {}, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Daily", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/DeleteBudget.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Delete/DeleteBudget.json similarity index 100% rename from specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/DeleteBudget.json rename to specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Delete/DeleteBudget.json diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Budget.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Get/Cost/Get-Cost-Budget.json similarity index 96% rename from specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Budget.json rename to specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Get/Cost/Get-Cost-Budget.json index 260c1e15af05..979a7ccfbc03 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Budget.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Get/Cost/Get-Cost-Budget.json @@ -18,8 +18,8 @@ "amount": 100.65, "timeGrain": "Monthly", "timePeriod": { - "startDate": "2017-10-01T00:00:00Z", - "endDate": "2018-10-31T00:00:00Z" + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" }, "filter": { "and": [ diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Get/ReservationUtilization/Get-ReservationUtilization-AlertRule.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Get/ReservationUtilization/Get-ReservationUtilization-AlertRule.json new file mode 100644 index 000000000000..5b7c9a51cf5b --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/Get/ReservationUtilization/Get-ReservationUtilization-AlertRule.json @@ -0,0 +1,51 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "billingAccountId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01", + "billingProfileId": "KKKK-LLLL-MMM-NNN", + "budgetName": "TestAlertRule", + "scope": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN" + }, + "responses": { + "200": { + "body": { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN/providers/Microsoft.CostManagement/budgets/TestAlertRule", + "name": "TestAlertRule", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last30Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": { + "dimensions": { + "name": "ReservedResourceType", + "operator": "In", + "values": [ + "VirtualMachines", + "SqlDatabases", + "CosmosDb" + ] + } + }, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Daily", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/EA/BillingAccountBudgetsList-EA-CategoryTypeFilter.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/EA/BillingAccountBudgetsList-EA-CategoryTypeFilter.json new file mode 100644 index 000000000000..1de7e886e2f8 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/EA/BillingAccountBudgetsList-EA-CategoryTypeFilter.json @@ -0,0 +1,44 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "billingAccountId": "123456", + "scope": "providers/Microsoft.Billing/billingAccounts/123456", + "$filter": "properties/category eq 'ReservationUtilization'" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/budgets/TestRUAlert", + "name": "TestRUAlert", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last7Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": {}, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Weekly", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/EA/BillingAccountBudgetsList-EA.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/EA/BillingAccountBudgetsList-EA.json new file mode 100644 index 000000000000..e231572e6993 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/EA/BillingAccountBudgetsList-EA.json @@ -0,0 +1,105 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "billingAccountId": "123456", + "scope": "providers/Microsoft.Billing/billingAccounts/123456" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/budgets/TestBudget1", + "name": "TestBudget1", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157c\"", + "properties": { + "category": "Cost", + "amount": 10000.00, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "currentSpend": { + "amount": 8000.00, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThanOrEqualTo_80_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 80, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "thresholdType": "Actual" + } + } + } + }, + { + "id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/budgets/TestBudget2", + "name": "TestBudget2", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157d\"", + "properties": { + "category": "Cost", + "amount": 15000.00, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "currentSpend": { + "amount": 12000.00, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThanOrEqualTo_70_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 70, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "thresholdType": "Actual" + } + } + } + }, + { + "id": "providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/budgets/TestRUAlert", + "name": "TestRUAlert", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last7Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": {}, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Weekly", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/EA/DepartmentBudgetsList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/EA/DepartmentBudgetsList.json new file mode 100644 index 000000000000..58b1eb8c40d6 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/EA/DepartmentBudgetsList.json @@ -0,0 +1,78 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "billingAccountId": "123456", + "departmentId": "789101", + "scope": "providers/Microsoft.Billing/billingAccounts/123456/departments/789101" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.Billing/billingAccounts/123456/departments/789101/providers/Microsoft.CostManagement/budgets/DepartmentBudget1", + "name": "DepartmentBudget1", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157e\"", + "properties": { + "category": "Cost", + "amount": 5000.00, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "currentSpend": { + "amount": 3000.00, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThanOrEqualTo_60_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 60, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "thresholdType": "Actual" + } + } + } + }, + { + "id": "providers/Microsoft.Billing/billingAccounts/123456/departments/789101/providers/Microsoft.CostManagement/budgets/DepartmentBudget2", + "name": "DepartmentBudget2", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "Cost", + "amount": 8000.00, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "currentSpend": { + "amount": 6000.00, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThanOrEqualTo_75_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 75, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "thresholdType": "Actual" + } + } + } + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/EA/EnrollmentAccountBudgetsList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/EA/EnrollmentAccountBudgetsList.json new file mode 100644 index 000000000000..016a27c344be --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/EA/EnrollmentAccountBudgetsList.json @@ -0,0 +1,78 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "billingAccountId": "123456", + "enrollmentAccountId": "473845", + "scope": "providers/Microsoft.Billing/billingAccounts/123456/enrollmentAccounts/473845" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.Billing/billingAccounts/123456/enrollmentAccounts/473845/providers/Microsoft.CostManagement/budgets/EnrollmentAccountBudget1", + "name": "EnrollmentAccountBudget1", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157e\"", + "properties": { + "category": "Cost", + "amount": 5000.00, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "currentSpend": { + "amount": 3000.00, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThanOrEqualTo_60_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 60, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "thresholdType": "Actual" + } + } + } + }, + { + "id": "providers/Microsoft.Billing/billingAccounts/123456/enrollmentAccounts/473845/providers/Microsoft.CostManagement/budgets/EnrollmentAccountBudget2", + "name": "EnrollmentAccountBudget2", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "Cost", + "amount": 8000.00, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "currentSpend": { + "amount": 6000.00, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThanOrEqualTo_75_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 75, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "thresholdType": "Actual" + } + } + } + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/BillingAccountBudgetsList-MCA-CategoryTypeFilter.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/BillingAccountBudgetsList-MCA-CategoryTypeFilter.json new file mode 100644 index 000000000000..5ddc44431cf4 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/BillingAccountBudgetsList-MCA-CategoryTypeFilter.json @@ -0,0 +1,44 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "billingAccountId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01", + "scope": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01", + "$filter": "properties/category eq 'ReservationUtilization'" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN/providers/Microsoft.CostManagement/budgets/TestRUAlert", + "name": "TestRUAlert", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last30Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": {}, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Daily", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/BillingAccountBudgetsList-MCA.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/BillingAccountBudgetsList-MCA.json new file mode 100644 index 000000000000..ce0be6a237ac --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/BillingAccountBudgetsList-MCA.json @@ -0,0 +1,105 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "billingAccountId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01", + "scope": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/providers/Microsoft.CostManagement/budgets/TestBudget1", + "name": "TestBudget1", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157c\"", + "properties": { + "category": "Cost", + "amount": 10000.00, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "currentSpend": { + "amount": 8000.00, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThanOrEqualTo_80_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 80, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "thresholdType": "Actual" + } + } + } + }, + { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/providers/Microsoft.CostManagement/budgets/TestBudget2", + "name": "TestBudget2", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157d\"", + "properties": { + "category": "Cost", + "amount": 15000.00, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "currentSpend": { + "amount": 12000.00, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThanOrEqualTo_70_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 70, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "thresholdType": "Actual" + } + } + } + }, + { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/KKKK-LLLL-MMM-NNN/providers/Microsoft.CostManagement/budgets/TestRUAlert", + "name": "TestRUAlert", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last30Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": {}, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Daily", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/BillingProfileBudgetsList-CategoryTypeFilter.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/BillingProfileBudgetsList-CategoryTypeFilter.json new file mode 100644 index 000000000000..8e6588d87995 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/BillingProfileBudgetsList-CategoryTypeFilter.json @@ -0,0 +1,83 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "billingAccountId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01", + "billingProfileId": "MYDEVTESTBP", + "scope": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP", + "$filter": "properties/category eq 'ReservationUtilization'" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP/providers/Microsoft.CostManagement/budgets/TestRUAlert1", + "name": "TestRUAlert1", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last30Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": {}, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Daily", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + }, + { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP/providers/Microsoft.CostManagement/budgets/TestRUAlert2", + "name": "TestRUAlert2", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last7Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": { + "dimensions": { + "name": "ReservationId", + "operator": "In", + "values": [ + "00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000001", + "00000000-0000-0000-0000-000000000002" + ] + } + }, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 80, + "frequency": "Daily", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/BillingProfileBudgetsList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/BillingProfileBudgetsList.json new file mode 100644 index 000000000000..d311c3ec5a53 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/BillingProfileBudgetsList.json @@ -0,0 +1,144 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "billingAccountId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01", + "billingProfileId": "MYDEVTESTBP", + "scope": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP/providers/Microsoft.CostManagement/budgets/TestBudget1", + "name": "TestBudget1", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157c\"", + "properties": { + "category": "Cost", + "amount": 200.00, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "currentSpend": { + "amount": 30.00, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThanOrEqualTo_80_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 80, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "thresholdType": "Actual" + } + } + } + }, + { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP/providers/Microsoft.CostManagement/budgets/TestBudget2", + "name": "TestBudget2", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157d\"", + "properties": { + "category": "Cost", + "amount": 600.00, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "currentSpend": { + "amount": 20.00, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThanOrEqualTo_70_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 70, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "thresholdType": "Actual" + } + } + } + }, + { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP/providers/Microsoft.CostManagement/budgets/TestRUAlert1", + "name": "TestRUAlert1", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last30Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": {}, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 99, + "frequency": "Daily", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + }, + { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP/providers/Microsoft.CostManagement/budgets/TestRUAlert2", + "name": "TestRUAlert2", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "ReservationUtilization", + "timeGrain": "Last7Days", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2025-04-01T00:00:00Z" + }, + "filter": { + "dimensions": { + "name": "ReservationId", + "operator": "In", + "values": [ + "00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000001", + "00000000-0000-0000-0000-000000000002" + ] + } + }, + "notifications": { + "Actual_LessThan_99_Percent": { + "enabled": true, + "operator": "LessThan", + "threshold": 80, + "frequency": "Daily", + "locale": "en-us", + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ] + } + } + } + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/CustomerBudgetsList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/CustomerBudgetsList.json new file mode 100644 index 000000000000..56bf6ab2bfe5 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/CustomerBudgetsList.json @@ -0,0 +1,78 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "billingAccountId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01", + "customerId": "00000000-0000-0000-0000-000000000000", + "scope": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/customers/00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/customers/00000000-0000-0000-0000-000000000000", + "name": "TestBudget1", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157c\"", + "properties": { + "category": "Cost", + "amount": 200.00, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "currentSpend": { + "amount": 30.00, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThanOrEqualTo_80_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 80, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "thresholdType": "Actual" + } + } + } + }, + { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/customers/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/budgets/TestBudget2", + "name": "TestBudget2", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157d\"", + "properties": { + "category": "Cost", + "amount": 600.00, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "currentSpend": { + "amount": 20.00, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThanOrEqualTo_70_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 70, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "thresholdType": "Actual" + } + } + } + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/InvoiceSectionBudgetsList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/InvoiceSectionBudgetsList.json new file mode 100644 index 000000000000..73cb4e9440c7 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/MCA/InvoiceSectionBudgetsList.json @@ -0,0 +1,79 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "billingAccountId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01", + "billingProfileId": "MYDEVTESTBP", + "invoiceSectionId": "AAAA-BBBB-CCC-DDD", + "scope": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP/invoiceSections/AAAA-BBBB-CCC-DDD" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP/invoiceSections/AAAA-BBBB-CCC-DDD/providers/Microsoft.CostManagement/budgets/TestBudget1", + "name": "TestBudget1", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157c\"", + "properties": { + "category": "Cost", + "amount": 20.00, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "currentSpend": { + "amount": 5.00, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThanOrEqualTo_80_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 80, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "thresholdType": "Actual" + } + } + } + }, + { + "id": "providers/Microsoft.Billing/billingAccounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee:ffffffff-gggg-hhhh-iiii-jjjjjjjjjjjj_2023-04-01/billingProfiles/MYDEVTESTBP/invoiceSections/AAAA-BBBB-CCC-DDD/providers/Microsoft.CostManagement/budgets/TestBudget2", + "name": "TestBudget2", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157d\"", + "properties": { + "category": "Cost", + "amount": 60.00, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "currentSpend": { + "amount": 20.00, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThanOrEqualTo_70_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 70, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "thresholdType": "Actual" + } + } + } + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/RBAC/ManagementGroupBudgetsList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/RBAC/ManagementGroupBudgetsList.json new file mode 100644 index 000000000000..8582a99bb95e --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/RBAC/ManagementGroupBudgetsList.json @@ -0,0 +1,222 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "subscriptionId": "MYDEVTESTMG", + "scope": "Microsoft.Management/managementGroups/MYDEVTESTMG" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "Microsoft.Management/managementGroups/MYDEVTESTMG/Microsoft.CostManagement/budgets/TestBudget", + "name": "TestBudget", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "Cost", + "amount": 10000.00, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "filter": {}, + "currentSpend": { + "amount": 8000.89, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThanOrEqualTo_80_Percent": { + "enabled": true, + "operator": "GreaterThan", + "threshold": 80, + "contactEmails": [ + "managers@contoso.com" + ], + "thresholdType": "Actual" + } + } + } + }, + { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/budgets/TestBudget", + "name": "TestBudget", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "Cost", + "amount": 600.65, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "filter": {}, + "currentSpend": { + "amount": 120.89, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThanOrEqualTo_60_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 60, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "contactRoles": [ + "Contributor", + "Reader" + ], + "contactGroups": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup" + ], + "thresholdType": "Actual" + } + } + } + }, + { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/budgets/TestBudget", + "name": "TestBudget", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "Cost", + "amount": 100.65, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "filter": { + "and": [ + { + "dimensions": { + "name": "ResourceId", + "operator": "In", + "values": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1" + ] + } + }, + { + "tags": { + "name": "category", + "operator": "In", + "values": [ + "Dev", + "Prod" + ] + } + }, + { + "tags": { + "name": "department", + "operator": "In", + "values": [ + "engineering", + "sales" + ] + } + } + ] + }, + "currentSpend": { + "amount": 80.89, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThan_80_Percent": { + "enabled": true, + "operator": "GreaterThan", + "threshold": 80, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "contactRoles": [ + "Contributor", + "Reader" + ] + }, + "Actual_GreaterThanOrEqualTo_90_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 90, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "contactRoles": [ + "Contributor", + "Reader" + ], + "contactGroups": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup" + ], + "thresholdType": "Actual" + } + } + } + }, + { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/budgets/TestBudget1", + "name": "TestBudget1", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "Cost", + "amount": 200.65, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "filter": {}, + "currentSpend": { + "amount": 120.89, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThan_40_Percent": { + "enabled": true, + "operator": "GreaterThan", + "threshold": 40, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "contactRoles": [ + "Contributor", + "Reader" + ] + }, + "Actual_GreaterThanOrEqualTo_60_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 60, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "contactRoles": [ + "Contributor", + "Reader" + ], + "contactGroups": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup" + ], + "thresholdType": "Actual" + } + } + } + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/BudgetsList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/RBAC/ResourceGroupBudgetsList.json similarity index 75% rename from specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/BudgetsList.json rename to specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/RBAC/ResourceGroupBudgetsList.json index 238cea73e79e..01927d32361e 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/BudgetsList.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/RBAC/ResourceGroupBudgetsList.json @@ -2,7 +2,7 @@ "parameters": { "api-version": "2023-04-01-preview", "subscriptionId": "00000000-0000-0000-0000-000000000000", - "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG", "resourceGroupName": "MYDEVTESTRG" }, "responses": { @@ -10,8 +10,8 @@ "body": { "value": [ { - "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/budgets/TestBudget", - "name": "TestBudget", + "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/budgets/TestBudget0", + "name": "TestBudget0", "type": "Microsoft.CostManagement/budgets", "eTag": "\"1d34d012214157f\"", "properties": { @@ -19,8 +19,8 @@ "amount": 100.65, "timeGrain": "Monthly", "timePeriod": { - "startDate": "2017-10-01T00:00:00Z", - "endDate": "2018-10-31T00:00:00Z" + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" }, "filter": { "and": [ @@ -95,52 +95,19 @@ } }, { - "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/budgets/TestBudget", - "name": "TestBudget", + "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/budgets/TestBudget1", + "name": "TestBudget1", "type": "Microsoft.CostManagement/budgets", "eTag": "\"1d34d012214157f\"", "properties": { "category": "Cost", - "amount": 600.65, + "amount": 200.65, "timeGrain": "Monthly", "timePeriod": { - "startDate": "2017-10-01T00:00:00Z", - "endDate": "2018-10-31T00:00:00Z" - }, - "filter": { - "and": [ - { - "dimensions": { - "name": "ResourceId", - "operator": "In", - "values": [ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2", - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1" - ] - } - }, - { - "tags": { - "name": "category", - "operator": "In", - "values": [ - "Dev", - "Prod" - ] - } - }, - { - "tags": { - "name": "department", - "operator": "In", - "values": [ - "engineering", - "sales" - ] - } - } - ] + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" }, + "filter": {}, "currentSpend": { "amount": 120.89, "unit": "USD" diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/RBAC/SubscriptionBudgetsList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/RBAC/SubscriptionBudgetsList.json new file mode 100644 index 000000000000..c1923ba1006c --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2023-04-01-preview/examples/Budgets/List/RBAC/SubscriptionBudgetsList.json @@ -0,0 +1,191 @@ +{ + "parameters": { + "api-version": "2023-04-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/budgets/TestBudget", + "name": "TestBudget", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "Cost", + "amount": 600.65, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "filter": {}, + "currentSpend": { + "amount": 120.89, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThanOrEqualTo_60_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 60, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "contactRoles": [ + "Contributor", + "Reader" + ], + "contactGroups": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup" + ], + "thresholdType": "Actual" + } + } + } + }, + { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/budgets/TestBudget", + "name": "TestBudget", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "Cost", + "amount": 100.65, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "filter": { + "and": [ + { + "dimensions": { + "name": "ResourceId", + "operator": "In", + "values": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1" + ] + } + }, + { + "tags": { + "name": "category", + "operator": "In", + "values": [ + "Dev", + "Prod" + ] + } + }, + { + "tags": { + "name": "department", + "operator": "In", + "values": [ + "engineering", + "sales" + ] + } + } + ] + }, + "currentSpend": { + "amount": 80.89, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThan_80_Percent": { + "enabled": true, + "operator": "GreaterThan", + "threshold": 80, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "contactRoles": [ + "Contributor", + "Reader" + ] + }, + "Actual_GreaterThanOrEqualTo_90_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 90, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "contactRoles": [ + "Contributor", + "Reader" + ], + "contactGroups": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup" + ], + "thresholdType": "Actual" + } + } + } + }, + { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/budgets/TestBudget1", + "name": "TestBudget1", + "type": "Microsoft.CostManagement/budgets", + "eTag": "\"1d34d012214157f\"", + "properties": { + "category": "Cost", + "amount": 200.65, + "timeGrain": "Monthly", + "timePeriod": { + "startDate": "2023-04-01T00:00:00Z", + "endDate": "2024-10-31T00:00:00Z" + }, + "filter": {}, + "currentSpend": { + "amount": 120.89, + "unit": "USD" + }, + "notifications": { + "Actual_GreaterThan_40_Percent": { + "enabled": true, + "operator": "GreaterThan", + "threshold": 40, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "contactRoles": [ + "Contributor", + "Reader" + ] + }, + "Actual_GreaterThanOrEqualTo_60_Percent": { + "enabled": true, + "operator": "GreaterThanOrEqualTo", + "threshold": 60, + "contactEmails": [ + "johndoe@contoso.com", + "janesmith@contoso.com" + ], + "contactRoles": [ + "Contributor", + "Reader" + ], + "contactGroups": [ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup" + ], + "thresholdType": "Actual" + } + } + } + } + ] + } + } + } +}