diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/costmanagement.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/costmanagement.json new file mode 100644 index 000000000000..580ce3027bb2 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/costmanagement.json @@ -0,0 +1,1917 @@ +{ + "swagger": "2.0", + "info": { + "version": "2018-09-01-preview", + "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": { + "/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/reportconfigs": { + "get": { + "tags": [ + "Reports" + ], + "operationId": "ReportConfig_List", + "description": "Lists all report configs for a subscription.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ReportConfigList": { + "$ref": "./examples/ReportConfigList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ReportConfigListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/reportconfigs": { + "get": { + "tags": [ + "Reports" + ], + "operationId": "ReportConfig_ListByResourceGroupName", + "description": "Lists all report configs for a resource group under a subscription.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ReportConfigList": { + "$ref": "./examples/ReportConfigList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ReportConfigListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}": { + "get": { + "tags": [ + "Reports" + ], + "operationId": "ReportConfig_Get", + "description": "Gets the report config for a subscription by report config name.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "Report": { + "$ref": "./examples/ReportConfig.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/reportConfigNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ReportConfig" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "Reports" + ], + "operationId": "ReportConfig_CreateOrUpdate", + "description": "The operation to create or update a report config. Update operation requires latest eTag to be set in the request mandatorily. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "CreateOrUpdateReport": { + "$ref": "./examples/ReportConfigCreateOrUpdate.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/reportConfigNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReportConfig" + }, + "description": "Parameters supplied to the CreateOrUpdate Report Config operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ReportConfig" + } + }, + "201": { + "description": "Created.", + "schema": { + "$ref": "#/definitions/ReportConfig" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "Reports" + ], + "operationId": "ReportConfig_Delete", + "description": "The operation to delete a report.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "DeleteReport": { + "$ref": "./examples/ReportConfigDelete.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/reportConfigNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}": { + "get": { + "tags": [ + "Reports" + ], + "operationId": "ReportConfig_GetByResourceGroupName", + "description": "Gets the report config for a resource group under a subscription by report config name.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ReportConfig": { + "$ref": "./examples/ReportConfig.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/reportConfigNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ReportConfig" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "Reports" + ], + "operationId": "ReportConfig_CreateOrUpdateByResourceGroupName", + "description": "The operation to create or update a report config. Update operation requires latest eTag to be set in the request mandatorily. You may obtain the latest eTag by performing a get operation. Create operation does not require eTag.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "CreateOrUpdateReport": { + "$ref": "./examples/ReportConfigCreateOrUpdate.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/reportConfigNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReportConfig" + }, + "description": "Parameters supplied to the CreateOrUpdate Report Config operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ReportConfig" + } + }, + "201": { + "description": "Created.", + "schema": { + "$ref": "#/definitions/ReportConfig" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "Reports" + ], + "operationId": "ReportConfig_DeleteByResourceGroupName", + "description": "The operation to delete a report config.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "DeleteReport": { + "$ref": "./examples/ReportConfigDelete.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/reportConfigNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/dimensions": { + "get": { + "tags": [ + "Dimensions" + ], + "x-ms-odata": "#/definitions/Dimension", + "operationId": "BillingAccountDimensions_List", + "description": "Lists the dimensions by billingAccount Id.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "BillingAccountDimensionsList": { + "$ref": "./examples/BillingAccountDimensionsList.json" + }, + "BillingAccountDimensionsListExpandAndTop": { + "$ref": "./examples/BillingAccountDimensionsListExpandAndTop.json" + }, + "BillingAccountDimensionsListWithFilter": { + "$ref": "./examples/BillingAccountDimensionsListWithFilter.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountIdParameter" + }, + { + "name": "$filter", + "description": "May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$expand", + "description": "May be used to expand the properties/data within a dimension dategory. By default, data is not included when listing dimensions.", + "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 dimension data.", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/DimensionsListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/dimensions": { + "get": { + "tags": [ + "Dimensions" + ], + "x-ms-odata": "#/definitions/Dimension", + "operationId": "SubscriptionDimensions_List", + "description": "Lists the dimensions by subscription Id.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "SubscriptionDimensionsList": { + "$ref": "./examples/SubscriptionDimensionsList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "name": "$filter", + "description": "May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$expand", + "description": "May be used to expand the properties/data within a dimension dategory. By default, data is not included when listing dimensions.", + "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 dimension data.", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/DimensionsListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/dimensions": { + "get": { + "tags": [ + "Dimensions" + ], + "x-ms-odata": "#/definitions/Dimension", + "operationId": "ResourceGroupDimensions_List", + "description": "Lists the dimensions by resource group Id.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ResourceGroupDimensionsList": { + "$ref": "./examples/ResourceGroupDimensionsList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "name": "$filter", + "description": "May be used to filter dimensions by properties/category, properties/usageStart, properties/usageEnd. Supported operators are 'eq','lt', 'gt', 'le', 'ge'.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "$expand", + "description": "May be used to expand the properties/data within a dimension dategory. By default, data is not included when listing dimensions.", + "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 dimension data.", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "maximum": 1000 + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/DimensionsListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/Query": { + "post": { + "tags": [ + "Query" + ], + "operationId": "QuerySubscription", + "description": "Lists the usage data for subscriptionId.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "SubscriptionQuery": { + "$ref": "./examples/SubscriptionQuery.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReportConfigDefinition" + }, + "description": "Parameters supplied to the CreateOrUpdate Report Config operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/QueryResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.CostManagement/Query": { + "post": { + "tags": [ + "Query" + ], + "operationId": "QueryResourceGroup", + "description": "Lists the usage data for subscriptionId and resource group.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "ResourceGroupQuery": { + "$ref": "./examples/ResourceGroupQuery.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReportConfigDefinition" + }, + "description": "Parameters supplied to the CreateOrUpdate Report Config operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/QueryResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/Query": { + "post": { + "tags": [ + "Query" + ], + "operationId": "QueryBillingAccount", + "description": "Lists the usage data for billing account.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "BillingAccountQuery": { + "$ref": "./examples/BillingAccountQuery.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/billingAccountIdParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ReportConfigDefinition" + }, + "description": "Parameters supplied to the CreateOrUpdate Report Config operation." + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/QueryResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/connectors": { + "get": { + "tags": [ + "Connectors" + ], + "operationId": "Connector_List", + "description": "List all connector definitions for a subscription", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "Connector_List": { + "$ref": "./examples/ConnectorList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ConnectorDefinitionListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.CostManagement/connectors": { + "get": { + "tags": [ + "Connectors" + ], + "operationId": "Connector_ListByResourceGroupName", + "description": "List all connector definitions for a resource group under a subscription.", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "Connector_List": { + "$ref": "./examples/ConnectorList.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ConnectorDefinitionListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.CostManagement/connectors/{connectorName}": { + "get": { + "tags": [ + "Connectors" + ], + "operationId": "Connector_Get", + "description": "Get a connector definition", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "Connector_Get": { + "$ref": "./examples/ConnectorGet.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/connectorNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ConnectorDefinition" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "put": { + "tags": [ + "Connectors" + ], + "operationId": "Connector_CreateOrUpdate", + "description": "Create or update a connector definition", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "Connector_Put": { + "$ref": "./examples/ConnectorPut.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/connectorNameParameter" + }, + { + "name": "connector", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ConnectorDefinition" + }, + "description": "Connector details" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ConnectorDefinition" + } + }, + "201": { + "description": "Created.", + "schema": { + "$ref": "#/definitions/ConnectorDefinition" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "delete": { + "tags": [ + "Connectors" + ], + "operationId": "Connector_Delete", + "description": "Delete a connector definition", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "Connector_Delete": { + "$ref": "./examples/ConnectorDelete.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/connectorNameParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + }, + "patch": { + "tags": [ + "Connectors" + ], + "operationId": "Connector_Update", + "description": "Update a connector definition", + "externalDocs": { + "url": "https://docs.microsoft.com/en-us/rest/api/costmanagement/" + }, + "x-ms-examples": { + "Connector_Patch": { + "$ref": "./examples/ConnectorPatch.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/connectorNameParameter" + }, + { + "name": "connector", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ConnectorDefinition" + }, + "description": "Connector details" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/ConnectorDefinition" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "ErrorBase": { + "description": "The details of the error.", + "properties": { + "code": { + "type": "string", + "description": "A machine readable error code.", + "readOnly": true + }, + "message": { + "type": "string", + "description": "A human readable error message.", + "readOnly": true + }, + "target": { + "type": "string", + "description": "Indicates which property in the request is responsible for the error.", + "readOnly": true + } + } + }, + "ErrorDetails": { + "description": "The details of the error.", + "properties": { + "code": { + "description": "A machine readable error code.", + "type": "string", + "readOnly": true + }, + "message": { + "description": "A human readable error message.", + "type": "string", + "readOnly": true + }, + "target": { + "description": "Indicates which property in the request is responsible for the error.", + "type": "string" + }, + "details": { + "description": "error details.", + "type": "array", + "items": { + "$ref": "#/definitions/ErrorBase" + } + } + } + }, + "ErrorResponse": { + "description": "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.", + "type": "object", + "properties": { + "error": { + "description": "The details of the error.", + "$ref": "#/definitions/ErrorDetails" + } + } + }, + "Resource": { + "description": "The Resource model definition.", + "properties": { + "id": { + "readOnly": true, + "type": "string", + "description": "Resource Id." + }, + "name": { + "readOnly": true, + "type": "string", + "description": "Resource name." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Resource type." + }, + "tags": { + "readOnly": true, + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags." + } + }, + "x-ms-azure-resource": true + }, + "ReportConfigListResult": { + "description": "Result of listing report configs. It contains a list of available report configurations in the scope provided.", + "properties": { + "value": { + "description": "The list of report configs.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/ReportConfig" + } + } + } + }, + "ReportConfig": { + "description": "A report config resource.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ReportConfigProperties", + "title": "Report config properties" + } + } + }, + "ReportConfigProperties": { + "description": "The properties of the report config.", + "properties": { + "schedule": { + "description": "Has schedule information for the report config.", + "$ref": "#/definitions/ReportConfigSchedule" + }, + "format": { + "description": "The format of the report being delivered.", + "type": "string", + "enum": [ + "Csv" + ], + "x-ms-enum": { + "name": "FormatType", + "modelAsString": true + } + }, + "deliveryInfo": { + "description": "Has delivery information for the report config.", + "$ref": "#/definitions/ReportConfigDeliveryInfo" + }, + "definition": { + "description": "Has definition for the report config.", + "$ref": "#/definitions/ReportConfigDefinition" + } + }, + "required": [ + "deliveryInfo", + "definition" + ] + }, + "ReportConfigSchedule": { + "description": "The schedule associated with a report config.", + "properties": { + "status": { + "description": "The status of the schedule. Whether active or not. If inactive, the report's scheduled execution is paused.", + "type": "string", + "enum": [ + "Active", + "Inactive" + ], + "x-ms-enum": { + "name": "StatusType", + "modelAsString": true + } + }, + "recurrence": { + "description": "The schedule recurrence.", + "type": "string", + "enum": [ + "Daily", + "Weekly", + "Monthly", + "Annually" + ], + "x-ms-enum": { + "name": "RecurrenceType", + "modelAsString": true + } + }, + "recurrencePeriod": { + "description": "Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date.", + "$ref": "#/definitions/ReportConfigRecurrencePeriod" + } + }, + "required": [ + "recurrence", + "recurrencePeriod" + ] + }, + "ReportConfigDeliveryInfo": { + "description": "The delivery information associated with a report config.", + "properties": { + "destination": { + "description": "Has destination for the report being delivered.", + "$ref": "#/definitions/ReportConfigDeliveryDestination" + } + }, + "required": [ + "destination" + ] + }, + "ReportConfigDefinition": { + "description": "The definition of a report config.", + "properties": { + "type": { + "description": "The type of the report.", + "type": "string", + "enum": [ + "Usage" + ], + "x-ms-enum": { + "name": "ReportType", + "modelAsString": true + } + }, + "timeframe": { + "description": "The time frame for pulling data for the report. If custom, then a specific time period must be provided.", + "type": "string", + "enum": [ + "WeekToDate", + "MonthToDate", + "YearToDate", + "Custom" + ], + "x-ms-enum": { + "name": "TimeframeType", + "modelAsString": true + } + }, + "timePeriod": { + "description": "Has time period for pulling data for the report.", + "$ref": "#/definitions/ReportConfigTimePeriod" + }, + "dataset": { + "description": "Has definition for data in this report config.", + "$ref": "#/definitions/ReportConfigDataset" + } + }, + "required": [ + "type", + "timeframe" + ] + }, + "ReportConfigRecurrencePeriod": { + "description": "The start and end date for recurrence schedule.", + "properties": { + "from": { + "description": "The start date of recurrence.", + "type": "string", + "format": "date-time" + }, + "to": { + "description": "The end date of recurrence. If not provided, we default this to 10 years from the start date.", + "type": "string", + "format": "date-time" + } + }, + "required": [ + "from" + ] + }, + "ReportConfigDeliveryDestination": { + "description": "The destination information for the delivery of the report.", + "properties": { + "resourceId": { + "description": "The resource id of the storage account where reports will be delivered.", + "type": "string" + }, + "container": { + "description": "The name of the container where reports will be uploaded.", + "type": "string" + }, + "rootFolderPath": { + "description": "The name of the directory where reports will be uploaded.", + "type": "string" + } + }, + "required": [ + "resourceId", + "container" + ] + }, + "ReportConfigTimePeriod": { + "description": "The start and end date for pulling data for the report.", + "properties": { + "from": { + "description": "The start date to pull data from.", + "type": "string", + "format": "date-time" + }, + "to": { + "description": "The end date to pull data to.", + "type": "string", + "format": "date-time" + } + }, + "required": [ + "from", + "to" + ] + }, + "ReportConfigDataset": { + "description": "The definition of data present in the report.", + "properties": { + "granularity": { + "description": "The granularity of rows in the report.", + "type": "string", + "enum": [ + "Daily" + ], + "x-ms-enum": { + "name": "GranularityType", + "modelAsString": true + } + }, + "configuration": { + "description": "Has configuration information for the data in the report. The configuration will be ignored if aggregation and grouping are provided.", + "$ref": "#/definitions/ReportConfigDatasetConfiguration" + }, + "aggregation": { + "type": "object", + "description": "Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the aggregated column. Report can have upto 2 aggregation clauses.", + "additionalProperties": { + "type": "object", + "$ref": "#/definitions/ReportConfigAggregation" + }, + "maxItems": 2 + }, + "grouping": { + "description": "Array of group by expression to use in the report. Report can have upto 2 group by clauses.", + "type": "array", + "items": { + "$ref": "#/definitions/ReportConfigGrouping" + }, + "maxItems": 2 + }, + "filter": { + "type": "object", + "description": "Has filter expression to use in the report.", + "$ref": "#/definitions/ReportConfigFilter" + } + } + }, + "ReportConfigDatasetConfiguration": { + "description": "The configuration of dataset in the report.", + "properties": { + "columns": { + "description": "Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report includes all columns.", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "ReportConfigAggregation": { + "description": "The aggregation expression to be used in the report.", + "properties": { + "name": { + "description": "The name of the column to aggregate.", + "type": "string" + }, + "function": { + "description": "The name of the aggregation function to use.", + "type": "string", + "enum": [ + "Sum" + ], + "x-ms-enum": { + "name": "FunctionType", + "modelAsString": true + } + } + }, + "required": [ + "name", + "function" + ] + }, + "ReportConfigGrouping": { + "description": "The group by expression to be used in the report.", + "properties": { + "columnType": { + "description": "Has type of the column to group.", + "$ref": "#/definitions/ReportConfigColumnType" + }, + "name": { + "description": "The name of the column to group.", + "type": "string" + } + }, + "required": [ + "columnType", + "name" + ] + }, + "ReportConfigFilter": { + "description": "The filter expression to be used in the report.", + "properties": { + "and": { + "description": "The logical \"AND\" expression. Must have atleast 2 items.", + "type": "array", + "items": { + "$ref": "#/definitions/ReportConfigFilter" + }, + "minItems": 2 + }, + "or": { + "description": "The logical \"OR\" expression. Must have atleast 2 items.", + "type": "array", + "items": { + "$ref": "#/definitions/ReportConfigFilter" + }, + "minItems": 2 + }, + "not": { + "description": "The logical \"NOT\" expression.", + "$ref": "#/definitions/ReportConfigFilter" + }, + "dimension": { + "description": "Has comparison expression for a dimension", + "$ref": "#/definitions/ReportConfigComparisonExpression" + }, + "tag": { + "description": "Has comparison expression for a tag", + "$ref": "#/definitions/ReportConfigComparisonExpression" + } + } + }, + "ReportConfigColumnType": { + "description": "The type of the column in the report.", + "type": "string", + "enum": [ + "Tag", + "Dimension" + ], + "x-ms-enum": { + "name": "ReportConfigColumnType", + "modelAsString": true + } + }, + "ReportConfigComparisonExpression": { + "description": "The comparison expression to be used in the report.", + "properties": { + "name": { + "description": "The name of the column to use in comaprison.", + "type": "string" + }, + "operator": { + "description": "The operator to use for comparison.", + "type": "string", + "enum": [ + "In" + ], + "x-ms-enum": { + "name": "OperatorType", + "modelAsString": true + } + }, + "values": { + "description": "Array of values to use for comparison", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + }, + "required": [ + "name", + "operator", + "values" + ] + }, + "DimensionsListResult": { + "description": "Result of listing dimensions. It contains a list of available dimensions.", + "type": "object", + "properties": { + "value": { + "description": "The list of dimensions.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/Dimension" + } + } + } + }, + "Dimension": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/DimensionProperties", + "title": "Dimension properties" + } + } + }, + "DimensionProperties": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "string" + } + }, + "total": { + "format": "int32", + "type": "integer" + }, + "category": { + "type": "string" + }, + "usageStart": { + "format": "date-time", + "type": "string" + }, + "usageEnd": { + "format": "date-time", + "type": "string" + }, + "nextLink": { + "type": "string" + } + } + }, + "QueryResult": { + "description": "Result of query. It contains all columns listed under groupings and aggregation.", + "type": "object", + "properties": { + "value": { + "description": "The list of usage data.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/Query" + } + } + } + }, + "Query": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/QueryProperties", + "title": "Query properties" + } + } + }, + "QueryProperties": { + "type": "object", + "properties": { + "nextLink": { + "type": "string" + }, + "columns": { + "description": "Array of columns", + "type": "array", + "items": { + "$ref": "#/definitions/QueryColumn" + } + }, + "rows": { + "type": "array", + "items": { + "type": "array", + "items": {} + } + } + } + }, + "QueryColumn": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "ConnectorDefinitionListResult": { + "description": "Result of listing connector definitions. It contains a list of available connector definitions in the scope provided.", + "properties": { + "value": { + "description": "The list of connector definitions.", + "type": "array", + "readOnly": true, + "items": { + "$ref": "#/definitions/ConnectorDefinition" + } + } + } + }, + "ConnectorDefinition": { + "type": "object", + "description": "The Connector model definition", + "properties": { + "kind": { + "type": "string", + "description": "Connector kind (eg aws)" + }, + "id": { + "type": "string", + "readOnly": true, + "description": "Connector id" + }, + "name": { + "type": "string", + "readOnly": true, + "description": "Connector name" + }, + "type": { + "type": "string", + "readOnly": true, + "description": "Connector type" + }, + "location": { + "type": "string", + "x-ms-mutability": [ + "read", + "create" + ], + "description": "Connector location" + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-ms-mutability": [ + "read", + "create", + "update" + ], + "description": "Resource tags." + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ConnectorProperties", + "description": "Connector properties" + } + }, + "x-ms-azure-resource": true + }, + "ConnectorProperties": { + "type": "object", + "description": "The properties of a Connector", + "properties": { + "displayName": { + "type": "string", + "x-ms-mutability": [ + "read", + "create", + "update" + ], + "description": "Connector DisplayName (defaults to Name)" + }, + "providerAccountId": { + "type": "string", + "x-ms-mutability": [ + "read" + ], + "description": "Connector providerAccountId (determined from credentials)", + "readOnly": true + }, + "credentialsKey": { + "type": "string", + "x-ms-mutability": [ + "read", + "create", + "update" + ], + "description": "Credentials authentication key (eg AWS ARN)" + }, + "credentialsSecret": { + "type": "string", + "x-ms-mutability": [ + "create", + "update" + ], + "description": "Credentials secret (eg AWS ExternalId)" + }, + "reportId": { + "type": "string", + "x-ms-mutability": [ + "read", + "create", + "update" + ], + "description": "Identifying source report. (For AWS this is a CUR report name, defined with Daily and with Resources)" + }, + "createdOn": { + "format": "date-time", + "type": "string", + "x-ms-mutability": [ + "read" + ], + "description": "Connector definition creation datetime", + "readOnly": true + }, + "modifiedOn": { + "format": "date-time", + "type": "string", + "x-ms-mutability": [ + "read" + ], + "description": "Connector last modified datetime", + "readOnly": true + }, + "status": { + "enum": [ + "active", + "error", + "suspended" + ], + "x-ms-enum": { + "name": "ConnectorStatus", + "modelAsString": true + }, + "type": "string", + "x-ms-mutability": [ + "read", + "create", + "update" + ], + "description": "Connector status" + }, + "collection": { + "$ref": "#/definitions/ConnectorCollectionInfo", + "x-ms-mutability": [ + "read" + ], + "description": "Collection information", + "readOnly": true + } + } + }, + "ConnectorCollectionInfo": { + "type": "object", + "description": "Collection and ingestion information", + "properties": { + "lastRun": { + "format": "date-time", + "type": "string", + "x-ms-mutability": [ + "read" + ], + "description": "Last time the data acquisition process completed (even if no new data was found)", + "readOnly": true + }, + "sourceLastUpdated": { + "format": "date-time", + "type": "string", + "x-ms-mutability": [ + "read" + ], + "description": "Source timestamp of external data currently available in Azure (eg AWS last processed CUR file timestamp)", + "readOnly": true + }, + "lastUpdated": { + "format": "date-time", + "type": "string", + "x-ms-mutability": [ + "read" + ], + "description": "Last time the external data was updated into Azure", + "readOnly": true + }, + "error": { + "$ref": "#/definitions/ConnectorCollectionErrorInfo", + "description": "Error information of last collection" + } + } + }, + "ConnectorCollectionErrorInfo": { + "type": "object", + "description": "Details of any error encountered on last collection attempt", + "properties": { + "errorMessage": { + "type": "string", + "description": "Detailed error message", + "readOnly": true + }, + "errorCode": { + "type": "string", + "description": "Short error message", + "readOnly": true + }, + "errorStartTime": { + "format": "date-time", + "type": "string", + "description": "Time the error started occuring (Last time error occurred in lastRun)", + "readOnly": true + } + } + } + }, + "parameters": { + "apiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Version of the API to be used with the client request. The current version is 2018-09-01-preview." + }, + "subscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "description": "Azure Subscription ID.", + "required": true, + "type": "string" + }, + "resourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "description": "Azure Resource Group Name.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "billingAccountIdParameter": { + "name": "billingAccountId", + "in": "path", + "description": "BillingAccount ID", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "reportConfigNameParameter": { + "name": "reportConfigName", + "in": "path", + "description": "Report Config Name.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "connectorNameParameter": { + "name": "connectorName", + "in": "path", + "description": "Connector Name.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + } + } +} \ No newline at end of file diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/BillingAccountDimensionsList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/BillingAccountDimensionsList.json new file mode 100644 index 000000000000..bdc21dab404d --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/BillingAccountDimensionsList.json @@ -0,0 +1,38 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "billingAccountId": "100" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.Billing/billingAccounts/100/providers/microsoft.consumption/dimensions_ResourceGroup_2018-05-01_2018-05-31", + "name": "dimensions_ResourceGroup_2018-05-01_2018-05-31", + "type": "microsoft.consumption/dimensions", + "properties": { + "data": [], + "total": 377, + "category": "ResourceGroup", + "usageStart": "2018-05-01T00:00:00-07:00", + "usageEnd": "2018-05-31T00:00:00-07:00" + } + }, + { + "id": "providers/Microsoft.Billing/billingAccounts/100/providers/microsoft.consumption/dimensions_ResourceType_2018-05-01_2018-05-31", + "name": "dimensions_ResourceType_2018-05-01_2018-05-31", + "type": "microsoft.consumption/dimensions", + "properties": { + "data": [], + "total": 37, + "category": "ResourceType", + "usageStart": "2018-05-01T00:00:00-07:00", + "usageEnd": "2018-05-31T00:00:00-07:00" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/BillingAccountDimensionsListExpandAndTop.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/BillingAccountDimensionsListExpandAndTop.json new file mode 100644 index 000000000000..6f1c56819711 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/BillingAccountDimensionsListExpandAndTop.json @@ -0,0 +1,52 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "billingAccountId": "100", + "$expand": "properties/data", + "$top": "5" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.Billing/billingAccounts/100/providers/microsoft.consumption/dimensions_ResourceGroup_2018-05-01_2018-05-31_5", + "name": "dimensions_ResourceGroup_2018-05-01_2018-05-31_5", + "type": "microsoft.consumption/dimensions", + "properties": { + "data": [ + "thoroetrg01", + "default-notificationhubs-westus", + "jedikeyvaultrg", + "contosocodeflow8d4a", + "noobaa" + ], + "total": 377, + "category": "ResourceGroup", + "usageStart": "2018-05-01T00:00:00-07:00", + "usageEnd": "2018-05-31T00:00:00-07:00" + } + }, + { + "id": "providers/Microsoft.Billing/billingAccounts/100/providers/microsoft.consumption/dimensions_ResourceType_2018-05-01_2018-05-31_5", + "name": "dimensions_ResourceType_2018-05-01_2018-05-31_5", + "type": "microsoft.consumption/dimensions", + "properties": { + "data": [ + "microsoft.automation/automationaccounts", + "microsoft.databricks/workspaces", + "microsoft.dbformysql/servers", + "microsoft.containerregistry/registries", + "microsoft.search/searchservices" + ], + "total": 37, + "category": "ResourceType", + "usageStart": "2018-05-01T00:00:00-07:00", + "usageEnd": "2018-05-31T00:00:00-07:00" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/BillingAccountDimensionsListWithFilter.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/BillingAccountDimensionsListWithFilter.json new file mode 100644 index 000000000000..15dc7cbd7cdd --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/BillingAccountDimensionsListWithFilter.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "billingAccountId": "100", + "$expand": "properties/data", + "$top": "5", + "$filter": "properties/category eq 'instanceId'" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.Billing/billingAccounts/100/providers/microsoft.consumption/dimensions_InstanceId_2018-05-01_2018-05-31_5", + "name": "dimensions_InstanceId_2018-05-01_2018-05-31_5", + "type": "microsoft.consumption/dimensions", + "properties": { + "data": [ + "/subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/urphealthaccount", + "/subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/srphytenaccount", + "/subscriptions/67e24f6b-1ec2-4c90-993a-dc2d25b00b6c/resourcegroups/defaultresourcegroup-eus/providers/microsoft.operationalinsights/workspaces/defaultworkspace-67e24f6b-1ec2-4c90-993a-dc2d25b00b6c-eus", + "/subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourcegroups/rg-sql-ha/providers/microsoft.compute/virtualmachines/sql-4qqp1", + "/subscriptions/a98d6dc5-eb8f-46cf-8938-f1fb08f03706/resourcegroups/databricks-rg-testwsp-xijmsdubneexm/providers/microsoft.compute/disks/488cdb42bf74474a98075415be3f806c-containerrootvolume" + ], + "total": 1409, + "category": "InstanceId", + "usageStart": "2018-05-01T00:00:00-07:00", + "usageEnd": "2018-05-31T00:00:00-07:00", + "nextLink": "http://management.azure.com/ccmapi/providers/Microsoft.Billing/billingAccounts/100/providers/Microsoft.Consumption/Dimensions?$filter=properties/category eq 'instanceId'&$top=5&api-version=2018-05-31&$expand=properties/data&$skiptoken=AQAAAA%3D%3D" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/BillingAccountQuery.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/BillingAccountQuery.json new file mode 100644 index 000000000000..4154d86a66f3 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/BillingAccountQuery.json @@ -0,0 +1,109 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "billingAccountId": "70664866", + "parameters":{ + "type": "Usage", + "timeframe": "MonthToDate", + "dataset": { + "granularity": "Daily", + "configuration": { + "columns": [ + "PreTaxCost", + "ResourceGroup", + "UsageDate" + ] + }, + "filter":{ + "and": [ + { + "or":[ + { + "dimension": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tag": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimension": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] + } + } + } + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "providers/Microsoft.Billing/billingAccounts/70664866/providers/Microsoft.CostManagement/Query/ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd", + "type": "microsoft.costmanagement/Query", + "properties": { + "nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/70664866/providers/Microsoft.CostManagement/Query?api-version=2018-05-31&$skiptoken=AQAAAA%3D%3D", + "columns": [ + { + "name": "PreTaxCost", + "type": "Number" + }, + { + "name": "ResourceGroup", + "type": "String" + }, + { + "name": "UsageDate", + "type": "Number" + } + ], + "rows": [ + [ + 19.545363672276512, + "JapanUnifia-Trial", + 20180331 + ], + [ + 173.41979241290323, + "RVIIOT-TRIAL", + 20180331 + ], + [ + 20.359416562625452, + "VSTSHOL-1595322048000", + 20180331 + ], + [ + 0.16677720329728665, + "gs-stms-dev", + 20180331 + ] + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ConnectorDelete.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ConnectorDelete.json new file mode 100644 index 000000000000..8d381aa07c40 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ConnectorDelete.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "subscriptionId": "01234567-89ab-cdef-0123-456789abcdef", + "resourceGroupName": "rg1", + "connectorName": "AWSBillingAccount" + }, + "responses": { + "200": { + } + } +} + diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ConnectorGet.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ConnectorGet.json new file mode 100644 index 000000000000..219243ad9370 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ConnectorGet.json @@ -0,0 +1,38 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "subscriptionId": "01234567-89ab-cdef-0123-456789abcdef", + "resourceGroupName": "rg1", + "connectorName": "AWSBillingAccount" + }, + "responses": { + "200": { + "body": { + "kind": "aws", + "id": "/subscriptions/01234567-89ab-cdef-0123-456789abcdef/resourceGroups/rg1/providers/Microsoft.CostManagement/connectors/AWSBillingAccount", + "name": "AWSBillingAccount", + "type": "Microsoft.CostManagement/connectors", + "location": "westus", + "properties": { + "displayName": "AWS-Consolidated-1", + "credentialsKey": "arn:aws:iam::123456789012:role/AzureCostManagementRole", + "reportId": "HourlyWithResources", + "createdOn": "2018-05-15T13:25:48Z", + "modifiedOn": "2018-05-23T09:21:11Z", + "status": "active", + "collection": { + "lastRun": "2018-06-15T03:21:08Z", + "sourceLastUpdated": "2018-06-12T16:41:28Z", + "lastUpdated": "2018-06-12T17:25:28Z", + "error": { + "errorMessage": "Insufficient access to assume role arn:aws:iam::123456789012:role/AzureCostManagementRole", + "errorCode": "AwsPermissionDenied", + "errorStartTime": "2018-06-12T21:41:03Z" + } + } + } + } + } + } +} + diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ConnectorList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ConnectorList.json new file mode 100644 index 000000000000..5a9562a464f6 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ConnectorList.json @@ -0,0 +1,45 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "subscriptionId": "01234567-89ab-cdef-0123-456789abcdef", + "resourceGroupName": "rg1" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "kind": "aws", + "id": "/subscriptions/01234567-89ab-cdef-0123-456789abcdef/resourceGroups/rg1/providers/Microsoft.CostManagement/connectors/AWSBillingAccount", + "name": "AWSBillingAccount", + "type": "Microsoft.CostManagement/connectors", + "location": "westus", + "properties": { + "displayName": "AWS-Consolidated-1", + "credentialsKey": "arn:aws:iam::123456789012:role/AzureCostManagementRole", + "reportId": "HourlyWithResources", + "createdOn": "2018-05-15T13:25:48Z", + "modifiedOn": "2018-05-23T09:21:11Z", + "status": "active" + } + }, + { + "kind": "aws", + "id": "/subscriptions/01234567-89ab-cdef-0123-456789abcdef/resourceGroups/rg1/providers/Microsoft.CostManagement/connectors/AWSBillingAccount2", + "name": "AWSBillingAccount2", + "type": "Microsoft.CostManagement/connectors", + "location": "westus", + "properties": { + "displayName": "AWSBillingAccount2", + "credentialsKey": "arn:aws:iam::000000000000:role/AzureCostManagementRole", + "reportId": "CURHourlyWithResources", + "createdOn": "2018-06-16T11:23:44Z", + "modifiedOn": "2018-06-21T17:33:28Z", + "status": "suspended" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ConnectorPatch.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ConnectorPatch.json new file mode 100644 index 000000000000..ddd006675a27 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ConnectorPatch.json @@ -0,0 +1,33 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "subscriptionId": "01234567-89ab-cdef-0123-456789abcdef", + "resourceGroupName": "rg1", + "connectorName": "AWSBillingAccount", + "connector": { + "properties": { + "displayName": "AWS-Consolidated-2" + } + } + }, + "responses": { + "200": { + "body": { + "kind": "aws", + "id": "/subscriptions/01234567-89ab-cdef-0123-456789abcdef/resourceGroups/rg1/providers/Microsoft.CostManagement/connectors/AWSBillingAccount", + "name": "AWSBillingAccount", + "type": "Microsoft.CostManagement/connectors", + "location": "westus", + "properties": { + "displayName": "AWS-Consolidated-2", + "credentialsKey": "arn:aws:iam::123456789012:role/AzureCostManagementRole", + "reportId": "HourlyWithResources", + "createdOn": "2018-05-15T13:25:48Z", + "modifiedOn": "2018-05-23T09:21:11Z", + "status": "active" + } + } + } + } +} + diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ConnectorPut.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ConnectorPut.json new file mode 100644 index 000000000000..529ba2150a18 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ConnectorPut.json @@ -0,0 +1,55 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "subscriptionId": "01234567-89ab-cdef-0123-456789abcdef", + "resourceGroupName": "rg1", + "connectorName": "AWSBillingAccount", + "connector": { + "location": "westus", + "properties": { + "displayName": "AWS-Consolidated-1", + "credentialsKey": "arn:aws:iam::123456789012:role/AzureCostManagementRole", + "credentialsSecret": "external-id", + "reportId": "HourlyWithResources", + "status": "active" + } + } + }, + "responses": { + "200": { + "body": { + "kind": "aws", + "id": "/subscriptions/01234567-89ab-cdef-0123-456789abcdef/resourceGroups/rg1/providers/Microsoft.CostManagement/connectors/AWSBillingAccount", + "name": "AWSBillingAccount", + "type": "Microsoft.CostManagement/connectors", + "location": "westus", + "properties": { + "displayName": "AWS-Consolidated-1", + "credentialsKey": "arn:aws:iam::123456789012:role/AzureCostManagementRole", + "reportId": "HourlyWithResources", + "createdOn": "2018-05-15T13:25:48Z", + "modifiedOn": "2018-05-23T09:21:11Z", + "status": "active" + } + } + }, + "201": { + "body": { + "kind": "aws", + "id": "/subscriptions/01234567-89ab-cdef-0123-456789abcdef/resourceGroups/rg1/providers/Microsoft.CostManagement/connectors/AWSBillingAccount", + "name": "AWSBillingAccount", + "type": "Microsoft.CostManagement/connectors", + "location": "westus", + "properties": { + "displayName": "AWS-Consolidated-1", + "credentialsKey": "arn:aws:iam::123456789012:role/AzureCostManagementRole", + "reportId": "HourlyWithResources", + "createdOn": "2018-05-15T13:25:48Z", + "modifiedOn": "2018-05-23T09:21:11Z", + "status": "active" + } + } + } + } +} + diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ReportConfig.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ReportConfig.json new file mode 100644 index 000000000000..4eb8758df311 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ReportConfig.json @@ -0,0 +1,87 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "MYDEVTESTRG", + "reportConfigName": "TestReportConfig" + }, + "responses": { + "200": { + "body": { + "id": "subscriptions/{subscription-id}/providers/Microsoft.Consumption/reportconfigs/TestReportConfig", + "name": "TestReportConfig", + "type": "Microsoft.Consumption/reportconfigs", + "properties": { + "format": "Csv", + "deliveryInfo": { + "destination": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182", + "container": "reports", + "rootFolderPath": "ad-hoc" + } + }, + "definition":{ + "type": "Usage", + "timeframe": "Custom", + "timePeriod": { + "from": "2018-06-01T00:00:00Z", + "to": "2018-10-31T00:00:00Z" + }, + "dataset": { + "granularity": "Daily", + "configuration": { + "columns": [ + "UsageDate", + "MeterId", + "InstanceId", + "ResourceLocation", + "UsageQuantity" + ] + }, + "aggregation": { + "usageSum": { + "name": "UsageQuantity", + "function": "Sum" + } + }, + "grouping": [ + { + "columnType": "Dimension", + "name": "SubscriptionName" + }, + { + "columnType": "Tag", + "name": "Environment" + } + ], + "filter":{ + "and": [ + { + "dimension": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tag": { + "name": "Environment", + "operator": "Contains", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ReportConfigCreateOrUpdate.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ReportConfigCreateOrUpdate.json new file mode 100644 index 000000000000..5ff4af505431 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ReportConfigCreateOrUpdate.json @@ -0,0 +1,287 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "MYDEVTESTRG", + "reportConfigName": "TestReportConfig", + "parameters": { + "properties": { + "schedule":{ + "status": "Active", + "recurrence": "Weekly", + "recurrencePeriod": { + "from":"2018-06-01T00:00:00Z", + "to":"2018-10-31T00:00:00Z" + } + }, + "format": "Csv", + "deliveryInfo": { + "destination": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182", + "container": "reports", + "rootFolderPath": "ad-hoc" + } + }, + "definition":{ + "type": "Usage", + "timeframe": "MonthToDate", + "dataset": { + "granularity": "Daily", + "configuration": { + "columns": [ + "Date", + "MeterId", + "InstanceId", + "ResourceLocation", + "PreTaxCost" + ] + }, + "aggregation": { + "costSum": { + "name": "PreTaxCost", + "function": "Sum" + } + }, + "grouping": [ + { + "columnType": "Dimension", + "name": "SubscriptionName" + }, + { + "columnType": "Tag", + "name": "Environment" + } + ], + "filter":{ + "and": [ + { + "or":[ + { + "dimension": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tag": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimension": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] + } + } + } + } + } + }, + "responses": { + "201": { + "body": { + "id": "subscriptions/{subscription-id}/providers/Microsoft.Consumption/reportconfigs/TestReportConfig", + "name": "TestReportConfig", + "type": "Microsoft.Consumption/reportconfigs", + "properties": { + "schedule":{ + "status": "Active", + "recurrence": "Weekly", + "recurrencePeriod": { + "from":"2018-06-01T00:00:00Z", + "to":"2018-10-31T00:00:00Z" + } + }, + "format": "Csv", + "deliveryInfo": { + "destination": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182", + "container": "reports", + "rootFolderPath": "ad-hoc" + } + }, + "definition":{ + "type": "Usage", + "timeframe": "MonthToDate", + "dataset": { + "granularity": "Daily", + "configuration": { + "columns": [ + "Date", + "MeterId", + "InstanceId", + "ResourceLocation", + "PreTaxCost" + ] + }, + "aggregation": { + "costSum": { + "name": "PreTaxCost", + "function": "Sum" + } + }, + "grouping": [ + { + "columnType": "Dimension", + "name": "SubscriptionName" + }, + { + "columnType": "Tag", + "name": "Environment" + } + ], + "filter":{ + "and": [ + { + "or":[ + { + "dimension": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tag": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimension": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] + } + } + } + } + } + }, + "200": { + "body": { + "id": "subscriptions/{subscription-id}/providers/Microsoft.Consumption/reportconfigs/TestReportConfig", + "name": "TestReportConfig", + "type": "Microsoft.Consumption/reportconfigs", + "properties": { + "schedule":{ + "status": "Active", + "recurrence": "Weekly", + "recurrencePeriod": { + "from":"2018-06-01T00:00:00Z", + "to":"2018-10-31T00:00:00Z" + } + }, + "format": "Csv", + "deliveryInfo": { + "destination": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182", + "container": "reports", + "rootFolderPath": "ad-hoc" + } + }, + "definition":{ + "type": "Usage", + "timeframe": "MonthToDate", + "dataset": { + "granularity": "Daily", + "configuration": { + "columns": [ + "Date", + "MeterId", + "InstanceId", + "ResourceLocation", + "PreTaxCost" + ] + }, + "aggregation": { + "costSum": { + "name": "PreTaxCost", + "function": "Sum" + } + }, + "grouping": [ + { + "columnType": "Dimension", + "name": "SubscriptionName" + }, + { + "columnType": "Tag", + "name": "Environment" + } + ], + "filter":{ + "and": [ + { + "or":[ + { + "dimension": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tag": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimension": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ReportConfigDelete.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ReportConfigDelete.json new file mode 100644 index 000000000000..735eae4373ff --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ReportConfigDelete.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "MYDEVTESTRG", + "reportConfigName": "TestReport" + }, + "responses": { + "200": { + } + } +} \ No newline at end of file diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ReportConfigList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ReportConfigList.json new file mode 100644 index 000000000000..535ea4ef335d --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ReportConfigList.json @@ -0,0 +1,174 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "MYDEVTESTRG" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "subscriptions/{subscription-id}/providers/Microsoft.Consumption/reportconfigs/TestReportConfig1", + "name": "TestReportConfig1", + "type": "Microsoft.Consumption/reportconfigs", + "properties": { + "format": "Csv", + "deliveryInfo": { + "destination": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182", + "container": "reports", + "rootFolderPath": "ad-hoc" + } + }, + "definition":{ + "type": "Usage", + "timeframe": "Custom", + "timePeriod": { + "from": "2018-06-01T00:00:00Z", + "to": "2018-10-31T00:00:00Z" + }, + "dataset": { + "granularity": "Daily", + "configuration": { + "columns": [ + "Date", + "MeterId", + "InstanceId", + "ResourceLocation", + "PreTaxCost" + ] + }, + "aggregation": { + "costSum": { + "name": "PreTaxCost", + "function": "Sum" + } + }, + "grouping": [ + { + "columnType": "Dimension", + "name": "SubscriptionName" + } + ], + "filter":{ + "and": [ + { + "or":[ + { + "dimension": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tag": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimension": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] + } + } + } + } + }, + { + "id": "subscriptions/{subscription-id}/providers/Microsoft.Consumption/reportconfigs/TestReportConfig2", + "name": "TestReportConfig2", + "type": "Microsoft.Consumption/reportconfigs", + "properties": { + "schedule":{ + "status": "Active", + "recurrence": "Weekly", + "recurrencePeriod": { + "from":"2018-06-01T00:00:00Z", + "to":"2018-10-31T00:00:00Z" + } + }, + "format": "Csv", + "deliveryInfo": { + "destination": { + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182", + "container": "reports", + "rootFolderPath": "ad-hoc" + } + }, + "definition":{ + "type": "Usage", + "timeframe": "WeekToDate", + "dataset": { + "granularity": "Daily", + "configuration": { + "columns": [ + "Date", + "MeterId", + "InstanceId", + "ResourceLocation", + "UsageQuantity" + ] + }, + "aggregation": { + "usageSum": { + "name": "UsageQuantity", + "function": "Sum" + } + }, + "grouping": [ + { + "columnType": "Tag", + "name": "Environment" + } + ], + "filter":{ + "and": [ + { + "dimension": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tag": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + } + } + } + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ResourceGroupDimensionsList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ResourceGroupDimensionsList.json new file mode 100644 index 000000000000..589ecec0fb93 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ResourceGroupDimensionsList.json @@ -0,0 +1,49 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "subscriptionId": "39ae8bea-c3fd-4e24-8936-7c34974326ce", + "resourceGroupName": "system.orlando", + "$expand": "properties/data", + "$top": "5" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourceGroups/system.orlando/providers/microsoft.consumption/dimensions_ResourceType_2018-05-01_2018-05-31_5", + "name": "dimensions_ResourceType_2018-05-01_2018-05-31_5", + "type": "microsoft.consumption/dimensions", + "properties": { + "data": [ + "microsoft.storage/storageaccounts" + ], + "total": 1, + "category": "ResourceType", + "usageStart": "2018-05-01T00:00:00-07:00", + "usageEnd": "2018-05-31T00:00:00-07:00" + } + }, + { + "id": "subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourceGroups/system.orlando/providers/microsoft.consumption/dimensions_InstanceId_2018-05-01_2018-05-31_5", + "name": "dimensions_InstanceId_2018-05-01_2018-05-31_5", + "type": "microsoft.consumption/dimensions", + "properties": { + "data": [ + "/subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/authprod", + "/subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/systemevents", + "/subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/armadminprod", + "/subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/srphytenaccount", + "/subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/resourcegroups/system.orlando/providers/microsoft.storage/storageaccounts/publicsystemportal" + ], + "total": 27, + "category": "InstanceId", + "usageStart": "2018-05-01T00:00:00-07:00", + "usageEnd": "2018-05-31T00:00:00-07:00" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ResourceGroupQuery.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ResourceGroupQuery.json new file mode 100644 index 000000000000..bc471bea6d63 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/ResourceGroupQuery.json @@ -0,0 +1,100 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "subscriptionId": "55312978-ba1b-415c-9304-c4b9c43c0481", + "resourceGroupName": "ScreenSharingTest-peer", + "parameters":{ + "type": "Usage", + "timeframe": "MonthToDate", + "dataset": { + "granularity": "Daily", + "configuration": { + "columns": [ + "PreTaxCost", + "ResourceGroup", + "UsageDate" + ] + }, + "filter":{ + "and": [ + { + "or":[ + { + "dimension": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tag": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimension": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] + } + } + } + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "subscriptions/55312978-ba1b-415c-9304-c4b9c43c0481/resourcegroups/ScreenSharingTest-peer/providers/Microsoft.CostManagement/Query/9af9459d-441d-4055-9ed0-83d4c4a363fb", + "name": "9af9459d-441d-4055-9ed0-83d4c4a363fb", + "type": "microsoft.costmanagement/Query", + "properties": { + "nextLink": null, + "columns": [ + { + "name": "PreTaxCost", + "type": "Number" + }, + { + "name": "ResourceGroup", + "type": "String" + }, + { + "name": "UsageDate", + "type": "Number" + } + ], + "rows": [ + [ + 2.10333307059661, + "ScreenSharingTest-peer", + 20180417 + ], + [ + 20.10333307059661, + "ScreenSharingTest-peer", + 20180418 + ] + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/SubscriptionDimensionsList.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/SubscriptionDimensionsList.json new file mode 100644 index 000000000000..321b66d46de4 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/SubscriptionDimensionsList.json @@ -0,0 +1,51 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "subscriptionId": "39ae8bea-c3fd-4e24-8936-7c34974326ce", + "$top": "5", + "$expand": "properties/data" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/providers/Microsoft.Consumption/dimensions_ResourceGroup_2018-05-01_2018-05-31_5", + "name": "dimensions_ResourceGroup_2018-05-01_2018-05-31_5", + "type": "microsoft.consumption/dimensions", + "properties": { + "data": [ + "dcrg", + "rg", + "offlinegalleryrg", + "system.orlando.adminkeyvault", + "system.orlando.keyvault" + ], + "total": 68, + "category": "ResourceGroup", + "usageStart": "2018-05-01T00:00:00-07:00", + "usageEnd": "2018-05-31T00:00:00-07:00" + } + }, + { + "id": "subscriptions/39ae8bea-c3fd-4e24-8936-7c34974326ce/providers/Microsoft.Consumption/dimensions_ResourceType_2018-05-01_2018-05-31_5", + "name": "dimensions_ResourceType_2018-05-01_2018-05-31_5", + "type": "microsoft.consumption/dimensions", + "properties": { + "data": [ + "microsoft.storage/storageaccounts", + "microsoft.web.admin/role", + "microsoft.sql/servers", + "microsoft.compute/virtualmachines" + ], + "total": 4, + "category": "ResourceType", + "usageStart": "2018-05-01T00:00:00-07:00", + "usageEnd": "2018-05-31T00:00:00-07:00" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/SubscriptionQuery.json b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/SubscriptionQuery.json new file mode 100644 index 000000000000..9361310c0178 --- /dev/null +++ b/specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2018-09-01-preview/examples/SubscriptionQuery.json @@ -0,0 +1,109 @@ +{ + "parameters": { + "api-version": "2018-09-01-preview", + "subscriptionId": "55312978-ba1b-415c-9304-c6b9c43c0481", + "parameters":{ + "type": "Usage", + "timeframe": "MonthToDate", + "dataset": { + "granularity": "Daily", + "configuration": { + "columns": [ + "PreTaxCost", + "ResourceGroup", + "UsageDate" + ] + }, + "filter":{ + "and": [ + { + "or":[ + { + "dimension": { + "name": "ResourceLocation", + "operator": "In", + "values": [ + "East US", + "West Europe" + ] + } + }, + { + "tag": { + "name": "Environment", + "operator": "In", + "values": [ + "UAT", + "Prod" + ] + } + } + ] + }, + { + "dimension": { + "name": "ResourceGroup", + "operator": "In", + "values": [ + "API" + ] + } + } + ] + } + } + } + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "subscriptions/55312978-ba1b-415c-9304-c6b9c43c0481/providers/Microsoft.CostManagement/Query/55312978-ba1b-415c-9304-c6b9c43c0481", + "name": "55312978-ba1b-415c-9304-cfd9c43c0481", + "type": "microsoft.costmanagement/Query", + "properties": { + "nextLink": null, + "columns": [ + { + "name": "PreTaxCost", + "type": "Number" + }, + { + "name": "ResourceGroup", + "type": "String" + }, + { + "name": "UsageDate", + "type": "Number" + } + ], + "rows": [ + [ + 2.10333307059661, + "ScreenSharingTest-peer", + 20180417 + ], + [ + 218.68795741935486, + "Ict_StratAndPlan_GoldSprova_Prod", + 20180331 + ], + [ + 0.14384913581657052, + "ssbciotelement01", + 20180331 + ], + [ + 0.009865586851323632, + "ict_stratandplan_goldsprova_prod", + 20180331 + ] + ] + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/cost-management/resource-manager/readme.md b/specification/cost-management/resource-manager/readme.md index 8ffdd887eb7f..7679055356e9 100644 --- a/specification/cost-management/resource-manager/readme.md +++ b/specification/cost-management/resource-manager/readme.md @@ -35,6 +35,17 @@ input-file: - Microsoft.CostManagement/stable/2018-05-31/costmanagement.json ``` + +### Tag: package-2018-09-preview + +These settings apply only when `--tag=package-2018-09-preview` is specified on the command line. + +``` yaml $(tag) == 'package-2018-09-preview' +input-file: +- Microsoft.CostManagement/preview/2018-09-01-preview/costmanagement.json +``` + + --- # Code Generation @@ -110,6 +121,7 @@ go: ``` yaml $(go) && $(multiapi) batch: - tag: package-2018-05 + - tag: package-2018-09-preview ``` ### Tag: package-2018-05 and go @@ -120,6 +132,15 @@ Please also specify `--go-sdk-folder=`. + +``` yaml $(tag) == 'package-2018-09-preview' && $(go) +output-folder: $(go-sdk-folder)/services/$(namespace)/mgmt/2018-09-01-preview/$(namespace) +``` + + ## Java These settings apply only when `--java` is specified on the command line. @@ -139,6 +160,7 @@ output-folder: $(azure-libraries-for-java-folder)/azure-mgmt-costmanagement ``` yaml $(java) && $(multiapi) batch: - tag: package-2018-05 + - tag: package-2018-09-preview ``` ### Tag: package-2018-05 and java @@ -153,3 +175,16 @@ java: regenerate-manager: true generate-interface: true ``` + +### Tag: package-2018-09-preview and java + +These settings apply only when `--tag=package-2018-09-preview --java` is specified on the command line. +Please also specify `--azure-libraries-for-java=`. + +``` yaml $(tag) == 'package-2018-09-preview' && $(java) && $(multiapi) +java: + namespace: com.microsoft.azure.management.costmanagement.v2018_09_01_preview + output-folder: $(azure-libraries-for-java-folder)/costmanagement/resource-manager/v2018_09_01_preview +regenerate-manager: true +generate-interface: true +```