Reservation Recommendation Details - Get
保留實例分析的保留建議詳細數據。
GET https://management.azure.com/{resourceScope}/providers/Microsoft.Consumption/reservationRecommendationDetails?api-version=2023-05-01&scope={scope}®ion={region}&term={term}&lookBackPeriod={lookBackPeriod}&product={product}
GET https://management.azure.com/{resourceScope}/providers/Microsoft.Consumption/reservationRecommendationDetails?api-version=2023-05-01&scope={scope}®ion={region}&term={term}&lookBackPeriod={lookBackPeriod}&product={product}&$filter={$filter}
URI 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
resource
|
path | True |
string |
與保留建議詳細數據作業相關聯的範圍。 這包括訂用帳戶範圍的 '/subscriptions/{subscriptionId}/' 、資源群組範圍的 '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'、BillingAccounts/{billingAccounts/{billingAccountId}',以及 billingProfile 範圍的 '/providers/Microsoft.Billing/billingAccountId}/{billingProfileId}/{billingProfileId}' |
api-version
|
query | True |
string |
要與用戶端要求搭配使用的 API 版本。 目前的版本是 2023-03-01。 |
look
|
query | True |
篩選保留建議結果所依據的時間週期。 |
|
product
|
query | True |
string |
篩選產生保留建議結果的產品。 範例:適用於 VM) 的Standard_DS1_v2 (,Premium_SSD_Managed_Disks_P30 (用于 受控磁碟) |
region
|
query | True |
string |
用來選取應為其產生建議的區域。 |
scope
|
query | True |
保留的範圍。 |
|
term
|
query | True |
指定保留建議字詞的長度。 |
|
$filter
|
query |
string |
用來篩選保留建議詳細數據的方式:屬性/subscriptionId 可以指定計費帳戶和帳單配置文件路徑。 |
回應
名稱 | 類型 | Description |
---|---|---|
200 OK |
正常。 要求成功。 |
|
204 No Content |
沒有建議詳細數據時,就會傳送空的回應。 |
|
Other Status Codes |
描述作業失敗原因的錯誤回應。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名稱 | Description |
---|---|
user_impersonation | 模擬您的用戶帳戶 |
範例
Reservation |
Reservation |
Reservation |
Reservation |
ReservationRecommendationsByBillingAccount-Legacy
Sample Request
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/00000000/providers/Microsoft.Consumption/reservationRecommendationDetails?api-version=2023-05-01&scope=Shared®ion=eastus&term=P1Y&lookBackPeriod=Last60Days&product=Standard_DS14_v2&$filter=properties/subscriptionId eq 00000000-0000-0000-0000-00000000
Sample Response
{
"id": "providers/Microsoft.Billing/billingAccounts/00000000/providers/microsoft.consumption/reservationrecommendationdetails",
"name": "reservationRecommendationDetails",
"type": "Microsoft.Consumption/ReservationRecommendationDetails",
"properties": {
"currency": "USD",
"resource": {
"appliedScopes": [
"00000000-0000-0000-0000-00000000",
"00000000-0000-0000-0000-00000000"
],
"onDemandRate": 1.482,
"product": "Standard_DS14_v2",
"region": "eastus",
"reservationRate": 0.70570776255707,
"resourceType": "virtualmachines"
},
"resourceGroup": null,
"savings": {
"calculatedSavings": [
{
"onDemandCost": 529550.326618951,
"overageCost": 63253.5935111345,
"quantity": 220,
"reservationCost": 223102.452054792,
"totalReservationCost": 286356.045565927,
"savings": 243194.281053024
},
{
"onDemandCost": 529550.32661895,
"overageCost": 149335.025050147,
"quantity": 179,
"reservationCost": 181524.267808217,
"totalReservationCost": 330859.292858364,
"savings": 198691.033760586
},
{
"onDemandCost": 529550.32661895,
"overageCost": 195942.319606957,
"quantity": 157,
"reservationCost": 159214.022602738,
"totalReservationCost": 355156.342209695,
"savings": 174393.984409255
},
{
"onDemandCost": 529550.32661895,
"overageCost": 30975.2311896299,
"quantity": 241,
"reservationCost": 244398.595205477,
"totalReservationCost": 275373.826395107,
"savings": 254176.500223843
}
],
"lookBackPeriod": 60,
"recommendedQuantity": 253,
"reservationOrderTerm": "P1Y",
"savingsType": "instance",
"unitOfMeasure": "hour"
},
"scope": "Shared",
"usage": {
"firstConsumptionDate": "2019-11-27T00:00:00",
"lastConsumptionDate": "2020-01-25T21:00:00",
"lookBackUnitType": "virtualMachine quantity",
"usageData": [
275.95003899999995,
275.916705,
276,
276,
275.916725,
275.916705,
275.98335299999997,
276,
276,
276,
276,
276,
275.98335299999997,
276,
276,
276,
276,
275.933352
],
"usageGrain": "hourly"
}
}
}
ReservationRecommendationsByBillingProfile-Modern
Sample Request
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-00000000:00000000-0000-0000-0000-00000000/billingProfiles/00000000-0000-0000-0000-00000000/providers/Microsoft.Consumption/reservationRecommendationDetails?api-version=2023-05-01&scope=Shared®ion=australiaeast&term=P1Y&lookBackPeriod=Last7Days&product=Standard_B2s&$filter=properties/subscriptionId eq 00000000-0000-0000-0000-00000000
Sample Response
{
"id": "providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-00000000:00000000-0000-0000-0000-00000000/billingProfiles/00000000-0000-0000-0000-00000000/providers/microsoft.consumption/reservationrecommendationdetails",
"name": "reservationRecommendationDetails",
"type": "Microsoft.Consumption/ReservationRecommendationDetails",
"properties": {
"currency": "AUD",
"resource": {
"appliedScopes": [
"00000000-0000-0000-0000-00000000"
],
"onDemandRate": 0.0725,
"product": "Standard_B2s",
"region": "australiaeast",
"reservationRate": 0.04414166531788041,
"resourceType": "virtualmachines"
},
"resourceGroup": null,
"savings": {
"calculatedSavings": [
{
"onDemandCost": 632.8844720496894,
"overageCost": 0,
"quantity": 1,
"reservationCost": 387.74038815226174,
"totalReservationCost": 387.74038815226174,
"savings": 245.1440838974277
}
],
"lookBackPeriod": 7,
"recommendedQuantity": 1,
"reservationOrderTerm": "P1Y",
"savingsType": "instance",
"unitOfMeasure": "hour"
},
"scope": "Shared",
"usage": {
"firstConsumptionDate": "2020-01-19T00:00:00",
"lastConsumptionDate": "2020-01-25T17:00:00",
"lookBackUnitType": "virtualMachine quantity",
"usageData": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
0
],
"usageGrain": "hourly"
}
}
}
ReservationRecommendationsByResourceGroup-Legacy
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/testGroup/providers/Microsoft.Consumption/reservationRecommendationDetails?api-version=2023-05-01&scope=Single®ion=westus&term=P3Y&lookBackPeriod=Last30Days&product=Standard_DS13_v2
Sample Response
{
"id": "subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/testGroup/providers/microsoft.consumption/reservationrecommendationdetails",
"name": "reservationRecommendationDetails",
"type": "Microsoft.Consumption/ReservationRecommendationDetails",
"properties": {
"currency": "USD",
"resource": {
"appliedScopes": [
"00000000-0000-0000-0000-00000000",
"testGroup"
],
"onDemandRate": 0.519,
"product": "Standard_DS13_v2",
"region": "westus",
"reservationRate": 0.302549467275493,
"resourceType": "virtualmachines"
},
"resourceGroup": "testGroup",
"savings": {
"calculatedSavings": [
{
"onDemandCost": 368.4813602070006,
"overageCost": 0,
"quantity": 2,
"reservationCost": 429.01514459665,
"totalReservationCost": 429.01514459665,
"savings": -60.5337843896494
},
{
"onDemandCost": 368.481360207,
"overageCost": 1.557,
"quantity": 1,
"reservationCost": 214.507572298325,
"totalReservationCost": 216.064572298325,
"savings": 152.416787908675
}
],
"lookBackPeriod": 30,
"recommendedQuantity": 1,
"reservationOrderTerm": "P3Y",
"savingsType": "instance",
"unitOfMeasure": "hour"
},
"scope": "Single",
"usage": {
"firstConsumptionDate": "2020-02-03T00:00:00",
"lastConsumptionDate": "2020-03-03T13:00:00",
"lookBackUnitType": "virtualMachine quantity",
"usageData": [
1,
1,
1,
1,
1,
1
],
"usageGrain": "hourly"
}
}
}
ReservationRecommendationsBySubscription-Legacy
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-00000000/providers/Microsoft.Consumption/reservationRecommendationDetails?api-version=2023-05-01&scope=Single®ion=westus&term=P3Y&lookBackPeriod=Last30Days&product=Standard_DS13_v2
Sample Response
{
"id": "subscriptions/00000000-0000-0000-0000-00000000/providers/microsoft.consumption/reservationrecommendationdetails",
"name": "reservationRecommendationDetails",
"type": "Microsoft.Consumption/ReservationRecommendationDetails",
"properties": {
"currency": "USD",
"resource": {
"appliedScopes": [
"00000000-0000-0000-0000-00000000"
],
"onDemandRate": 0.519,
"product": "Standard_DS13_v2",
"region": "westus",
"reservationRate": 0.302549467275493,
"resourceType": "virtualmachines"
},
"resourceGroup": null,
"savings": {
"calculatedSavings": [
{
"onDemandCost": 368.4813602070006,
"overageCost": 0,
"quantity": 2,
"reservationCost": 429.01514459665,
"totalReservationCost": 429.01514459665,
"savings": -60.5337843896494
},
{
"onDemandCost": 368.481360207,
"overageCost": 1.557,
"quantity": 1,
"reservationCost": 214.507572298325,
"totalReservationCost": 216.064572298325,
"savings": 152.416787908675
}
],
"lookBackPeriod": 30,
"recommendedQuantity": 1,
"reservationOrderTerm": "P3Y",
"savingsType": "instance",
"unitOfMeasure": "hour"
},
"scope": "Single",
"usage": {
"firstConsumptionDate": "2020-02-03T00:00:00",
"lastConsumptionDate": "2020-03-03T13:00:00",
"lookBackUnitType": "virtualMachine quantity",
"usageData": [
1,
1,
1,
1,
1,
1
],
"usageGrain": "hourly"
}
}
}
定義
名稱 | Description |
---|---|
High |
錯誤的詳細數據。 |
High |
錯誤回應表示服務無法處理傳入要求。 錯誤訊息中提供了原因。 某些錯誤回應:
|
look |
篩選保留建議結果所依據的時間週期。 |
Reservation |
預估節省的詳細數據。 預估成本與節省成本。 |
Reservation |
保留建議詳細數據。 |
Reservation |
資源的詳細數據。 |
Reservation |
估計節省的詳細數據。 |
Reservation |
用於計算建議之歷程記錄使用量數據的詳細數據。 |
scope |
保留的範圍。 |
term |
指定保留建議字詞的長度。 |
HighCasedErrorDetails
錯誤的詳細數據。
名稱 | 類型 | Description |
---|---|---|
code |
string |
錯誤碼。 |
message |
string |
指出作業失敗原因的錯誤訊息。 |
HighCasedErrorResponse
錯誤回應表示服務無法處理傳入要求。 錯誤訊息中提供了原因。
某些錯誤回應:
429 TooManyRequests - 要求已節流。 等候 「x-ms-ratelimit-microsoft.consumption-retry-after」 標頭中指定的時間後重試。
503 ServiceUnavailable - 服務暫時無法使用。 請在等候「Retry-After」標頭中指定的時間之後重試。
名稱 | 類型 | Description |
---|---|---|
error |
錯誤的詳細數據。 |
lookBackPeriod
篩選保留建議結果所依據的時間週期。
名稱 | 類型 | Description |
---|---|---|
Last30Days |
string |
使用 30 天的數據來取得建議 |
Last60Days |
string |
針對建議使用 60 天的數據 |
Last7Days |
string |
針對建議使用7天的數據 |
ReservationRecommendationDetailsCalculatedSavingsProperties
預估節省的詳細數據。 預估成本與節省成本。
名稱 | 類型 | Description |
---|---|---|
onDemandCost |
number |
不含保留的成本。 包含硬體和軟體成本。 |
overageCost |
number |
保留未涵蓋之資源的硬體和軟體成本。 |
quantity |
number |
計算節省的數量。 |
reservationCost |
number |
保留所涵蓋之資源的硬體成本。 |
reservedUnitCount |
number |
用來計算節省的保留單位數目。 虛擬機一律為 1。 |
savings |
number |
購買建議的保留數量來儲存的數量。 這等於 onDemandCost - totalReservationCost。 |
totalReservationCost |
number |
保留成本 + 保留成本 + 保留成本所涵蓋之資源的軟體成本 + 超額成本。 |
ReservationRecommendationDetailsModel
保留建議詳細數據。
名稱 | 類型 | Description |
---|---|---|
etag |
string |
資源的 etag。 |
id |
string |
事件的完整ARM標識碼。 |
location |
string |
資源位置。 |
name |
string |
可唯一識別事件的標識碼。 |
properties.currency |
string |
成本與節省成本的 ISO 4217 貨幣代碼識別碼 |
properties.resource |
資源特定屬性。 |
|
properties.resourceGroup |
string |
資源群組。 |
properties.savings |
儲存建議的資訊。 |
|
properties.scope |
string |
保留的範圍,例如:單一或共用。 |
properties.usage |
用來計算預估節省成本的歷史使用量詳細數據。 |
|
sku |
string |
資源 SKU |
tags |
object |
資源標籤。 |
type |
string |
資源類型。 |
ReservationRecommendationDetailsResourceProperties
資源的詳細數據。
名稱 | 類型 | Description |
---|---|---|
appliedScopes |
string[] |
套用保留的訂用帳戶清單。 |
onDemandRate |
number |
資源的每小時隨選率。 僅包含硬體費率,亦即未包含軟體費率。 |
product |
string |
Azure 產品例如:Standard_E8s_v3等等。 |
region |
string |
Azure 資源區域,例如:EastUS、WestUS 等。 |
reservationRate |
number |
資源的每小時保留率。 會根據字詞而有所不同。 |
resourceType |
string |
Azure 資源類型。 |
ReservationRecommendationDetailsSavingsProperties
估計節省的詳細數據。
名稱 | 類型 | Description |
---|---|---|
calculatedSavings |
Reservation |
計算節省項目的清單。 |
lookBackPeriod |
integer |
用來查看用於計算建議的天數。 |
recommendedQuantity |
number |
資源的建議單位數目。 |
reservationOrderTerm |
string |
保留的期限,例如:P1Y 或 P3Y。 |
savingsType |
string |
省下的類型,例如:實例。 |
unitOfMeasure |
string |
度量單位例如:小時等。 |
ReservationRecommendationDetailsUsageProperties
用於計算建議之歷程記錄使用量數據的詳細數據。
名稱 | 類型 | Description |
---|---|---|
firstConsumptionDate |
string |
用於回溯計算建議的第一個使用日期。 |
lastConsumptionDate |
string |
上次用於查看計算建議的使用日期。 |
lookBackUnitType |
string |
使用量數據值代表什麼,例如:虛擬機實例。 |
usageData |
number[] |
歷程記錄資源使用量的明細。 這些值依第一個ConsumptionDate 與 lastConsumptionDate 之間的使用順序排列。 |
usageGrain |
string |
使用量數據中所表示值的粒度,例如:每小時。 |
scope
保留的範圍。
名稱 | 類型 | Description |
---|---|---|
Shared |
string |
|
Single |
string |
term
指定保留建議字詞的長度。
名稱 | 類型 | Description |
---|---|---|
P1Y |
string |
1 年保留期限 |
P3Y |
string |
3 年保留期限 |