Getting Costs
This section explains how to get cost estimations.
Request
POST https://<hostname>/api/v1/costEstimation |
Request Headers
The request header must contain an authorization token of the current session.
Request Parameters
None.
Request Body
Property | Type | Description |
name | string | Sets the name of the backup policy. |
description | string | Sets the description of the backup policy. |
isEnabled | boolean | Defines if the backup policy must be enabled upon creation. |
priority | integer | Sets the priority for the backup policy. |
tenantId | string | Sets the tenant identification number. |
backupType | string | Sets the backup type. |
regions | string | Sets the regions in which to look up for resources. |
selectedItems | string | Sets the selected items. Possible types:
|
excludedItems | string | Sets the selected items. |
snapshotSettings | Sets the PolicySnapshotSettingsFromClient object. | |
backupSettings | Sets the PolicyBackupSettingsFromClient object. | |
retrySettings | Sets the RetrySettings object. | |
policyNotificationSettings | Sets the PolicyNotificationSettings object. |
PolicySnapshotSettingsFromClient Object
Property | Type | Description |
|---|---|---|
generationsToSave | integer | Sets the number of snapshots to be saved by the backup policy. |
schedule | integer | Sets schedule parameters. |
PolicyBackupSettingsFromClient Object
Property | Type | Description |
|---|---|---|
targetRepositoryId | integer | Sets the identification number of the backup repository to which backups are going to be saved. |
retentionSettings | Sets the RepositoryRetentionSettings object. | |
schedule | string | Sets schedule parameters. |
Property | Type | Description |
|---|---|---|
retryCount | integer | Sets the retry attempts number. |
PolicyNotificationSettings Object
Property | Type | Description |
|---|---|---|
recipient | string | Sets the email address to which notifications about backup policy results muse be sent. |
notifyOnSuccess | boolean | Defines if a notification must be sent on Success. |
notifyOnWarning | boolean | Defines if a notification must be sent on Warning. |
notifyOnFailure | boolean | Defines if a notification must be sent on Failure. |
Request Example
Request: POST https://<hostname>/api/v1/costEstimation
Request Header: Authorization: Bearer <Access-Token>
Request Body: { "name":"Backup Policy via REST", "description":"", "isEnabled":true, "priority":0, "tenantId":"3e924ba9-93bc-40d5-8a47-33f07b239a52", "backupType":"SelectedItems", "regions":[ { "regionId":"northeurope" }, { "regionId":"ukwest" }, { "regionId":"westeurope" } ], "selectedItems":{ "subscriptions":[
], "resourceGroups":[
], "tags":[
], "virtualMachines":[ { "id":"ej43ifg58cgjs8e9cod74ye6cbwm5nttf6ijzk64rshqoip1abqy" }, { "id":"g344t5o8hgxgyp9r5bxqsn1aom88kjsc3hjnk3o8umzdptc3w3ey" } ] }, "excludedItems":{ "virtualMachines":[ { "id":"g344t5o8hgxgyp9r5bxqsn1aom88kjsc3hjnk3o8umzdptc3w3ey" } ] }, "snapshotSettings":{ "generationsToSave":7, "schedule":{ "frequencyType":"Monthly", "monthlyTime":"20:00:00", "monthlyType":"First", "monthlyDayOfWeek":"Monday", "monthlyLastDay":false, "monthlyDay":1, "selectedMonths":[ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ] } }, "backupSettings":{ "targetRepositoryId":1, "retentionSettings":{ "retentionDurationType":"Daily", "timeRetentionDuration":21 }, "schedule":{ "frequencyType":"Monthly", "monthlyTime":"20:00:00", "monthlyType":"First", "monthlyDayOfWeek":"Monday", "monthlyLastDay":false, "monthlyDay":1, "selectedMonths":[ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ] } }, "retrySettings":{ "retryCount":3 }, "policyNotificationSettings":{ "recipient":"@tech.local", "notifyOnSuccess":true, "notifyOnWarning":true, "notifyOnFailure":true } } |
Response
The server returns the following response to the client.
Response Codes
A successfully completed operation returns a response code 200 (OK).
Response Headers
The response to this request contains the following headers. The response may also include additional standard HTTPS headers.
Header | Description |
Content-length | The length of the response body. |
Content-type | The media type and syntax of the response body message: application/json; charset=utf-8 |
Response Body
Property | Type | Description |
|---|---|---|
metadata | Contains the CostEstimationData object. | |
offset | integer | Shows the offset value. |
limit | integer | Shows the offset limit. |
totalCount | integer | Shows the number of records in the results array. |
results | Contains the result object. | |
_links | Dictionary of string [key] and Object [value] | Links to related resources (navigation property). |
Property | Type | Description |
|---|---|---|
summary | Contains the CostEstimationData object. | |
assumptions | CostEstimationAssumptions Object | Shows calculation assumptions. |
warningGroups | string | Shows warnings (if any). |
currencyIsoCode | string | Shows the currency ISO code. |
Property | Type | Description |
|---|---|---|
totalCosts | CostEstimationTotalValue Object | Shows the grand total. |
totalSnapshotCosts | CostEstimationTotalValue Object | Shows the grand total of taking snapshots of all VMs in the backup policy processing list. |
totalBackupCosts | CostEstimationTotalValue Object | Shows the grand total of creating backups of all VMs in the backup policy processing list. |
totalTrafficCosts | CostEstimationTotalValue Object | Shows the grand total of traffic costs. |
totalTransactionCosts | CostEstimationTotalValue Object | Shows the grand total of transaction costs. |
Property | Type | Description |
|---|---|---|
protectedItemHashId | string | Shows the identification number of the VM for which the costs are being calculated. |
name | string | Shows the name of the VM for which the costs are being calculated. |
snapshotCost | CostEstimationItemCostsData Object | Contains the CostEstimationItemCostsData object that shows the following information (for snapshots):
|
backupCost | CostEstimationItemCostsData Object | Contains the CostEstimationItemCostsData object that shows the following information (for backups):
|
trafficCost | CostEstimationItemCostsData Object | Contains the CostEstimationItemCostsData object that shows the following information (for traffic costs):
|
transactionCost | CostEstimationItemCostsData Object | Contains the CostEstimationItemCostsData object that shows the following information (for transaction costs):
|
totalPerMonth | CostEstimationTotalValue Object | Contains the CostEstimationTotalValue object that shows the following information (total costs per month):
|
Response Example
Response: 200 OK
Response Body: { "metadata": { "summary": { "totalCosts": { "pricePerMonth": { "value": 133.15584213161907, "type": "Valid" }, "warnings": [] }, "totalSnapshotCosts": { "pricePerMonth": { "value": 14.700000000000001, "type": "Valid" }, "warnings": [] }, "totalBackupCosts": { "pricePerMonth": { "value": 2.3619445218835025, "type": "Valid" }, "warnings": [] }, "totalTrafficCosts": { "pricePerMonth": { "value": 115.40550232315063, "type": "Valid" }, "warnings": [] }, "totalTransactionCosts": { "pricePerMonth": { "value": 0.6883952865849224, "type": "Valid" }, "warnings": [] } }, "assumptions": { "diskOccupiedSizeRatio": 0.7, "dailyChurnRatio": 0.03, "dataCompressionRatio": 2 }, "warningGroups": [ { "type": "StorageCouldBeCheaper", "text": "There are more cost-effective storage account alternatives than Standard_RAGRS, for example Standard_LRS.", "warnings": [ { "id": "StorageCouldBeCheaper_7201feeca16d2c15e8a0b0cce8f43a2a", "protectedItemHashIds": [], "text": "There are more cost-effective storage account alternatives than Standard_RAGRS, for example Standard_LRS." }] }, { "type": "BackupToDifferentRegion", "text": "Some virtual machines will be backed up to a different region, it may affect the cost significantly.", "warnings": [ { "id": "BackupToDifferentRegion", "protectedItemHashIds": [ "oydin8q4ug58zh1snryo4gaqdw6nx7it17m6kaoqp59odir8a8bo", "1bds4myhyh4o66wzxk6ixcgp1xssgmwyhremj1su6ixj6p4snrny" ], "text": "The virtual machine will be backed up to a different region, it may affect the cost significantly." }] } ], "currencyIsoCode": "USD" }, "offset": 0, "limit": 30, "totalCount": 2, "results": [ { "protectedItemHashId": "1bds4myhyh4o66wzxk6ixcgp1xssgmwyhremj1su6ixj6p4snrny", "name": "-server", "snapshotCost": { "pricePerMonth": { "value": 7.3500000000000005, "type": "Valid" }, "meters": [ { "resource": { "name": "-server_disk1_94bce520eee044358e842ad7d36c025d", "hashId": {"Value": "duprymsckjawm1zxi1oatpmrinqqom3wamxm7gr7kto9h7xjn54y"}, "resourceId": "/subscriptions/3a9a8330-7bbc-4b03-9c68-15d674fbc809/resourcegroups/-resourcegroup/providers/microsoft.compute/disks/-server_disk1_94bce520eee044358e842ad7d36c025d", "size": 30 }, "meterId": "5590d778-a6e7-40ec-bc83-c1440ed75c75", "description": "LrsSnapshots/StandardHddManagedDisks", "unitPrice": 0.05, "unit": "OneGbPerMonth", "quantityUsed": 147 }], "warnings": [] }, "backupCost": { "pricePerMonth": { "value": 1.1809722609417512, "type": "Valid" }, "meters": [ { "resource": { "name": "-server_disk1_94bce520eee044358e842ad7d36c025d", "hashId": {"Value": "duprymsckjawm1zxi1oatpmrinqqom3wamxm7gr7kto9h7xjn54y"}, "resourceId": "/subscriptions/3a9a8330-7bbc-4b03-9c68-15d674fbc809/resourcegroups/-resourcegroup/providers/microsoft.compute/disks/-server_disk1_94bce520eee044358e842ad7d36c025d", "size": 30 }, "meterId": "0623400b-f198-453e-b090-f09555b18e6a", "description": "Data Stored", "unitPrice": 0.049, "unit": "OneGbPerMonth", "quantityUsed": 17.11554001364857 }, { "resource": { "name": "-server_disk1_94bce520eee044358e842ad7d36c025d", "hashId": {"Value": "duprymsckjawm1zxi1oatpmrinqqom3wamxm7gr7kto9h7xjn54y"}, "resourceId": "/subscriptions/3a9a8330-7bbc-4b03-9c68-15d674fbc809/resourcegroups/-resourcegroup/providers/microsoft.compute/disks/-server_disk1_94bce520eee044358e842ad7d36c025d", "size": 30 }, "meterId": "0984b7ed-975f-4dd1-8ba1-db05b74796d1", "description": "Geo Replication", "unitPrice": 0.02, "unit": "OneGb", "quantityUsed": 17.11554001364857 } ], "warnings": [] }, "trafficCost": { "pricePerMonth": { "value": 57.702751161575314, "type": "Valid" }, "meters": [ { "resource": { "name": "-server_disk1_94bce520eee044358e842ad7d36c025d", "hashId": {"Value": "duprymsckjawm1zxi1oatpmrinqqom3wamxm7gr7kto9h7xjn54y"}, "resourceId": "/subscriptions/3a9a8330-7bbc-4b03-9c68-15d674fbc809/resourcegroups/-resourcegroup/providers/microsoft.compute/disks/-server_disk1_94bce520eee044358e842ad7d36c025d", "size": 30 }, "meterId": "9995d93a-7d35-4d3f-9c69-7a7fea447ef4", "description": "Zone1/DataTransferOut", "unitPrice": 0.087, "unit": "OneGb", "quantityUsed": 663.2500133514404 }], "warnings": [{"id": "BackupToDifferentRegion"}] }, "transactionCost": { "pricePerMonth": { "value": 0.3441976432924612, "type": "Valid" }, "meters": [ { "resource": { "name": "-server_disk1_94bce520eee044358e842ad7d36c025d", "hashId": {"Value": "duprymsckjawm1zxi1oatpmrinqqom3wamxm7gr7kto9h7xjn54y"}, "resourceId": "/subscriptions/3a9a8330-7bbc-4b03-9c68-15d674fbc809/resourcegroups/-resourcegroup/providers/microsoft.compute/disks/-server_disk1_94bce520eee044358e842ad7d36c025d", "size": 30 }, "meterId": "f2b896ed-0fb5-48a5-a687-70c2f63e137b", "description": "Write Operations", "unitPrice": 0.108, "unit": "TenKilo", "quantityUsed": 3.125057311304348 }, { "resource": { "name": "-server_disk1_94bce520eee044358e842ad7d36c025d", "hashId": {"Value": "duprymsckjawm1zxi1oatpmrinqqom3wamxm7gr7kto9h7xjn54y"}, "resourceId": "/subscriptions/3a9a8330-7bbc-4b03-9c68-15d674fbc809/resourcegroups/-resourcegroup/providers/microsoft.compute/disks/-server_disk1_94bce520eee044358e842ad7d36c025d", "size": 30 }, "meterId": "54ef6a12-60c1-4248-878f-1d3d9da46833", "description": "Virtual Machine (Standard_A1_v2)", "unitPrice": 0.041, "unit": "OneHour", "quantityUsed": 0.006691453671591623 } ], "warnings": [] }, "totalPerMonth": { "pricePerMonth": { "value": 66.57792106580953, "type": "Valid" }, "warnings": [] } }, { "protectedItemHashId": "oydin8q4ug58zh1snryo4gaqdw6nx7it17m6kaoqp59odir8a8bo", "name": "test-vm-berezhnoi-1", "snapshotCost": { "pricePerMonth": { "value": 7.3500000000000005, "type": "Valid" }, "meters": [ { "resource": { "name": "test-vm-berezhnoi-1_OsDisk_1_6770e4786e924bda82eec9ee9593ac6d", "hashId": {"Value": "696cp13rqtrn5nxeo7ci1yicz4ae4grhkbhafh1j7j6kx1za4isy"}, "resourceId": "/subscriptions/3a9a8330-7bbc-4b03-9c68-15d674fbc809/resourcegroups/rg-rnd-backup-europe-north-net/providers/microsoft.compute/disks/test-vm-berezhnoi-1_osdisk_1_6770e4786e924bda82eec9ee9593ac6d", "size": 30 }, "meterId": "5590d778-a6e7-40ec-bc83-c1440ed75c75", "description": "LrsSnapshots/StandardHddManagedDisks", "unitPrice": 0.05, "unit": "OneGbPerMonth", "quantityUsed": 147 }], "warnings": [] }, "backupCost": { "pricePerMonth": { "value": 1.1809722609417512, "type": "Valid" }, "meters": [ { "resource": { "name": "test-vm-berezhnoi-1_OsDisk_1_6770e4786e924bda82eec9ee9593ac6d", "hashId": {"Value": "696cp13rqtrn5nxeo7ci1yicz4ae4grhkbhafh1j7j6kx1za4isy"}, "resourceId": "/subscriptions/3a9a8330-7bbc-4b03-9c68-15d674fbc809/resourcegroups/rg-rnd-backup-europe-north-net/providers/microsoft.compute/disks/test-vm-berezhnoi-1_osdisk_1_6770e4786e924bda82eec9ee9593ac6d", "size": 30 }, "meterId": "0623400b-f198-453e-b090-f09555b18e6a", "description": "Data Stored", "unitPrice": 0.049, "unit": "OneGbPerMonth", "quantityUsed": 17.11554001364857 }, { "resource": { "name": "test-vm-berezhnoi-1_OsDisk_1_6770e4786e924bda82eec9ee9593ac6d", "hashId": {"Value": "696cp13rqtrn5nxeo7ci1yicz4ae4grhkbhafh1j7j6kx1za4isy"}, "resourceId": "/subscriptions/3a9a8330-7bbc-4b03-9c68-15d674fbc809/resourcegroups/rg-rnd-backup-europe-north-net/providers/microsoft.compute/disks/test-vm-berezhnoi-1_osdisk_1_6770e4786e924bda82eec9ee9593ac6d", "size": 30 }, "meterId": "0984b7ed-975f-4dd1-8ba1-db05b74796d1", "description": "Geo Replication", "unitPrice": 0.02, "unit": "OneGb", "quantityUsed": 17.11554001364857 } ], "warnings": [] }, "trafficCost": { "pricePerMonth": { "value": 57.702751161575314, "type": "Valid" }, "meters": [ { "resource": { "name": "test-vm-berezhnoi-1_OsDisk_1_6770e4786e924bda82eec9ee9593ac6d", "hashId": {"Value": "696cp13rqtrn5nxeo7ci1yicz4ae4grhkbhafh1j7j6kx1za4isy"}, "resourceId": "/subscriptions/3a9a8330-7bbc-4b03-9c68-15d674fbc809/resourcegroups/rg-rnd-backup-europe-north-net/providers/microsoft.compute/disks/test-vm-berezhnoi-1_osdisk_1_6770e4786e924bda82eec9ee9593ac6d", "size": 30 }, "meterId": "9995d93a-7d35-4d3f-9c69-7a7fea447ef4", "description": "Zone1/DataTransferOut", "unitPrice": 0.087, "unit": "OneGb", "quantityUsed": 663.2500133514404 }], "warnings": [{"id": "BackupToDifferentRegion"}] }, "transactionCost": { "pricePerMonth": { "value": 0.3441976432924612, "type": "Valid" }, "meters": [ { "resource": { "name": "test-vm-berezhnoi-1_OsDisk_1_6770e4786e924bda82eec9ee9593ac6d", "hashId": {"Value": "696cp13rqtrn5nxeo7ci1yicz4ae4grhkbhafh1j7j6kx1za4isy"}, "resourceId": "/subscriptions/3a9a8330-7bbc-4b03-9c68-15d674fbc809/resourcegroups/rg-rnd-backup-europe-north-net/providers/microsoft.compute/disks/test-vm-berezhnoi-1_osdisk_1_6770e4786e924bda82eec9ee9593ac6d", "size": 30 }, "meterId": "f2b896ed-0fb5-48a5-a687-70c2f63e137b", "description": "Write Operations", "unitPrice": 0.108, "unit": "TenKilo", "quantityUsed": 3.125057311304348 }, { "resource": { "name": "test-vm-berezhnoi-1_OsDisk_1_6770e4786e924bda82eec9ee9593ac6d", "hashId": {"Value": "696cp13rqtrn5nxeo7ci1yicz4ae4grhkbhafh1j7j6kx1za4isy"}, "resourceId": "/subscriptions/3a9a8330-7bbc-4b03-9c68-15d674fbc809/resourcegroups/rg-rnd-backup-europe-north-net/providers/microsoft.compute/disks/test-vm-berezhnoi-1_osdisk_1_6770e4786e924bda82eec9ee9593ac6d", "size": 30 }, "meterId": "54ef6a12-60c1-4248-878f-1d3d9da46833", "description": "Virtual Machine (Standard_A1_v2)", "unitPrice": 0.041, "unit": "OneHour", "quantityUsed": 0.006691453671591623 } ], "warnings": [] }, "totalPerMonth": { "pricePerMonth": { "value": 66.57792106580953, "type": "Valid" }, "warnings": [] } } ], "_links": {} } |