The Get daily analytics method is used to get information about daily expenses for a pay-as-you-go subscription. The target period can be specified using arbitrary dates or aligned to billing periods. The method returns amounts in the reseller currency. The response depends on the service.
GET {base_url}/api/v3/analytics_daily
Arguments
Response model
|
Name |
Data type |
Description |
||||||
|---|---|---|---|---|---|---|---|---|
|
subscription |
object |
Information about the subscription |
||||||
|
|
id |
integer |
The subscription ID |
|||||
|
|
export_headers |
array |
The header names for a consumption report |
|||||
|
|
|
key |
string |
The header key |
||||
|
|
|
type |
string |
Data type |
||||
|
|
items |
array |
The list of resources and expenses |
|||||
|
|
|
billed_day |
string |
The date when consumption was billed in the platform (YYYY-MM-DD) |
||||
|
|
|
description |
string |
The consumption description |
||||
|
|
|
tags |
array |
The list of the resource tags |
||||
|
|
|
operate_day |
string |
The consumption date (YYYY-MM-DD) |
||||
|
|
|
unit_price |
string |
The unit price of the consumed resource |
||||
|
|
|
duration |
string |
The quantity of the consumed resource units |
||||
|
|
|
discount_amount |
string |
The discount amount |
||||
|
|
|
total |
string |
The consumption costs |
||||
|
|
|
taxes_total |
string |
The tax amount |
||||
|
|
|
category |
string |
The resource category |
||||
|
|
|
resource_name |
string |
The resource name |
||||
|
|
|
resource_group |
string |
The resource group |
||||
|
|
|
currency |
string |
The currency code |
||||
|
|
|
unit |
string |
The resource unit |
||||
|
|
|
Other attributes — depending on the service |
||||||
Request example
GET /api/v3/analytics_daily?subscription_id=53840&period_from=2023-06&period_to=2023-07
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json
Response example
{
"subscription": {
"id": "53840",
"export_headers": [
{
"key": "sku",
"type": "string"
},
{
"key": "category",
"type": "string"
},
{
"key": "subcategory",
"type": "string"
},
{
"key": "resource_name",
"type": "string"
},
{
"key": "description",
"type": "string"
},
{
"key": "currency",
"type": "string"
},
{
"key": "region",
"type": "string"
},
{
"key": "unit",
"type": "string"
},
{
"key": "resource_group",
"type": "string"
},
{
"key": "virtual_machine_name",
"type": "string"
},
{
"key": "duration",
"type": "number"
},
{
"key": "unit_price",
"type": "number"
},
{
"key": "discount_amount",
"type": "number"
},
{
"key": "taxes_total",
"type": "number"
},
{
"key": "total",
"type": "number"
},
{
"key": "operate_day",
"type": "date"
},
{
"key": "billed_day",
"type": "date"
}
],
"items": [
{
"billed_day": "2023-06-30",
"description": "Azure App Service: S1 App",
"tags": [],
"operate_day": "2023-06-30",
"unit_price": "0.13664",
"duration": "1.0",
"discount_amount": "0.0",
"total": "0.13664",
"taxes_total": "0.0",
"category": "Azure App Service",
"subcategory": "Azure App Service Standard Plan",
"sku": "011d5795-7609-4c28-8084-cd26374a1d0e",
"resource_name": "S1 App",
"resource_group": "rgportalprd",
"currency": "USD",
"region": "BR South",
"unit": "1 Hour"
},
{
"billed_day": "2023-06-30",
"description": "Storage: P4 LRS Disk",
"tags": [],
"operate_day": "2023-06-30",
"unit_price": "10.215072",
"duration": "0.001389",
"discount_amount": "0.0",
"total": "0.014189",
"taxes_total": "0.0",
"category": "Storage",
"subcategory": "Premium SSD Managed Disks",
"sku": "fec1d8d1-cc81-4d54-a391-83e228df4928",
"resource_name": "P4 LRS Disk",
"resource_group": "rgLan",
"currency": "USD",
"region": "BR South",
"unit": "1/Month"
},
{
"billed_day": "2023-06-30",
"description": "Virtual Machines: B4ms",
"tags": [],
"operate_day": "2023-06-30",
"unit_price": "0.30128",
"duration": "2.0",
"discount_amount": "0.0",
"total": "0.60256",
"taxes_total": "0.0",
"category": "Virtual Machines",
"subcategory": "Virtual Machines BS Series",
"sku": "f99c993a-da76-4b9b-824a-bd041aff7005",
"resource_name": "B4ms",
"resource_group": "RGLAN",
"currency": "USD",
"region": "BR South",
"unit": "1 Hour"
},
{
"billed_day": "2023-06-30",
"description": "Storage: LRS List and Create Container Operations",
"tags": [],
"operate_day": "2023-06-30",
"unit_price": "0.000403",
"duration": "0.0005",
"discount_amount": "0.0",
"total": "0.0",
"taxes_total": "0.0",
"category": "Storage",
"subcategory": "General Block Blob",
"sku": "f8c187bb-5a47-46ae-b874-f186d207fff4",
"resource_name": "LRS List and Create Container Operations",
"resource_group": "rgLan",
"currency": "USD",
"region": "",
"unit": "10K"
},
{
"billed_day": "2023-06-30",
"description": "VPN Gateway: Standard Gateway",
"tags": [],
"operate_day": "2023-06-30",
"unit_price": "0.2128",
"duration": "0.838333",
"discount_amount": "0.0",
"total": "0.178397",
"taxes_total": "0.0",
"category": "VPN Gateway",
"subcategory": "VPN Standard Gateway",
"sku": "f246df93-e03d-4e52-ae97-a43e8f3d542c",
"resource_name": "Standard Gateway",
"resource_group": "rgLan",
"currency": "USD",
"region": "",
"unit": "1 Hour"
},
{
"billed_day": "2023-06-30",
"description": "Virtual Network: Basic IPv4 Dynamic Public IP",
"tags": [],
"operate_day": "2023-06-30",
"unit_price": "0.00448",
"duration": "1.561666",
"discount_amount": "0.0",
"total": "0.006996",
"taxes_total": "0.0",
"category": "Virtual Network",
"subcategory": "IP Addresses",
"sku": "f114cb19-ea64-40b5-bcd7-aee474b62853",
"resource_name": "Basic IPv4 Dynamic Public IP",
"resource_group": "rgLan",
"currency": "USD",
"region": "",
"unit": "1 Hour"
},
{
"billed_day": "2023-06-30",
"description": "Virtual Machines: D2/DS2",
"tags": [],
"operate_day": "2023-06-30",
"unit_price": "0.35392",
"duration": "2.0",
"discount_amount": "0.0",
"total": "0.70784",
"taxes_total": "0.0",
"category": "Virtual Machines",
"subcategory": "Virtual Machines D Series Windows",
"sku": "f084eedf-a23f-46d2-bc24-b913ab919c95",
"resource_name": "D2/DS2",
"resource_group": "RGLAN",
"currency": "USD",
"region": "BR South",
"unit": "1 Hour"
},
{
"billed_day": "2023-06-30",
"description": "Bandwidth: Standard Data Transfer In",
"tags": [],
"operate_day": "2023-06-30",
"unit_price": "0.0",
"duration": "0.00461",
"discount_amount": "0.0",
"total": "0.0",
"taxes_total": "0.0",
"category": "Bandwidth",
"subcategory": "Rtn Preference: MGN",
"sku": "e315c24e-2f54-4668-95ae-5aef18f93125",
"resource_name": "Standard Data Transfer In",
"resource_group": "rgLan",
"currency": "USD",
"region": "BR South",
"unit": "1 GB"
}
]
}
}