Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding BillingMeters API #2745

Merged
merged 9 commits into from
Mar 30, 2018
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,38 @@
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters": {
"get": {
"summary": "Gets a list of meters for a given location.",
"description": "Gets a list of meters for a given location.",
"operationId": "BillingMeters_List",
"parameters": [
{
"name": "billingLocation",
"in": "query",
"description": "Azure Location of billable resource",
"type": "string"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this parameter required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it is not required. You can call api without billingLocation , it will return default values.

},
{
"$ref": "#/parameters/subscriptionIdParameter"
},
{
"$ref": "#/parameters/apiVersionParameter"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/BillingMeterCollection"
}
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.Web/deploymentLocations": {
"get": {
"summary": "Gets list of available geo regions plus ministamps",
Expand Down Expand Up @@ -476,6 +508,64 @@
}
},
"definitions": {
"BillingMeter": {
"description": "App Service billing entity that contains information about meter which the Azure billing system utilizes to charge users for services.",
"type": "object",
"allOf": [
{
"$ref": "./CommonDefinitions.json#/definitions/ProxyOnlyResource"
}
],
"properties": {
"properties": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider creating another model for these properties, something like BillingMeterProperties and then apply the x-ms-client-flatten extension

"description": "BillingMeter resource specific properties",
"properties": {
"meterId": {
"description": "Meter GUID onboarded in Commerce",
"type": "string"
},
"billingLocation": {
"description": "Azure Location of billable resource",
"type": "string"
},
"shortName": {
"description": "Short Name from App Service Azure pricing Page",
"type": "string"
},
"friendlyName": {
"description": "Friendly name of the meter",
"type": "string"
},
"resourceType": {
"description": "App Service resource type meter used for",
"type": "string"
}
},
"x-ms-client-flatten": true
}
}
},
"BillingMeterCollection": {
"description": "Collection of Billing Meters",
"required": [
"value"
],
"type": "object",
"properties": {
"value": {
"description": "Collection of Billing Meters.",
"type": "array",
"items": {
"$ref": "#/definitions/BillingMeter"
}
},
"nextLink": {
"description": "Link to next page of resources.",
"type": "string",
"readOnly": true
}
}
},
"CsmMoveResourceEnvelope": {
"description": "Object with a list of the resources that need to be moved and the resource group they should be moved to.",
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"parameters": {
"subscriptionId": "{subId}",
"api-version": "2016-03-01"
},
"responses": {
"200": {
"headers": {},
"body": {
"value": {
"id": "subscriptions/{subId}/providers/Microsoft.Web/billingMeters/{meterId}",
"name": "{meterId}",
"type": "subscriptions/{subId}/providers/Microsoft.Web/billingMeters",
"properties": {
"meterId": "{meterId}",
"billingLocation": "southcentralus",
"shortName": "I3",
"friendlyName": "Isolated Large App Service Hours",
"resourceType": "serverfarm"
}
}
}
}
}
}