Skip to content

Commit

Permalink
Consumption specifications for cost insights and reporting operations (
Browse files Browse the repository at this point in the history
…#3171)

* Consumption specifications for cost insights and reporting operations

* Fixed $ref for ReportConfigDelete

* Silly me!! Fixed bad reference again

* Fixed schema validation issues

* Fixing validation errors around datetime and dynamic respones

* Fixed parameters in examples

* Fixed parameter name in example

* Removed x-ms-odata method for POST op

* Fixed ARM review comments
  • Loading branch information
shalinved authored and lmazuel committed Jun 14, 2018
1 parent 7956c1d commit 30f1846
Show file tree
Hide file tree
Showing 13 changed files with 2,560 additions and 193 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"parameters": {
"api-version": "2018-05-31",
"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"
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"parameters": {
"api-version": "2018-05-31",
"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"
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"parameters": {
"api-version": "2018-05-31",
"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"
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"parameters": {
"api-version": "2018-05-31",
"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.Consumption/AnalyzeUsage/ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"name": "ad67fd91-c131-4bda-9ba9-7187ecb1cebd",
"type": "microsoft.consumption/AnalyzeUsage",
"properties": {
"nextLink": "https://management.azure.com/providers/Microsoft.Billing/billingAccounts/70664866/providers/Microsoft.Consumption/AnalyzeUsage?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
]
]
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"parameters": {
"api-version": "2018-05-31",
"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"
]
}
}
]
}
}
}
}
}
}
}
}
Loading

0 comments on commit 30f1846

Please sign in to comment.