共用方式為


Views - List

依租用戶和物件 清單 所有檢視。

GET https://management.azure.com/providers/Microsoft.CostManagement/views?api-version=2023-11-01

URI 參數

名稱 位於 必要 類型 Description
api-version
query True

string

用於此作業的 API 版本。

回應

名稱 類型 Description
200 OK

ViewListResult

正常。 要求已成功。

Other Status Codes

ErrorResponse

描述作業失敗原因的錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

類型: oauth2
Flow: implicit
授權 URL: https://login.microsoftonline.com/common/oauth2/authorize

範圍

名稱 Description
user_impersonation 模擬您的用戶帳戶

範例

PrivateViewList

範例要求

GET https://management.azure.com/providers/Microsoft.CostManagement/views?api-version=2023-11-01

範例回覆

{
  "value": [
    {
      "id": "/providers/Microsoft.CostManagement/views/swaggerExample",
      "name": "swaggerExample",
      "type": "Microsoft.CostManagement/Views",
      "eTag": "\"1d4ff9fe66f1d10\"",
      "properties": {
        "displayName": "swagger Example",
        "scope": "",
        "query": {
          "type": "Usage",
          "timeframe": "MonthToDate",
          "dataSet": {
            "granularity": "Daily",
            "aggregation": {
              "totalCost": {
                "name": "PreTaxCost",
                "function": "Sum"
              }
            },
            "grouping": [],
            "sorting": [
              {
                "direction": "Ascending",
                "name": "UsageDate"
              }
            ]
          }
        },
        "chart": "Table",
        "accumulated": "true",
        "metric": "ActualCost",
        "kpis": [
          {
            "type": "Forecast",
            "id": null,
            "enabled": true
          },
          {
            "type": "Budget",
            "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo",
            "enabled": true
          }
        ],
        "pivots": [
          {
            "type": "Dimension",
            "name": "ServiceName"
          },
          {
            "type": "Dimension",
            "name": "MeterCategory"
          },
          {
            "type": "TagKey",
            "name": "swaggerTagKey"
          }
        ]
      }
    },
    {
      "id": "/providers/Microsoft.CostManagement/views/swaggerExample2",
      "name": "swaggerExample2",
      "type": "Microsoft.CostManagement/Views",
      "eTag": "\"1d4ffa5a9c2430c\"",
      "properties": {
        "displayName": "swagger Example 2",
        "scope": "",
        "query": {
          "type": "Usage",
          "timeframe": "LastMonthToDate",
          "dataSet": {
            "granularity": "Daily",
            "aggregation": {
              "totalCost": {
                "name": "PreTaxCost",
                "function": "Sum"
              }
            },
            "grouping": [],
            "sorting": [
              {
                "direction": "Ascending",
                "name": "UsageDate"
              }
            ]
          }
        },
        "chart": "GroupedColumn",
        "accumulated": "true",
        "metric": "ActualCost",
        "kpis": [
          {
            "type": "Forecast",
            "id": null,
            "enabled": true
          },
          {
            "type": "Budget",
            "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Consumption/budgets/swaggerDemo",
            "enabled": true
          }
        ],
        "pivots": [
          {
            "type": "Dimension",
            "name": "ServiceName"
          },
          {
            "type": "Dimension",
            "name": "MeterCategory"
          },
          {
            "type": "TagKey",
            "name": "swaggerTagKey"
          }
        ]
      }
    }
  ]
}

定義

名稱 Description
AccumulatedType

顯示一段時間累積的成本。

ChartType

成本分析中主要檢視的圖表類型。 必要。

ErrorDetails

錯誤的詳細數據。

ErrorResponse

錯誤回應表示服務無法處理傳入要求。 錯誤訊息中提供了原因。

某些錯誤回應:

  • 429 TooManyRequests - 要求已節流。 等候 「x-ms-ratelimit-microsoft.consumption-retry-after」 標頭中指定的時間後重試。

  • 503 ServiceUnavailable - 服務暫時無法使用。 請在等候「Retry-After」標頭中指定的時間之後重試。

FunctionType

要使用的聚合函數名稱。

KpiProperties

每個 KPI 都必須包含 'type' 和 'enabled' 金鑰。

KpiTypeType

KPI 類型 (預測、預算) 。

MetricType

顯示成本時要使用的計量。

OperatorType

要用於比較的運算符。

PivotProperties

每個樞紐都必須包含 『type』 和 'name'。

PivotTypeType

要顯示在檢視中的數據類型。

QueryColumnType

匯出中數據行的類型。

ReportConfigAggregation

報表中要使用的匯總表達式。

ReportConfigComparisonExpression

要在報表中使用的比較表達式。

ReportConfigDataset

報表中存在的數據定義。

ReportConfigDatasetConfiguration

報表中的數據集組態。

ReportConfigFilter

報表中使用的篩選表達式。

ReportConfigGrouping

報表中要使用的依表達式分組。

ReportConfigSorting

報表中要使用的依表達式順序。

ReportConfigSortingType

排序方向。

ReportConfigTimePeriod

提取報表數據的開始和結束日期。

ReportGranularityType

報表中數據列的數據粒度。

ReportTimeframeType

提取報表數據的時間範圍。 如果為自定義,則必須提供特定的時間週期。

ReportType

報表的類型。 使用量代表實際使用量、預測代表預測的數據,而 UsageAndForecast 代表使用量和預測數據。 實際使用量和預測數據可以根據日期來區分。

View

成本分析的狀態和設定。

ViewListResult

清單檢視的結果。 其中包含可用的檢視清單。

AccumulatedType

顯示一段時間累積的成本。

名稱 類型 Description
false

string

true

string

ChartType

成本分析中主要檢視的圖表類型。 必要。

名稱 類型 Description
Area

string

GroupedColumn

string

Line

string

StackedColumn

string

Table

string

ErrorDetails

錯誤的詳細數據。

名稱 類型 Description
code

string

錯誤碼。

message

string

指出作業失敗原因的錯誤訊息。

ErrorResponse

錯誤回應表示服務無法處理傳入要求。 錯誤訊息中提供了原因。

某些錯誤回應:

  • 429 TooManyRequests - 要求已節流。 等候 「x-ms-ratelimit-microsoft.consumption-retry-after」 標頭中指定的時間後重試。

  • 503 ServiceUnavailable - 服務暫時無法使用。 請在等候「Retry-After」標頭中指定的時間之後重試。

名稱 類型 Description
error

ErrorDetails

錯誤的詳細數據。

FunctionType

要使用的聚合函數名稱。

名稱 類型 Description
Sum

string

KpiProperties

每個 KPI 都必須包含 'type' 和 'enabled' 金鑰。

名稱 類型 Description
enabled

boolean

在UI中顯示 KPI 嗎?

id

string

與計量 (預算) 相關的資源識別碼。

type

KpiTypeType

KPI 類型 (預測、預算) 。

KpiTypeType

KPI 類型 (預測、預算) 。

名稱 類型 Description
Budget

string

Forecast

string

MetricType

顯示成本時要使用的計量。

名稱 類型 Description
AHUB

string

ActualCost

string

AmortizedCost

string

OperatorType

要用於比較的運算符。

名稱 類型 Description
Contains

string

In

string

PivotProperties

每個樞紐都必須包含 『type』 和 'name'。

名稱 類型 Description
name

string

要顯示在檢視中的數據欄位。

type

PivotTypeType

要顯示在檢視中的數據類型。

PivotTypeType

要顯示在檢視中的數據類型。

名稱 類型 Description
Dimension

string

TagKey

string

QueryColumnType

匯出中數據行的類型。

名稱 類型 Description
Dimension

string

成本數據的維度。

TagKey

string

與成本數據相關聯的標記。

ReportConfigAggregation

報表中要使用的匯總表達式。

名稱 類型 Description
function

FunctionType

要使用的聚合函數名稱。

name

string

要匯總的數據行名稱。

ReportConfigComparisonExpression

要在報表中使用的比較表達式。

名稱 類型 Description
name

string

要用於比較的數據行名稱。

operator

OperatorType

要用於比較的運算符。

values

string[]

要用於比較的值陣列

ReportConfigDataset

報表中存在的數據定義。

名稱 類型 Description
aggregation

<string,  ReportConfigAggregation>

報表中要使用的匯總表達式字典。 字典中每個專案的索引鍵是匯總數據行的別名。 報表最多可以有 2 個匯總子句。

configuration

ReportConfigDatasetConfiguration

具有報表中數據的組態資訊。 如果提供匯總和群組,將會忽略組態。

filter

ReportConfigFilter

在報表中使用篩選表達式。

granularity

ReportGranularityType

報表中數據列的數據粒度。

grouping

ReportConfigGrouping[]

依表達式在報表中使用的群組陣列。 報表最多可以有2個群組 by 子句。

sorting

ReportConfigSorting[]

依表達式在報表中使用的順序數位。

ReportConfigDatasetConfiguration

報表中的數據集組態。

名稱 類型 Description
columns

string[]

要包含在報表中的數據行名稱陣列。 允許任何有效的報表數據行名稱。 如果未提供,則報表會包含所有數據行。

ReportConfigFilter

報表中使用的篩選表達式。

名稱 類型 Description
and

ReportConfigFilter[]

邏輯 「AND」 表達式。 必須至少有2個專案。

dimensions

ReportConfigComparisonExpression

具有維度的比較表達式

or

ReportConfigFilter[]

邏輯 「OR」 表達式。 必須至少有2個專案。

tags

ReportConfigComparisonExpression

具有標記的比較表達式

ReportConfigGrouping

報表中要使用的依表達式分組。

名稱 類型 Description
name

string

要分組的數據行名稱。 此版本支援最低可能的訂用帳戶粒度。

type

QueryColumnType

具有要分組的數據行類型。

ReportConfigSorting

報表中要使用的依表達式順序。

名稱 類型 Description
direction

ReportConfigSortingType

排序方向。

name

string

要排序的數據行名稱。

ReportConfigSortingType

排序方向。

名稱 類型 Description
Ascending

string

Descending

string

ReportConfigTimePeriod

提取報表數據的開始和結束日期。

名稱 類型 Description
from

string

要從中提取數據的開始日期。

to

string

要提取數據的結束日期。

ReportGranularityType

報表中數據列的數據粒度。

名稱 類型 Description
Daily

string

Monthly

string

ReportTimeframeType

提取報表數據的時間範圍。 如果為自定義,則必須提供特定的時間週期。

名稱 類型 Description
Custom

string

MonthToDate

string

WeekToDate

string

YearToDate

string

ReportType

報表的類型。 使用量代表實際使用量、預測代表預測的數據,而 UsageAndForecast 代表使用量和預測數據。 實際使用量和預測數據可以根據日期來區分。

名稱 類型 Description
Usage

string

View

成本分析的狀態和設定。

名稱 類型 Description
eTag

string

資源的 eTag。 若要處理並行更新案例,此字段將用來判斷使用者是否要更新最新版本。

id

string

資源標識碼。

name

string

資源名稱。

properties.accumulated

AccumulatedType

顯示一段時間累積的成本。

properties.chart

ChartType

成本分析中主要檢視的圖表類型。 必要。

properties.createdOn

string

使用者建立此檢視的日期。

properties.currency

string

目前檢視的貨幣。

properties.dateRange

string

目前檢視的日期範圍。

properties.displayName

string

檢視的使用者輸入名稱。 必要。

properties.kpis

KpiProperties[]

要顯示在成本分析UI中的 KPI 清單。

properties.metric

MetricType

顯示成本時要使用的計量。

properties.modifiedOn

string

使用者上次修改此檢視的日期。

properties.pivots

PivotProperties[]

在成本分析UI中設定3個子檢視。

properties.query.dataSet

ReportConfigDataset

具有此報表組態中數據的定義。

properties.query.includeMonetaryCommitment

boolean

如果為 true,報表會包含預付金。

properties.query.timePeriod

ReportConfigTimePeriod

具有提取報表數據的時間週期。

properties.query.timeframe

ReportTimeframeType

提取報表數據的時間範圍。 如果為自定義,則必須提供特定的時間週期。

properties.query.type

ReportType

報表的類型。 使用量代表實際使用量、預測代表預測的數據,而 UsageAndForecast 代表使用量和預測數據。 實際使用量和預測數據可以根據日期來區分。

properties.scope

string

成本管理範圍,以儲存檢視。 這包括訂用帳戶範圍的 'subscriptions/{subscriptionId}', 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{EnrollmentAccount 範圍的 enrollmentAccountId}'、 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{ExternalBillingAccount 範圍的 externalBillingAccountName}',以及 ExternalSubscription 範圍的 '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' 。

type

string

資源類型。

ViewListResult

清單檢視的結果。 其中包含可用的檢視清單。

名稱 類型 Description
nextLink

string

連結 (url) 至下一頁的結果。

value

View[]

檢視的清單。