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 4adfa0fe88be..5992d5101647 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 @@ -2114,6 +2114,130 @@ } } }, + "/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountId}/alerts": { + "get": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_ListByExternalBillingAccounts", + "description": "List all alerts for external billing account.", + "x-ms-examples": { + "Alert_List": { + "$ref": "./examples/ExternalBillingAccountAlertList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/externalBillingAccountIdParameter" + }, + { + "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.CostManagement/externalSubscriptions/{externalSubscriptionId}/alerts": { + "get": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_ListByExternalSubscriptions", + "description": "List all alerts for external subscription.", + "x-ms-examples": { + "Alert_List": { + "$ref": "./examples/ExternalSubscriptionAlertList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/externalSubscriptionIdParameter" + }, + { + "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": [ @@ -2374,6 +2498,90 @@ } } } + }, + "/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountId}/alerts/{alertId}": { + "get": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_GetAlertByExternalBillingAccounts", + "description": "Gets an alert for external billing account by alert ID.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "Alert": { + "$ref": "./examples/ExternalBillingAccountAlert.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/externalBillingAccountIdParameter" + }, + { + "$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.CostManagement/externalSubscriptions/{externalSubscriptionId}/alerts/{alertId}": { + "get": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_GetAlertByExternalSubscriptions", + "description": "Gets an alert for external subscription by alert ID.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "Alert": { + "$ref": "./examples/ExternalSubscriptionAlert.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/externalSubscriptionIdParameter" + }, + { + "$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}/providers/Microsoft.CostManagement/alerts/{alertId}/updateStatus": { "patch": { @@ -2672,6 +2880,102 @@ } } }, + "/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountId}/alerts/{alertId}/UpdateStatus": { + "patch": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_UpdateExternalBillingAccountAlertStatus", + "description": "Update alerts status for external billing accounts.", + "x-ms-examples": { + "Alert": { + "$ref": "./examples/ExternalBillingAccountAlert.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/externalBillingAccountIdParameter" + }, + { + "$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.CostManagement/externalSubscriptions/{externalSubscriptionId}/alerts/{alertId}/UpdateStatus": { + "patch": { + "tags": [ + "Alerts" + ], + "operationId": "Alerts_UpdateExternalSubscriptionAlertStatus", + "description": "Update alerts status for external subscription.", + "x-ms-examples": { + "Alert": { + "$ref": "./examples/ExternalSubscriptionAlert.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/externalSubscriptionIdParameter" + }, + { + "$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.CostManagement/operations": { "get": { "tags": [ @@ -3886,6 +4190,22 @@ "required": true, "type": "string", "x-ms-parameter-location": "method" + }, + "externalBillingAccountIdParameter": { + "name": "externalBillingAccountId", + "in": "path", + "description": "External Billing Account ID", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "externalSubscriptionIdParameter": { + "name": "externalSubscriptionId", + "in": "path", + "description": "External Subscription ID", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" }, "enrollmentAccountIdParameter": { "name": "enrollmentAccountId", @@ -3920,4 +4240,4 @@ "x-ms-parameter-location": "method" } } -} \ No newline at end of file +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/ExternalBillingAccountAlert.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/ExternalBillingAccountAlert.json new file mode 100644 index 000000000000..d32fd51ae62c --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/ExternalBillingAccountAlert.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "api-version": "2018-08-01-preview", + "externalBillingAccountId": "aws-45645646", + "alertId": "0e1d6ee7-0052-4996-89e2-023263106885" + }, + "responses": { + "200": { + "body": { + "id": "/providers/Microsoft.CostManagement/externalBillingAccounts/aws-45645646/alerts/0e1d6ee7-0052-4996-89e2-023263106885", + "name": "0e1d6ee7-0052-4996-89e2-023263106885", + "type": "Microsoft.CostManagement/alerts", + "properties": { + "definition": { + "type": "Budget", + "category": "Cost", + "criteria": "CostThresholdExceeded" + }, + "description": "This is an example alert", + "source": "User", + "details": { + "amountDue": "500.0", + "billedAmount": "680.36" + }, + "costEntityId": "123", + "creationTime": "2018-09-03T11:21:43.3495582+03:00", + "status": "Active", + "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" + } + } + } + } +} \ No newline at end of file diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/ExternalBillingAccountAlertList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/ExternalBillingAccountAlertList.json new file mode 100644 index 000000000000..6a9cfdd34394 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/ExternalBillingAccountAlertList.json @@ -0,0 +1,63 @@ +{ + "parameters": { + "api-version": "2018-08-01-preview", + "externalBillingAccountId": "aws-23435321" + }, + "responses": { + "200": { + "body": { + "value": [{ + "id": "/providers/Microsoft.CostManagement/externalBillingAccounts/aws-23435321/alerts/0e1d6ee7-0052-4996-89e2-023263106885", + "name": "0e1d6ee7-0052-4996-89e2-023263106885", + "type": "Microsoft.CostManagement/alerts", + "properties": { + "definition": { + "type": "Budget", + "category": "Cost", + "criteria": "CostThresholdExceeded" + }, + "description": "This is an example alert", + "source": "User", + "details": { + "amountDue": "500.0", + "billedAmount": "680.36" + }, + "costEntityId": "123", + "creationTime": "2018-09-03T11:21:43.3495582+03:00", + "status": "Resolved", + "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" + } + }, + { + "id": "/providers/Microsoft.CostManagement/externalBillingAccounts/aws-23435321/alerts/0e1d6ee7-0052-4996-4532-023263106885", + "name": "0e1d6ee7-0052-4996-4532-023263106454", + "type": "Microsoft.CostManagement/alerts", + "properties": { + "definition": { + "type": "Credit", + "category": "Billing", + "criteria": "CreditThresholdReached" + }, + "description": "This is another example alert", + "source": "Preset", + "details": { + "amountDue": "500.0", + "billedAmount": "680.36" + }, + "costEntityId": "abc", + "creationTime": "2018-09-03T11:21:43.3495582+03:00", + "status": "Active", + "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" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/ExternalSubscriptionAlert.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/ExternalSubscriptionAlert.json new file mode 100644 index 000000000000..9579157022a2 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/ExternalSubscriptionAlert.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "api-version": "2018-08-01-preview", + "externalSubscriptionId": "aws-43535353", + "alertId": "0e1d6ee7-0052-4996-89e2-023263106885" + }, + "responses": { + "200": { + "body": { + "id": "/providers/Microsoft.CostManagement/externalSubscriptions/aws-43535353/alerts/0e1d6ee7-0052-4996-89e2-023263106885", + "name": "0e1d6ee7-0052-4996-89e2-023263106885", + "type": "Microsoft.CostManagement/alerts", + "properties": { + "definition": { + "type": "Budget", + "category": "Cost", + "criteria": "CostThresholdExceeded" + }, + "description": "This is an example alert", + "source": "User", + "details": { + "amountDue": "500.0", + "billedAmount": "680.36" + }, + "costEntityId": "123", + "creationTime": "2018-09-03T11:21:43.3495582+03:00", + "status": "Active", + "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" + } + } + } + } +} \ No newline at end of file diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/ExternalSubscriptionAlertList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/ExternalSubscriptionAlertList.json new file mode 100644 index 000000000000..f6a27f6bb3bf --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-08-01-preview/examples/ExternalSubscriptionAlertList.json @@ -0,0 +1,63 @@ +{ + "parameters": { + "api-version": "2018-08-01-preview", + "externalSubscriptionId": "aws-43535353" + }, + "responses": { + "200": { + "body": { + "value": [{ + "id": "/providers/Microsoft.CostManagement/externalSubscriptions/aws-43535353/alerts/0e1d6ee7-0052-4996-89e2-023263106885", + "name": "0e1d6ee7-0052-4996-89e2-023263106885", + "type": "Microsoft.CostManagement/alerts", + "properties": { + "definition": { + "type": "Budget", + "category": "Cost", + "criteria": "CostThresholdExceeded" + }, + "description": "This is an example alert", + "source": "User", + "details": { + "amountDue": "500.0", + "billedAmount": "680.36" + }, + "costEntityId": "123", + "creationTime": "2018-09-03T11:21:43.3495582+03:00", + "status": "Resolved", + "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" + } + }, + { + "id": "/providers/Microsoft.CostManagement/externalSubscriptions/aws-43535353/alerts/0e1d6ee7-0052-4996-4532-023263106885", + "name": "0e1d6ee7-0052-4996-4532-023263106454", + "type": "Microsoft.CostManagement/alerts", + "properties": { + "definition": { + "type": "Credit", + "category": "Billing", + "criteria": "CreditThresholdReached" + }, + "description": "This is another example alert", + "source": "Preset", + "details": { + "amountDue": "500.0", + "billedAmount": "680.36" + }, + "costEntityId": "abc", + "creationTime": "2018-09-03T11:21:43.3495582+03:00", + "status": "Active", + "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" + } + } + ] + } + } + } +} \ No newline at end of file