diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/costmanagement.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/costmanagement.json index 2cada3c5bc95..d3dfade9ca11 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/costmanagement.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/costmanagement.json @@ -1860,13 +1860,486 @@ } } }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/alerts": { + "get": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_ListByEnrollment", + "description": "List all alerts for an enrollment.", + "x-ms-examples": { + "Alert_List": { + "$ref": "./examples/AlertList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountIdParameter" + }, + { + "name": "$filter", + "description": "May be used to filter alerts by properties/definition/type, properties/definition/category, properties/definition/criteria, properties/costEntityId, properties/creationTime, properties/closeTime, properties/status, properties/source. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$skiptoken", + "description": "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$top", + "description": "May be used to limit the number of results to the most recent N alerts.", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/AlertListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.CostManagement/alerts": { + "get": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_ListByDepartment", + "description": "List all alerts for a department.", + "x-ms-examples": { + "Alert_List": { + "$ref": "./examples/AlertList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountIdParameter" + }, + { + "$ref": "#/parameters/departmentIdParameter" + }, + { + "name": "$filter", + "description": "May be used to filter alerts by properties/definition/type, properties/definition/category, properties/definition/criteria, properties/costEntityId, properties/creationTime, properties/closeTime, properties/status, properties/source. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$skiptoken", + "description": "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$top", + "description": "May be used to limit the number of results to the most recent N alerts.", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/AlertListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.CostManagement/alerts": { + "get": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_ListByAccount", + "description": "List all alerts for an account.", + "x-ms-examples": { + "Alert_List": { + "$ref": "./examples/AlertList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountIdParameter" + }, + { + "$ref": "#/parameters/enrollmentAccountIdParameter" + }, + { + "name": "$filter", + "description": "May be used to filter alerts by properties/definition/type, properties/definition/category, properties/definition/criteria, properties/costEntityId, properties/creationTime, properties/closeTime, properties/status, properties/source. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$skiptoken", + "description": "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$top", + "description": "May be used to limit the number of results to the most recent N alerts.", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/AlertListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/alerts": { + "get": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_ListByManagementGroups", + "description": "List all alerts for Management Groups.", + "x-ms-examples": { + "Alert_List": { + "$ref": "./examples/AlertList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/managementGroupIdParameter" + }, + { + "name": "$filter", + "description": "May be used to filter alerts by properties/definition/type, properties/definition/category, properties/definition/criteria, properties/costEntityId, properties/creationTime, properties/closeTime, properties/status, properties/source. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$skiptoken", + "description": "Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$top", + "description": "May be used to limit the number of results to the most recent N alerts.", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/AlertListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, "/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/alerts/{alertId}": { "get": { "tags": [ "Alerts" ], - "operationId": "Alerts_GetBySubscription", - "description": "Gets the alert for a subscription by alert ID.", + "operationId": "Alerts_GetBySubscription", + "description": "Gets the alert for a subscription by alert ID.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "Alert": { + "$ref": "./examples/Alert.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/alertIdParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Alert" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/alerts/{alertId}": { + "get": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_GetByResourceGroupName", + "description": "Gets the alert for a resource group under a subscription by alert ID.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "Alert": { + "$ref": "./examples/Alert.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/alertIdParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Alert" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/alerts/{alertId}": { + "get": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_GetByEnrollment", + "description": "Gets the alert for an enrollment by alert ID.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "Alert": { + "$ref": "./examples/Alert.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountIdParameter" + }, + { + "$ref": "#/parameters/alertIdParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Alert" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.CostManagement/alerts/{alertId}": { + "get": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_GetByDepartment", + "description": "Gets the alert for a department by alert ID.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "Alert": { + "$ref": "./examples/Alert.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountIdParameter" + }, + { + "$ref": "#/parameters/departmentIdParameter" + }, + { + "$ref": "#/parameters/alertIdParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Alert" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.CostManagement/alerts/{alertId}": { + "get": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_GetByAccount", + "description": "Gets the alert for an account by alert ID.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "Alert": { + "$ref": "./examples/Alert.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountIdParameter" + }, + { + "$ref": "#/parameters/enrollmentAccountIdParameter" + }, + { + "$ref": "#/parameters/alertIdParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Alert" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/alerts/{alertId}": { + "get": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_GetAlertByManagementGroups", + "description": "Gets an alert for Management Groups by alert ID.", "externalDocs": { "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" }, @@ -1880,7 +2353,7 @@ "$ref": "#/parameters/apiVersionParameter" }, { - "$ref": "#/parameters/subscriptionIdParameter" + "$ref": "#/parameters/managementGroupIdParameter" }, { "$ref": "#/parameters/alertIdParameter" @@ -1902,16 +2375,61 @@ } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/alerts/{alertId}": { - "get": { + "/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/alerts/{alertId}/updateStatus": { + "patch": { "tags": [ "Alerts" ], - "operationId": "Alerts_GetByResourceGroupName", - "description": "Gets the alert for a resource group under a subscription by alert ID.", - "externalDocs": { - "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + "operationId": "Alerts_UpdateSubscriptionAlertStatus", + "description": "Update alerts status for a subscription.", + "x-ms-examples": { + "Alert": { + "$ref": "./examples/Alert.json" + } }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/alertIdParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Alert" + }, + "description": "Parameters supplied to the update alerts status operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Alert" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/alerts/{alertId}/updateStatus": { + "patch": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_UpdateResourceGroupNameAlertStatus", + "description": "Update alerts status for a resource group under a subscription.", "x-ms-examples": { "Alert": { "$ref": "./examples/Alert.json" @@ -1924,11 +2442,218 @@ { "$ref": "#/parameters/resourceGroupNameParameter" }, + { + "$ref": "#/parameters/alertIdParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Alert" + }, + "description": "Parameters supplied to the update alerts status operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Alert" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/alerts/{alertId}/updateStatus": { + "patch": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_UpdateBillingAccountAlertStatus", + "description": "Update alerts status for billing account.", + "x-ms-examples": { + "Alert": { + "$ref": "./examples/Alert.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountIdParameter" + }, + { + "$ref": "#/parameters/alertIdParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Alert" + }, + "description": "Parameters supplied to the update alerts status operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Alert" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.CostManagement/alerts/{alertId}/updateStatus": { + "patch": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_UpdateDepartmentsAlertStatus", + "description": "Update alerts status for a department.", + "x-ms-examples": { + "Alert": { + "$ref": "./examples/Alert.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountIdParameter" + }, + { + "$ref": "#/parameters/departmentIdParameter" + }, + { + "$ref": "#/parameters/alertIdParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Alert" + }, + "description": "Parameters supplied to the update alerts status operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Alert" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.CostManagement/alerts/{alertId}/updateStatus": { + "patch": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_UpdateEnrollmentAccountAlertStatus", + "description": "Update alerts status for an enrollment account.", + "x-ms-examples": { + "Alert": { + "$ref": "./examples/Alert.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountIdParameter" + }, + { + "$ref": "#/parameters/enrollmentAccountIdParameter" + }, + { + "$ref": "#/parameters/alertIdParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Alert" + }, + "description": "Parameters supplied to the update alerts status operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/Alert" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/alerts/{alertId}/UpdateStatus": { + "patch": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_UpdateManagementGroupAlertStatus", + "description": "Update alerts status for management group.", + "x-ms-examples": { + "Alert": { + "$ref": "./examples/Alert.json" + } + }, + "parameters": [ { "$ref": "#/parameters/apiVersionParameter" }, { + "$ref": "#/parameters/managementGroupIdParameter" + }, + { "$ref": "#/parameters/alertIdParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Alert" + }, + "description": "Parameters supplied to the update alerts status operation." } ], "responses": { @@ -3014,7 +3739,8 @@ "type": "object", "additionalProperties": { "type": "string" - } + }, + "readOnly": true }, "creationTime": { "format": "date-time", @@ -3040,7 +3766,23 @@ "x-ms-enum": { "name": "AlertStatus", "modelAsString": true - }, + } + }, + "statusModificationTime": { + "description": "The current status when alert status was modified.", + "format": "date-time", + "type": "string", + "readOnly": true + }, + "modificationTime": { + "description": "The current status when alert was modified.", + "format": "date-time", + "type": "string", + "readOnly": true + }, + "modificationUsername": { + "description": "The username who modified the alert.", + "type": "string", "readOnly": true } } @@ -3048,6 +3790,7 @@ "AlertDefinition": { "description": "The definition (rule) of an Alert", "type": "object", + "readOnly": true, "properties" : { "category": { "description": "Category of the alert.", @@ -3132,6 +3875,22 @@ "required": true, "type": "string", "x-ms-parameter-location": "method" + }, + "managementGroupIdParameter": { + "name": "managementGroupId", + "in": "path", + "description": "Management Group ID", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "enrollmentAccountIdParameter": { + "name": "enrollmentAccountId", + "in": "path", + "description": "Enrollment Account Id", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" }, "reportNameParameter": { "name": "reportName", diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/Alert.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/Alert.json index 303607957fb9..7b453b028762 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/Alert.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/Alert.json @@ -26,7 +26,10 @@ "costEntityId": "123", "creationTime": "2018-09-03T11:21:43.3495582+03:00", "status": "Active", - "closeTime": "2018-09-10T11:21:43.3495582+03:00" + "closeTime": "2018-09-10T11:21:43.3495582+03:00", + "modificationTime": "2018-12-05T10:04:36.0321998Z", + "statusModificationUserName": "Ido Ben", + "statusModificationTime": "2018-12-05T10:04:36.0321998Z" } } } diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/AlertList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/AlertList.json index fed8b98dd1dd..a81a0565f8dd 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/AlertList.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/AlertList.json @@ -27,7 +27,10 @@ "costEntityId": "123", "creationTime": "2018-09-03T11:21:43.3495582+03:00", "status": "Resolved", - "closeTime": "2018-09-10T11:21:43.3495582+03:00" + "closeTime": "2018-09-10T11:21:43.3495582+03:00", + "modificationTime": "2018-12-05T10:04:36.0321998Z", + "statusModificationUserName": "Ido Ben", + "statusModificationTime": "2018-12-05T10:04:36.0321998Z" } }, { @@ -49,7 +52,10 @@ "costEntityId": "abc", "creationTime": "2018-09-03T11:21:43.3495582+03:00", "status": "Active", - "closeTime": "1970-01-01T00:00:00.0000000+00:00" + "closeTime": "1970-01-01T00:00:00.0000000+00:00", + "modificationTime": "2018-12-05T10:04:36.0321998Z", + "statusModificationUserName": "Ido Ben", + "statusModificationTime": "2018-12-05T10:04:36.0321998Z" } } ]