Skip to content

Commit

Permalink
Upgrading Scheduled Actions API to GA (Azure#20964)
Browse files Browse the repository at this point in the history
* Upgrading Scheduled Actions API to GA

* First commit:- upgrading existing API to GA version

* Upgraded api-version

* Adding Operations API in common-types

* upgrading api-version in Operations example

* referencing common operation def

* removing reference to common Operation as it caused multiple validation
errors

* renaming Operation to CostManagementOperation and referencing Operation from V3 types

* fixing csv
  • Loading branch information
sri- authored and pednekarpraj committed Nov 1, 2022
1 parent 8d7bc83 commit 908adee
Show file tree
Hide file tree
Showing 20 changed files with 2,052 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -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.",
Expand Down Expand Up @@ -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."
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
@@ -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."
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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."
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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
}
}
}
}
Loading

0 comments on commit 908adee

Please sign in to comment.