diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/common-types.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/common-types.json index 312eaa9c232c..1d91c978140f 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/common-types.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/common-types.json @@ -1,10 +1,75 @@ { "swagger": "2.0", "info": { - "version": "2022-10-01", - "title": "Cost Management common types" + "version": "2021-10-01", + "title": "CostManagementClient" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow.", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/providers/Microsoft.CostManagement/operations": { + "get": { + "tags": [ + "Operations" + ], + "operationId": "Operations_List", + "description": "Lists all of the available cost management REST API operations.", + "x-ms-examples": { + "OperationList": { + "$ref": "./examples/OperationList.json" + } + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/OperationListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } }, - "paths": {}, "definitions": { "ErrorResponse": { "description": "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. \n\nSome Error responses: \n\n * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the \"x-ms-ratelimit-microsoft.consumption-retry-after\" header. \n\n * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the \"Retry-After\" header.", @@ -32,40 +97,40 @@ } } }, - "ProxyResource": { - "description": "The Resource model definition.", + "CostManagementOperation": { + "description": "A Cost management REST API operation.", "type": "object", "properties": { "id": { - "readOnly": true, - "type": "string", - "description": "Resource Id." - }, - "name": { - "readOnly": true, + "description": "Operation id: {provider}/{resource}/{operation}.", "type": "string", - "description": "Resource name." - }, - "type": { + "readOnly": true + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/Operation" + } + ] + }, + "OperationListResult": { + "description": "Result of listing cost management operations. It contains a list of operations and a URL link to get the next set of results.", + "type": "object", + "properties": { + "value": { + "description": "List of cost management operations supported by the Microsoft.CostManagement resource provider.", + "type": "array", "readOnly": true, - "type": "string", - "description": "Resource type." + "items": { + "$ref": "#/definitions/CostManagementOperation" + } }, - "eTag": { + "nextLink": { + "description": "URL to get the next set of operation list results if there are any.", "type": "string", - "description": "eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not." + "readOnly": true } - }, - "x-ms-azure-resource": true - } - }, - "parameters": { - "apiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "type": "string", - "description": "Version of the API to be used with the client request." + } } } } diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/costmanagement.generatecostdetailsreport.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/costmanagement.generatecostdetailsreport.json index 13a6e4e9b409..d4f2e6f5291e 100644 --- a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/costmanagement.generatecostdetailsreport.json +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/costmanagement.generatecostdetailsreport.json @@ -75,7 +75,7 @@ "$ref": "#/parameters/scopeUsageDetailsParameter" }, { - "$ref": "common-types.json#/parameters/apiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { "name": "parameters", @@ -145,7 +145,7 @@ "description": "The target operation Id." }, { - "$ref": "common-types.json#/parameters/apiVersionParameter" + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" } ], "responses": { diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/OperationList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/OperationList.json new file mode 100644 index 000000000000..27b1f278d9ee --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/OperationList.json @@ -0,0 +1,113 @@ +{ + "parameters": { + "api-version": "2022-10-01" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "Microsoft.CostManagement/budgets/read", + "name": "Microsoft.CostManagement/budgets/read", + "display": { + "provider": "Microsoft.CostManagement", + "resource": "Budgets", + "operation": "List budgets", + "description": "List the budgets by a subscription or a management group." + } + }, + { + "id": "Microsoft.CostManagement/query/action", + "name": "Microsoft.CostManagement/query/action", + "display": { + "provider": "Microsoft.CostManagement", + "resource": "Query", + "operation": "Query usage data", + "description": "Query usage data by a scope." + } + }, + { + "id": "Microsoft.CostManagement/exports/read", + "name": "Microsoft.CostManagement/exports/read", + "display": { + "provider": "Microsoft.CostManagement", + "resource": "Exports", + "operation": "List exports", + "description": "List the exports by scope." + } + }, + { + "id": "Microsoft.CostManagement/exports/write", + "name": "Microsoft.CostManagement/exports/write", + "display": { + "provider": "Microsoft.CostManagement", + "resource": "Exports", + "operation": "Create and update export", + "description": "Create or update the specified export." + } + }, + { + "id": "Microsoft.CostManagement/exports/action", + "name": "Microsoft.CostManagement/exports/action", + "display": { + "provider": "Microsoft.CostManagement", + "resource": "Exports", + "operation": "Run export", + "description": "Run the specified export." + } + }, + { + "id": "Microsoft.CostManagement/exports/run/action", + "name": "Microsoft.CostManagement/exports/run/action", + "display": { + "provider": "Microsoft.CostManagement", + "resource": "exports/run", + "operation": "Run exports", + "description": "Run exports." + } + }, + { + "id": "Microsoft.CostManagement/alerts/read", + "name": "Microsoft.CostManagement/alerts/read", + "display": { + "provider": "Microsoft.CostManagement", + "resource": "Alerts", + "operation": "List Alerts", + "description": "List alerts." + } + }, + { + "id": "Microsoft.CostManagement/operations/read", + "name": "Microsoft.CostManagement/operations/read", + "display": { + "provider": "Microsoft.CostManagement", + "resource": "Operations", + "operation": "List supported operations", + "description": "List all supported operations by Microsoft.CostManagement resource provider." + } + }, + { + "id": "Microsoft.CostManagement/views/action", + "name": "Microsoft.CostManagement/views/action", + "display": { + "provider": "Microsoft.CostManagement", + "resource": "Views", + "operation": "Create views", + "description": "Create view." + } + }, + { + "id": "Microsoft.CostManagement/views/write", + "name": "Microsoft.CostManagement/views/write", + "display": { + "provider": "Microsoft.CostManagement", + "resource": "Views", + "operation": "Update views", + "description": "Update view." + } + } + ] + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/checkNameAvailability-private-scheduledAction.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/checkNameAvailability-private-scheduledAction.json new file mode 100644 index 000000000000..e95e9df22a4c --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/checkNameAvailability-private-scheduledAction.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "api-version": "2022-10-01", + "checkNameAvailabilityRequest": { + "name": "testName", + "type": "Microsoft.CostManagement/ScheduledActions" + } + }, + "responses": { + "200": { + "body": { + "nameAvailable": false, + "reason": "AlreadyExists", + "message": "A private scheduled action with name 'testName' is already present. Please specify a differnt name." + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/checkNameAvailability-shared-scheduledAction.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/checkNameAvailability-shared-scheduledAction.json new file mode 100644 index 000000000000..ce6c1d0b1075 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/checkNameAvailability-shared-scheduledAction.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "api-version": "2022-10-01", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "checkNameAvailabilityRequest": { + "name": "testName", + "type": "Microsoft.CostManagement/ScheduledActions" + } + }, + "responses": { + "200": { + "body": { + "nameAvailable": true + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-createOrUpdate-private.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-createOrUpdate-private.json new file mode 100644 index 000000000000..0f20da030e4e --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-createOrUpdate-private.json @@ -0,0 +1,126 @@ +{ + "parameters": { + "api-version": "2022-10-01", + "name": "monthlyCostByResource", + "scheduledAction": { + "kind": "Email", + "properties": { + "displayName": "Monthly Cost By Resource", + "notification": { + "to": [ + "user@gmail.com", + "team@gmail.com" + ], + "subject": "Cost by resource this month" + }, + "schedule": { + "frequency": "Monthly", + "weeksOfMonth": [ + "First", + "Third" + ], + "daysOfWeek": [ + "Monday" + ], + "hourOfDay": 10, + "startDate": "2020-06-19T22:21:51.1287144Z", + "endDate": "2021-06-19T22:21:51.1287144Z" + }, + "status": "Enabled", + "viewId": "/providers/Microsoft.CostManagement/views/swaggerExample" + } + } + }, + "responses": { + "201": { + "body": { + "id": "providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource", + "name": "monthlyCostByResource", + "type": "Microsoft.CostManagement/ScheduledActions", + "kind": "Email", + "eTag": "\"1d4ff9fe66f1d10\"", + "systemData": { + "createdBy": "testuser", + "createdByType": "User", + "createdAt": "2020-06-18T22:21:51.1287144Z", + "lastModifiedBy": "testuser", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-06-18T22:21:51.1287144Z" + }, + "properties": { + "displayName": "Monthly Cost By Resource", + "notification": { + "language": "fr", + "regionalFormat": "fr", + "to": [ + "user@gmail.com", + "team@gmail.com" + ], + "subject": "Cost by resource this month" + }, + "schedule": { + "frequency": "Monthly", + "weeksOfMonth": [ + "First", + "Third" + ], + "daysOfWeek": [ + "Monday" + ], + "hourOfDay": 10, + "startDate": "2020-06-19T22:21:51.1287144Z", + "endDate": "2021-06-19T22:21:51.1287144Z" + }, + "scope": "", + "status": "Enabled", + "viewId": "/providers/Microsoft.CostManagement/views/swaggerExample" + } + } + }, + "200": { + "body": { + "id": "providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource", + "name": "monthlyCostByResource", + "type": "Microsoft.CostManagement/ScheduledActions", + "kind": "Email", + "eTag": "\"1d4ff9fe66f1d10\"", + "systemData": { + "createdBy": "testuser", + "createdByType": "User", + "createdAt": "2020-06-18T22:21:51.1287144Z", + "lastModifiedBy": "testuser", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-06-19T22:21:51.1287144Z" + }, + "properties": { + "displayName": "Monthly Cost By Resource", + "notification": { + "language": "fr", + "regionalFormat": "fr", + "to": [ + "user@gmail.com", + "team@gmail.com" + ], + "subject": "Cost by resource this month" + }, + "scope": "", + "status": "Enabled", + "schedule": { + "frequency": "Monthly", + "weeksOfMonth": [ + "First", + "Third" + ], + "daysOfWeek": [ + "Monday" + ], + "hourOfDay": 10, + "startDate": "2020-06-19T22:21:51.1287144Z", + "endDate": "2021-06-19T22:21:51.1287144Z" + }, + "viewId": "/providers/Microsoft.CostManagement/views/swaggerExample" + } + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-createOrUpdate-shared.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-createOrUpdate-shared.json new file mode 100644 index 000000000000..7358f399de5d --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-createOrUpdate-shared.json @@ -0,0 +1,133 @@ +{ + "parameters": { + "api-version": "2022-10-01", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "name": "monthlyCostByResource", + "scheduledAction": { + "kind": "Email", + "properties": { + "displayName": "Monthly Cost By Resource", + "fileDestination": { + "fileFormats": [ + "Csv" + ] + }, + "notification": { + "to": [ + "user@gmail.com", + "team@gmail.com" + ], + "subject": "Cost by resource this month" + }, + "schedule": { + "frequency": "Monthly", + "weeksOfMonth": [ + "First", + "Third" + ], + "daysOfWeek": [ + "Monday" + ], + "hourOfDay": 10, + "startDate": "2020-06-19T22:21:51.1287144Z", + "endDate": "2021-06-19T22:21:51.1287144Z" + }, + "status": "Enabled", + "viewId": "/providers/Microsoft.CostManagement/views/swaggerExample" + } + } + }, + "responses": { + "201": { + "body": { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource", + "name": "monthlyCostByResource", + "type": "Microsoft.CostManagement/ScheduledActions", + "kind": "Email", + "eTag": "\"1d4ff9fe66f1d10\"", + "systemData": { + "createdBy": "testuser", + "createdByType": "User", + "createdAt": "2020-06-18T22:21:51.1287144Z", + "lastModifiedBy": "testuser", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-06-18T22:21:51.1287144Z" + }, + "properties": { + "displayName": "Monthly Cost By Resource", + "fileDestination": { + "fileFormats": [ + "Csv" + ] + }, + "notification": { + "to": [ + "user@gmail.com", + "team@gmail.com" + ], + "subject": "Cost by resource this month" + }, + "schedule": { + "frequency": "Monthly", + "weeksOfMonth": [ + "First", + "Third" + ], + "daysOfWeek": [ + "Monday" + ], + "hourOfDay": 10, + "startDate": "2020-06-19T22:21:51.1287144Z", + "endDate": "2021-06-19T22:21:51.1287144Z" + }, + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "status": "Enabled", + "viewId": "/providers/Microsoft.CostManagement/views/swaggerExample" + } + } + }, + "200": { + "body": { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource", + "name": "monthlyCostByResource", + "type": "Microsoft.CostManagement/ScheduledActions", + "kind": "Email", + "eTag": "\"1d4ff9fe66f1d10\"", + "systemData": { + "createdBy": "testuser", + "createdByType": "User", + "createdAt": "2020-06-18T22:21:51.1287144Z", + "lastModifiedBy": "testuser", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-06-19T22:21:51.1287144Z" + }, + "properties": { + "displayName": "Monthly Cost By Resource", + "notification": { + "to": [ + "user@gmail.com", + "team@gmail.com" + ], + "subject": "Cost by resource this month" + }, + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "schedule": { + "frequency": "Monthly", + "weeksOfMonth": [ + "First", + "Third" + ], + "daysOfWeek": [ + "Monday" + ], + "hourOfDay": 10, + "startDate": "2020-06-19T22:21:51.1287144Z", + "endDate": "2021-06-19T22:21:51.1287144Z" + }, + "status": "Enabled", + "viewId": "/providers/Microsoft.CostManagement/views/swaggerExample" + } + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-delete-private.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-delete-private.json new file mode 100644 index 000000000000..1bcdb3343f98 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-delete-private.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "api-version": "2022-10-01", + "name": "monthlyCostByResource" + }, + "responses": { + "200": {}, + "204": {} + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-delete-shared.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-delete-shared.json new file mode 100644 index 000000000000..dcda18d350fc --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-delete-shared.json @@ -0,0 +1,11 @@ +{ + "parameters": { + "api-version": "2022-10-01", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "name": "monthlyCostByResource" + }, + "responses": { + "200": {}, + "204": {} + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-execute-private.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-execute-private.json new file mode 100644 index 000000000000..3ab5c0b725d4 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-execute-private.json @@ -0,0 +1,9 @@ +{ + "parameters": { + "api-version": "2022-10-01", + "name": "monthlyCostByResource" + }, + "responses": { + "200": {} + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-execute-shared.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-execute-shared.json new file mode 100644 index 000000000000..c2600f83e5de --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-execute-shared.json @@ -0,0 +1,10 @@ +{ + "parameters": { + "api-version": "2022-10-01", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "name": "monthlyCostByResource" + }, + "responses": { + "200": {} + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-get-private.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-get-private.json new file mode 100644 index 000000000000..878aacd51e84 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-get-private.json @@ -0,0 +1,51 @@ +{ + "parameters": { + "api-version": "2022-10-01", + "name": "monthlyCostByResource" + }, + "responses": { + "200": { + "body": { + "id": "providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource", + "name": "monthlyCostByResource", + "type": "Microsoft.CostManagement/ScheduledActions", + "kind": "Email", + "eTag": "\"1d4ff9fe66f1d10\"", + "systemData": { + "createdBy": "testuser", + "createdByType": "User", + "createdAt": "2020-06-18T22:21:51.1287144Z", + "lastModifiedBy": "testuser", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-06-18T22:21:51.1287144Z" + }, + "properties": { + "displayName": "Monthly Cost By Resource", + "scope": "", + "status": "Enabled", + "viewId": "/providers/Microsoft.CostManagement/views/swaggerExample", + "schedule": { + "frequency": "Monthly", + "weeksOfMonth": [ + "First", + "Third" + ], + "daysOfWeek": [ + "Monday" + ], + "hourOfDay": 10, + "startDate": "2020-06-19T22:21:51.1287144Z", + "endDate": "2021-06-19T22:21:51.1287144Z" + }, + "notification": { + "to": [ + "user@gmail.com", + "team@gmail.com" + ], + "subject": "Cost by resource this month" + } + } + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-get-shared.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-get-shared.json new file mode 100644 index 000000000000..265abb68671d --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-get-shared.json @@ -0,0 +1,52 @@ +{ + "parameters": { + "api-version": "2022-10-01", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "name": "monthlyCostByResource" + }, + "responses": { + "200": { + "body": { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource", + "name": "monthlyCostByResource", + "type": "Microsoft.CostManagement/ScheduledActions", + "kind": "Email", + "eTag": "\"1d4ff9fe66f1d10\"", + "systemData": { + "createdBy": "testuser", + "createdByType": "User", + "createdAt": "2020-06-18T22:21:51.1287144Z", + "lastModifiedBy": "testuser", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-06-18T22:21:51.1287144Z" + }, + "properties": { + "displayName": "Monthly Cost By Resource", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "status": "Enabled", + "viewId": "/providers/Microsoft.CostManagement/views/swaggerExample", + "schedule": { + "frequency": "Monthly", + "weeksOfMonth": [ + "First", + "Third" + ], + "daysOfWeek": [ + "Monday" + ], + "hourOfDay": 10, + "startDate": "2020-06-19T22:21:51.1287144Z", + "endDate": "2021-06-19T22:21:51.1287144Z" + }, + "notification": { + "to": [ + "user@gmail.com", + "team@gmail.com" + ], + "subject": "Cost by resource this month" + } + } + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-insightAlert-createOrUpdate-shared.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-insightAlert-createOrUpdate-shared.json new file mode 100644 index 000000000000..859871813450 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledAction-insightAlert-createOrUpdate-shared.json @@ -0,0 +1,105 @@ +{ + "parameters": { + "api-version": "2022-10-01", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "name": "dailyAnomalyByResource", + "scheduledAction": { + "kind": "InsightAlert", + "properties": { + "displayName": "Daily anomaly by resource", + "notification": { + "to": [ + "user@gmail.com", + "team@gmail.com" + ], + "subject": "Cost anomaly detected in the resource" + }, + "schedule": { + "frequency": "Daily", + "startDate": "2020-06-19T22:21:51.1287144Z", + "endDate": "2021-06-19T22:21:51.1287144Z" + }, + "status": "Enabled", + "viewId": "/providers/Microsoft.CostManagement/views/swaggerExample" + } + } + }, + "responses": { + "201": { + "body": { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/dailyAnomalyByResource", + "name": "dailyAnomalyByResource", + "type": "Microsoft.CostManagement/ScheduledActions", + "kind": "InsightAlert", + "eTag": "\"1d4ff9fe66f1d10\"", + "systemData": { + "createdBy": "testuser", + "createdByType": "User", + "createdAt": "2020-06-18T22:21:51.1287144Z", + "lastModifiedBy": "testuser", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-06-18T22:21:51.1287144Z" + }, + "properties": { + "displayName": "Daily anomaly by resource", + "fileDestination": { + "fileFormats": [] + }, + "notification": { + "to": [ + "user@gmail.com", + "team@gmail.com" + ], + "subject": "Cost anomaly detected in the resource" + }, + "schedule": { + "frequency": "Daily", + "startDate": "2020-06-19T22:21:51.1287144Z", + "endDate": "2021-06-19T22:21:51.1287144Z" + }, + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "status": "Enabled", + "viewId": "/providers/Microsoft.CostManagement/views/swaggerExample" + } + } + }, + "200": { + "body": { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/dailyAnomalyByResource", + "name": "dailyAnomalyByResource", + "type": "Microsoft.CostManagement/ScheduledActions", + "kind": "InsightAlert", + "eTag": "\"1d4ff9fe66f1d10\"", + "systemData": { + "createdBy": "testuser", + "createdByType": "User", + "createdAt": "2020-06-18T22:21:51.1287144Z", + "lastModifiedBy": "testuser", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-06-19T22:21:51.1287144Z" + }, + "properties": { + "displayName": "Daily anomaly by resource", + "fileDestination": { + "fileFormats": [] + }, + "notification": { + "to": [ + "user@gmail.com", + "team@gmail.com" + ], + "subject": "Cost anomaly detected in the resource" + }, + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "schedule": { + "frequency": "Daily", + "startDate": "2020-06-19T22:21:51.1287144Z", + "endDate": "2021-06-19T22:21:51.1287144Z" + }, + "status": "Enabled", + "viewId": "/providers/Microsoft.CostManagement/views/swaggerExample" + } + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-list-private.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-list-private.json new file mode 100644 index 000000000000..df316baff6ed --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-list-private.json @@ -0,0 +1,89 @@ +{ + "parameters": { + "api-version": "2022-10-01" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource", + "name": "monthlyCostByResource", + "type": "Microsoft.CostManagement/ScheduledActions", + "kind": "Email", + "eTag": "\"1d4ff9fe66f1d10\"", + "systemData": { + "createdBy": "testuser", + "createdByType": "User", + "createdAt": "2020-06-18T22:21:51.1287144Z", + "lastModifiedBy": "testuser", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-06-18T22:21:51.1287144Z" + }, + "properties": { + "displayName": "Monthly Cost By Resource", + "scope": "", + "status": "Enabled", + "viewId": "/providers/Microsoft.CostManagement/views/swaggerExample", + "schedule": { + "frequency": "Monthly", + "weeksOfMonth": [ + "First", + "Third" + ], + "daysOfWeek": [ + "Monday" + ], + "hourOfDay": 10, + "startDate": "2020-06-19T22:21:51.1287144Z", + "endDate": "2021-06-19T22:21:51.1287144Z" + }, + "notification": { + "to": [ + "user@gmail.com", + "team@gmail.com" + ], + "subject": "Cost by resource this month" + } + } + }, + { + "id": "providers/Microsoft.CostManagement/scheduledActions/dailyCostByResource", + "name": "dailyCostByResource", + "type": "Microsoft.CostManagement/ScheduledActions", + "kind": "Email", + "eTag": "\"1d4ff9fe66f1d15\"", + "systemData": { + "createdBy": "testuser", + "createdByType": "User", + "createdAt": "2020-06-18T22:21:51.1287144Z", + "lastModifiedBy": "testuser", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-06-18T22:21:51.1287144Z" + }, + "properties": { + "displayName": "Daily Cost By Resource", + "scope": "", + "status": "Disabled", + "viewId": "/providers/Microsoft.CostManagement/views/swaggerExample", + "schedule": { + "frequency": "Daily", + "hourOfDay": 12, + "startDate": "2020-06-19T22:21:51.1287144Z", + "endDate": "2021-06-19T22:21:51.1287144Z" + }, + "notification": { + "to": [ + "user@gmail.com", + "team@gmail.com" + ], + "subject": "Daily Cost By Resource" + } + } + } + ], + "nextLink": null + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-list-shared.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-list-shared.json new file mode 100644 index 000000000000..8abc5160b1b8 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-list-shared.json @@ -0,0 +1,90 @@ +{ + "parameters": { + "api-version": "2022-10-01", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource", + "name": "monthlyCostByResource", + "type": "Microsoft.CostManagement/ScheduledActions", + "kind": "Email", + "eTag": "\"1d4ff9fe66f1d10\"", + "systemData": { + "createdBy": "testuser", + "createdByType": "User", + "createdAt": "2020-06-18T22:21:51.1287144Z", + "lastModifiedBy": "testuser", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-06-18T22:21:51.1287144Z" + }, + "properties": { + "displayName": "Monthly Cost By Resource", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "status": "Enabled", + "viewId": "/providers/Microsoft.CostManagement/views/swaggerExample", + "schedule": { + "frequency": "Monthly", + "weeksOfMonth": [ + "First", + "Third" + ], + "daysOfWeek": [ + "Monday" + ], + "hourOfDay": 10, + "startDate": "2020-06-19T22:21:51.1287144Z", + "endDate": "2021-06-19T22:21:51.1287144Z" + }, + "notification": { + "to": [ + "user@gmail.com", + "team@gmail.com" + ], + "subject": "Cost by resource this month" + } + } + }, + { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/dailyCostByResource", + "name": "dailyCostByResource", + "type": "Microsoft.CostManagement/ScheduledActions", + "kind": "Email", + "eTag": "\"1d4ff9fe66f1d15\"", + "systemData": { + "createdBy": "testuser", + "createdByType": "User", + "createdAt": "2020-06-18T22:21:51.1287144Z", + "lastModifiedBy": "testuser", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-06-18T22:21:51.1287144Z" + }, + "properties": { + "displayName": "Daily Cost By Resource", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "status": "Disabled", + "viewId": "/providers/Microsoft.CostManagement/views/swaggerExample", + "schedule": { + "frequency": "Daily", + "hourOfDay": 12, + "startDate": "2020-06-19T22:21:51.1287144Z", + "endDate": "2021-06-19T22:21:51.1287144Z" + }, + "notification": { + "to": [ + "user@gmail.com", + "team@gmail.com" + ], + "subject": "Daily Cost By Resource" + } + } + } + ], + "nextLink": null + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-listWithFilter-private.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-listWithFilter-private.json new file mode 100644 index 000000000000..812026491219 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-listWithFilter-private.json @@ -0,0 +1,90 @@ +{ + "parameters": { + "api-version": "2022-10-01", + "$filter": "properties/viewId eq '/providers/Microsoft.CostManagement/views/swaggerExample'" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource", + "name": "monthlyCostByResource", + "type": "Microsoft.CostManagement/ScheduledActions", + "kind": "Email", + "eTag": "\"1d4ff9fe66f1d10\"", + "systemData": { + "createdBy": "testuser", + "createdByType": "User", + "createdAt": "2020-06-18T22:21:51.1287144Z", + "lastModifiedBy": "testuser", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-06-18T22:21:51.1287144Z" + }, + "properties": { + "displayName": "Monthly Cost By Resource", + "scope": "", + "status": "Enabled", + "viewId": "/providers/Microsoft.CostManagement/views/swaggerExample", + "schedule": { + "frequency": "Monthly", + "weeksOfMonth": [ + "First", + "Third" + ], + "daysOfWeek": [ + "Monday" + ], + "hourOfDay": 10, + "startDate": "2020-06-19T22:21:51.1287144Z", + "endDate": "2021-06-19T22:21:51.1287144Z" + }, + "notification": { + "to": [ + "user@gmail.com", + "team@gmail.com" + ], + "subject": "Cost by resource this month" + } + } + }, + { + "id": "providers/Microsoft.CostManagement/scheduledActions/dailyCostByResource", + "name": "dailyCostByResource", + "type": "Microsoft.CostManagement/ScheduledActions", + "kind": "Email", + "eTag": "\"1d4ff9fe66f1d15\"", + "systemData": { + "createdBy": "testuser", + "createdByType": "User", + "createdAt": "2020-06-18T22:21:51.1287144Z", + "lastModifiedBy": "testuser", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-06-18T22:21:51.1287144Z" + }, + "properties": { + "displayName": "Daily Cost By Resource", + "scope": "", + "status": "Disabled", + "viewId": "/providers/Microsoft.CostManagement/views/swaggerExample", + "schedule": { + "frequency": "Daily", + "hourOfDay": 12, + "startDate": "2020-06-19T22:21:51.1287144Z", + "endDate": "2021-06-19T22:21:51.1287144Z" + }, + "notification": { + "to": [ + "user@gmail.com", + "team@gmail.com" + ], + "subject": "Daily Cost By Resource" + } + } + } + ], + "nextLink": null + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-listWithFilter-shared.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-listWithFilter-shared.json new file mode 100644 index 000000000000..3fb7f6ff754a --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/examples/scheduledActions/scheduledActions-listWithFilter-shared.json @@ -0,0 +1,91 @@ +{ + "parameters": { + "api-version": "2022-10-01", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "$filter": "properties/viewId eq '/providers/Microsoft.CostManagement/views/swaggerExample'" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource", + "name": "monthlyCostByResource", + "type": "Microsoft.CostManagement/ScheduledActions", + "kind": "Email", + "eTag": "\"1d4ff9fe66f1d10\"", + "systemData": { + "createdBy": "testuser", + "createdByType": "User", + "createdAt": "2020-06-18T22:21:51.1287144Z", + "lastModifiedBy": "testuser", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-06-18T22:21:51.1287144Z" + }, + "properties": { + "displayName": "Monthly Cost By Resource", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "status": "Enabled", + "viewId": "/providers/Microsoft.CostManagement/views/swaggerExample", + "schedule": { + "frequency": "Monthly", + "weeksOfMonth": [ + "First", + "Third" + ], + "daysOfWeek": [ + "Monday" + ], + "hourOfDay": 10, + "startDate": "2020-06-19T22:21:51.1287144Z", + "endDate": "2021-06-19T22:21:51.1287144Z" + }, + "notification": { + "to": [ + "user@gmail.com", + "team@gmail.com" + ], + "subject": "Cost by resource this month" + } + } + }, + { + "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/dailyCostByResource", + "name": "dailyCostByResource", + "type": "Microsoft.CostManagement/ScheduledActions", + "kind": "Email", + "eTag": "\"1d4ff9fe66f1d15\"", + "systemData": { + "createdBy": "testuser", + "createdByType": "User", + "createdAt": "2020-06-18T22:21:51.1287144Z", + "lastModifiedBy": "testuser", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-06-18T22:21:51.1287144Z" + }, + "properties": { + "displayName": "Daily Cost By Resource", + "scope": "subscriptions/00000000-0000-0000-0000-000000000000", + "status": "Disabled", + "viewId": "/providers/Microsoft.CostManagement/views/swaggerExample", + "schedule": { + "frequency": "Daily", + "hourOfDay": 12, + "startDate": "2020-06-19T22:21:51.1287144Z", + "endDate": "2021-06-19T22:21:51.1287144Z" + }, + "notification": { + "to": [ + "user@gmail.com", + "team@gmail.com" + ], + "subject": "Daily Cost By Resource" + } + } + } + ], + "nextLink": null + } + } + } +} diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/scheduledActions.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/scheduledActions.json new file mode 100644 index 000000000000..fe4e27a26707 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/stable/2022-10-01/scheduledActions.json @@ -0,0 +1,940 @@ +{ + "swagger": "2.0", + "info": { + "title": "CostManagementClient", + "version": "2022-10-01" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow.", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/providers/Microsoft.CostManagement/scheduledActions": { + "get": { + "tags": [ + "ScheduledActions" + ], + "operationId": "ScheduledActions_List", + "description": "List all private scheduled actions.", + "externalDocs": { + "url": "https://docs.microsoft.com/rest/api/cost-management/" + }, + "x-ms-examples": { + "PrivateScheduledActionsList": { + "$ref": "./examples/scheduledActions/scheduledActions-list-private.json" + }, + "PrivateScheduledActionsListFilterByViewId": { + "$ref": "./examples/scheduledActions/scheduledActions-listWithFilter-private.json" + } + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "$filter", + "description": "May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'.", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ScheduledActionListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/scheduledActions": { + "get": { + "tags": [ + "ScheduledActions" + ], + "operationId": "ScheduledActions_ListByScope", + "description": "List all shared scheduled actions within the given scope.", + "externalDocs": { + "url": "https://docs.microsoft.com/rest/api/cost-management/" + }, + "x-ms-examples": { + "ScheduledActionsListByScope": { + "$ref": "./examples/scheduledActions/scheduledActions-list-shared.json" + }, + "ScheduledActionsListByScopeFilterByViewId": { + "$ref": "./examples/scheduledActions/scheduledActions-listWithFilter-shared.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "$filter", + "description": "May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'.", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ScheduledActionListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/providers/Microsoft.CostManagement/scheduledActions/{name}": { + "put": { + "tags": [ + "ScheduledActions" + ], + "operationId": "ScheduledActions_CreateOrUpdate", + "description": "Create or update a private scheduled action.", + "x-ms-examples": { + "CreateOrUpdatePrivateScheduledAction": { + "$ref": "./examples/scheduledActions/scheduledAction-createOrUpdate-private.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scheduledActionNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "scheduledAction", + "description": "Scheduled action to be created or updated.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ScheduledAction" + } + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ScheduledAction" + } + }, + "201": { + "description": "Created.", + "schema": { + "$ref": "#/definitions/ScheduledAction" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "get": { + "tags": [ + "ScheduledActions" + ], + "operationId": "ScheduledActions_Get", + "description": "Get the private scheduled action by name.", + "externalDocs": { + "url": "https://docs.microsoft.com/rest/api/cost-management/" + }, + "x-ms-examples": { + "PrivateScheduledAction": { + "$ref": "./examples/scheduledActions/scheduledAction-get-private.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scheduledActionNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ScheduledAction" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "ScheduledActions" + ], + "operationId": "ScheduledActions_Delete", + "description": "Delete a private scheduled action.", + "externalDocs": { + "url": "https://docs.microsoft.com/rest/api/cost-management/" + }, + "x-ms-examples": { + "PrivateScheduledActionDelete": { + "$ref": "./examples/scheduledActions/scheduledAction-delete-private.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scheduledActionNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded." + }, + "204": { + "description": "NoContent. Resource is not available." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}": { + "put": { + "tags": [ + "ScheduledActions" + ], + "operationId": "ScheduledActions_CreateOrUpdateByScope", + "description": "Create or update a shared scheduled action within the given scope.", + "x-ms-examples": { + "CreateOrUpdateScheduledActionByScope": { + "$ref": "./examples/scheduledActions/scheduledAction-createOrUpdate-shared.json" + }, + "CreateOrUpdateInsightAlertScheduledActionByScope": { + "$ref": "./examples/scheduledActions/scheduledAction-insightAlert-createOrUpdate-shared.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeParameter" + }, + { + "$ref": "#/parameters/scheduledActionNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "scheduledAction", + "description": "Scheduled action to be created or updated.", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ScheduledAction" + } + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ScheduledAction" + } + }, + "201": { + "description": "Created.", + "schema": { + "$ref": "#/definitions/ScheduledAction" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "get": { + "tags": [ + "ScheduledActions" + ], + "operationId": "ScheduledActions_GetByScope", + "description": "Get the shared scheduled action from the given scope by name.", + "externalDocs": { + "url": "https://docs.microsoft.com/rest/api/cost-management/" + }, + "x-ms-examples": { + "ScheduledActionByScope": { + "$ref": "./examples/scheduledActions/scheduledAction-get-shared.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeParameter" + }, + { + "$ref": "#/parameters/scheduledActionNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ScheduledAction" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "ScheduledActions" + ], + "operationId": "ScheduledActions_DeleteByScope", + "description": "Delete a scheduled action within the given scope.", + "externalDocs": { + "url": "https://docs.microsoft.com/rest/api/cost-management/" + }, + "x-ms-examples": { + "ScheduledActionDeleteByScope": { + "$ref": "./examples/scheduledActions/scheduledAction-delete-shared.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeParameter" + }, + { + "$ref": "#/parameters/scheduledActionNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded." + }, + "204": { + "description": "NoContent. Resource is not available." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.CostManagement/scheduledActions/{name}/execute": { + "post": { + "tags": [ + "ScheduledActions" + ], + "operationId": "ScheduledActions_Execute", + "description": "Execute a private scheduled action.", + "x-ms-examples": { + "ScheduledActionExecute": { + "$ref": "./examples/scheduledActions/scheduledAction-execute-private.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scheduledActionNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded. It might take up to an hour to receive the email." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}/execute": { + "post": { + "tags": [ + "ScheduledActions" + ], + "operationId": "ScheduledActions_ExecuteByScope", + "description": "Execute a shared scheduled action within the given scope.", + "x-ms-examples": { + "ScheduledActionExecuteByScope": { + "$ref": "./examples/scheduledActions/scheduledAction-execute-shared.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeParameter" + }, + { + "$ref": "#/parameters/scheduledActionNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded. It might take up to an hour to receive cost analysis information." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.CostManagement/checkNameAvailability": { + "post": { + "tags": [ + "ScheduledActions" + ], + "operationId": "ScheduledActions_CheckNameAvailability", + "description": "Checks availability and correctness of the name for a scheduled action.", + "x-ms-examples": { + "ScheduledActionCheckNameAvailability": { + "$ref": "./examples/scheduledActions/checkNameAvailability-private-scheduledAction.json" + } + }, + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "checkNameAvailabilityRequest", + "description": "Scheduled action to be created or updated.", + "in": "body", + "required": true, + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/CheckNameAvailabilityRequest" + } + } + ], + "responses": { + "200": { + "description": "Response of scheduled action name availability.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/CheckNameAvailabilityResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/{scope}/providers/Microsoft.CostManagement/checkNameAvailability": { + "post": { + "tags": [ + "ScheduledActions" + ], + "operationId": "ScheduledActions_CheckNameAvailabilityByScope", + "description": "Checks availability and correctness of the name for a scheduled action within the given scope.", + "x-ms-examples": { + "ScheduledActionCheckNameAvailabilityByScope": { + "$ref": "./examples/scheduledActions/checkNameAvailability-shared-scheduledAction.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/scopeParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "checkNameAvailabilityRequest", + "description": "Scheduled action to be created or updated.", + "in": "body", + "required": true, + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/CheckNameAvailabilityRequest" + } + } + ], + "responses": { + "200": { + "description": "Response of scheduled action name availability.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/CheckNameAvailabilityResponse" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "DaysOfWeek": { + "type": "string", + "description": "Days of Week.", + "enum": [ + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday" + ], + "x-ms-enum": { + "name": "DaysOfWeek", + "modelAsString": true + } + }, + "ErrorResponse": { + "description": "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. \n\nSome Error responses: \n\n * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the \"x-ms-ratelimit-microsoft.consumption-retry-after\" header. \n\n * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the \"Retry-After\" header.", + "type": "object", + "properties": { + "error": { + "description": "The details of the error.", + "$ref": "#/definitions/ErrorDetails" + } + } + }, + "ErrorDetails": { + "description": "The details of the error.", + "type": "object", + "properties": { + "code": { + "description": "Error code.", + "type": "string", + "readOnly": true + }, + "message": { + "description": "Error message indicating why the operation failed.", + "type": "string", + "readOnly": true + } + } + }, + "FileDestination": { + "type": "object", + "description": "Destination of the view data. This is optional. Currently only CSV format is supported.", + "properties": { + "fileFormats": { + "type": "array", + "description": "Destination of the view data. Currently only CSV format is supported.", + "items": { + "$ref": "#/definitions/FileFormat" + } + } + } + }, + "FileFormat": { + "type": "string", + "description": "Destination of the view data. Currently only CSV format is supported.", + "enum": [ + "Csv" + ], + "x-ms-enum": { + "name": "FileFormat", + "modelAsString": true + } + }, + "Language": { + "type": "string", + "description": "Language in which the email is localized, for ex: 'Fr'. When the specified language is not supported, email will be in english. The supported languages are cs (Czech), da (Danish), de (German), en (English), es (Spanish), fr (French), hu (Hungarian), id (Indonesian), it (Lithuanian), ja (Japanese), ko (Korean), nb (Norwegian Bokmål), nl (Dutch), pl (Polish), pt (Portuguese), ru (Russian), sv (Swedish), tr (Turkish), zh (Chinese) " + }, + "NotificationEmail": { + "type": "string", + "description": "Email address of the point of contact that should get the unsubscribe requests and notification emails." + }, + "NotificationProperties": { + "type": "object", + "description": "The properties of the scheduled action notification.", + "required": [ + "to", + "subject" + ], + "properties": { + "to": { + "description": "Array of email addresses.", + "type": "array", + "items": { + "type": "string", + "pattern": "^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\\.)+[A-Za-z]{2,}$" + }, + "minItems": 1, + "maxItems": 20 + }, + "language": { + "description": "Locale of the email.", + "$ref": "#/definitions/Language" + }, + "message": { + "description": "Optional message to be added in the email. Length is limited to 250 characters.", + "type": "string" + }, + "regionalFormat": { + "description": "Regional format used for formatting date/time and currency values in the email.", + "$ref": "#/definitions/RegionalFormat" + }, + "subject": { + "description": "Subject of the email. Length is limited to 70 characters.", + "type": "string" + } + } + }, + "RegionalFormat": { + "type": "string", + "description": "Language for formatting the date/time and currency values in the email. For ex: 'fr'. Defaulted to English, when the specified regional format is not supported. " + }, + "ScheduledActionProxyResource": { + "description": "The Resource model definition.", + "properties": { + "eTag": { + "type": "string", + "readOnly": true, + "description": "Resource Etag." + }, + "kind": { + "$ref": "#/definitions/ScheduledActionKind", + "description": "Kind of the scheduled action." + } + }, + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource" + } + ], + "type": "object", + "x-ms-azure-resource": true + }, + "ScheduledAction": { + "description": "Scheduled action definition.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ScheduledActionProxyResource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ScheduledActionProperties", + "title": "Scheduled action properties" + } + } + }, + "ScheduledActionKind": { + "type": "string", + "description": "Kind of the scheduled action.", + "enum": [ + "Email", + "InsightAlert" + ], + "x-ms-enum": { + "name": "ScheduledActionKind", + "modelAsString": true, + "values": [ + { + "value": "Email", + "description": "Cost analysis data will be emailed.", + "name": "Email" + }, + { + "value": "InsightAlert", + "description": "Cost anomaly information will be emailed. Available only on subscription scope at daily frequency. If no anomaly is detected on the resource, an email won't be sent.", + "name": "InsightAlert" + } + ] + } + }, + "ScheduledActionListResult": { + "description": "Scheduled actions list result. It contains a list of scheduled actions.", + "type": "object", + "properties": { + "value": { + "description": "The list of scheduled actions.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/ScheduledAction" + } + }, + "nextLink": { + "description": "The link (url) to the next page of results.", + "type": "string", + "readOnly": true + } + } + }, + "ScheduledActionProperties": { + "type": "object", + "description": "The properties of the scheduled action.", + "required": [ + "displayName", + "notification", + "schedule", + "status", + "viewId" + ], + "properties": { + "displayName": { + "description": "Scheduled action name.", + "type": "string" + }, + "fileDestination": { + "description": "Destination format of the view data. This is optional.", + "$ref": "#/definitions/FileDestination" + }, + "notification": { + "description": "Notification properties based on scheduled action kind.", + "$ref": "#/definitions/NotificationProperties" + }, + "notificationEmail": { + "description": "Email address of the point of contact that should get the unsubscribe requests and notification emails.", + "$ref": "#/definitions/NotificationEmail" + }, + "schedule": { + "description": "Schedule of the scheduled action.", + "$ref": "#/definitions/ScheduleProperties" + }, + "scope": { + "description": "Cost Management scope like '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.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope.", + "type": "string" + }, + "status": { + "$ref": "#/definitions/ScheduledActionStatus", + "description": "Status of the scheduled action." + }, + "viewId": { + "description": "Cost analysis viewId used for scheduled action. For example, '/providers/Microsoft.CostManagement/views/swaggerExample'", + "type": "string" + } + } + }, + "ScheduledActionStatus": { + "type": "string", + "description": "Status of the scheduled action.", + "enum": [ + "Enabled", + "Expired", + "Disabled" + ], + "x-ms-enum": { + "name": "ScheduledActionStatus", + "modelAsString": true, + "values": [ + { + "value": "Disabled", + "description": "Scheduled action is saved but will not be executed.", + "name": "Disabled" + }, + { + "value": "Enabled", + "description": "Scheduled action is saved and will be executed.", + "name": "Enabled" + }, + { + "value": "Expired", + "description": "Scheduled action is expired.", + "name": "Expired" + } + ] + } + }, + "ScheduleFrequency": { + "type": "string", + "description": "Frequency of the schedule.", + "enum": [ + "Daily", + "Weekly", + "Monthly" + ], + "x-ms-enum": { + "name": "ScheduleFrequency", + "modelAsString": true, + "values": [ + { + "value": "Daily", + "description": "Cost analysis data will be emailed every day.", + "name": "Daily" + }, + { + "value": "Weekly", + "description": "Cost analysis data will be emailed every week.", + "name": "Weekly" + }, + { + "value": "Monthly", + "description": "Cost analysis data will be emailed every month.", + "name": "Monthly" + } + ] + } + }, + "ScheduleProperties": { + "type": "object", + "description": "The properties of the schedule.", + "required": [ + "endDate", + "frequency", + "startDate" + ], + "properties": { + "frequency": { + "$ref": "#/definitions/ScheduleFrequency", + "description": "Frequency of the schedule." + }, + "hourOfDay": { + "type": "integer", + "description": "UTC time at which cost analysis data will be emailed.", + "format": "int32" + }, + "daysOfWeek": { + "description": "Day names in english on which cost analysis data will be emailed. This property is applicable when frequency is Weekly or Monthly.", + "type": "array", + "items": { + "$ref": "#/definitions/DaysOfWeek" + } + }, + "weeksOfMonth": { + "description": "Weeks in which cost analysis data will be emailed. This property is applicable when frequency is Monthly and used in combination with daysOfWeek.", + "type": "array", + "items": { + "$ref": "#/definitions/WeeksOfMonth" + } + }, + "dayOfMonth": { + "type": "integer", + "description": "UTC day on which cost analysis data will be emailed. Must be between 1 and 31. This property is applicable when frequency is Monthly and overrides weeksOfMonth or daysOfWeek.", + "format": "int32" + }, + "startDate": { + "description": "The start date and time of the scheduled action (UTC).", + "type": "string", + "format": "date-time" + }, + "endDate": { + "description": "The end date and time of the scheduled action (UTC).", + "type": "string", + "format": "date-time" + } + } + }, + "WeeksOfMonth": { + "type": "string", + "description": "Weeks of month.", + "enum": [ + "First", + "Second", + "Third", + "Fourth", + "Last" + ], + "x-ms-enum": { + "name": "WeeksOfMonth", + "modelAsString": true + } + } + }, + "parameters": { + "scopeParameter": { + "name": "scope", + "in": "path", + "required": true, + "type": "string", + "description": "The scope associated with scheduled action 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.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. Note: Insight Alerts are only available on subscription scope.", + "x-ms-parameter-location": "method" + }, + "scheduledActionNameParameter": { + "name": "name", + "in": "path", + "description": "Scheduled action name.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/cost-management/resource-manager/readme.md b/specification/cost-management/resource-manager/readme.md index 24878a10b326..7790288c0f59 100644 --- a/specification/cost-management/resource-manager/readme.md +++ b/specification/cost-management/resource-manager/readme.md @@ -44,8 +44,8 @@ input-file: - Microsoft.CostManagement/stable/2022-10-01/costmanagement.generatecostdetailsreport.json - Microsoft.CostManagement/stable/2022-10-01/costmanagement.generatedetailedcostreport.json - Microsoft.CostManagement/stable/2022-10-01/costmanagement.pricesheets.json - - Microsoft.CostManagement/stable/2022-10-01/scheduledActions.json - Microsoft.CostManagement/stable/2022-10-01/costmanagement.benefits.json + - Microsoft.CostManagement/stable/2022-10-01/scheduledActions.json ``` ### Tag: package-preview-2022-10-05