Query - Usage By External Cloud Provider Type
定義されている外部クラウド プロバイダーの種類の使用状況データに対してクエリを実行します。
POST https://management.azure.com/providers/Microsoft.CostManagement/{externalCloudProviderType}/{externalCloudProviderId}/query?api-version=2023-11-01
URI パラメーター
名前 | / | 必須 | 型 | 説明 |
---|---|---|---|---|
external
|
path | True |
string |
これは、リンクされたアカウントの場合は '{externalSubscriptionId}'、ディメンション/クエリ操作で使用される統合アカウントの場合は '{externalBillingAccountId}' にすることができます。 |
external
|
path | True |
ディメンション/クエリ操作に関連付けられている外部クラウド プロバイダーの種類。 これには、リンクされたアカウントの 'externalSubscriptions' と統合アカウントの 'externalBillingAccounts' が含まれます。 |
|
api-version
|
query | True |
string |
この操作に使用する API バージョン。 |
要求本文
名前 | 必須 | 型 | 説明 |
---|---|---|---|
dataset | True |
このクエリのデータの定義があります。 |
|
timeframe | True |
クエリのデータをプルする期間。 カスタムの場合は、特定の期間を指定する必要があります。 |
|
type | True |
クエリの種類。 |
|
timePeriod |
クエリのデータをプルするための期間があります。 |
応答
名前 | 型 | 説明 |
---|---|---|
200 OK |
OK です。 要求は成功しました。 |
|
Other Status Codes |
操作に失敗した理由を説明するエラー応答。 |
セキュリティ
azure_auth
Azure Active Directory OAuth2 フロー。
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名前 | 説明 |
---|---|
user_impersonation | ユーザー アカウントの借用 |
例
External |
External |
ExternalBillingAccountQueryList
Sample Request
POST https://management.azure.com/providers/Microsoft.CostManagement/externalBillingAccounts/100/query?api-version=2023-11-01
{
"type": "Usage",
"timeframe": "MonthToDate",
"dataset": {
"granularity": "Daily",
"filter": {
"and": [
{
"or": [
{
"dimensions": {
"name": "ResourceLocation",
"operator": "In",
"values": [
"East US",
"West Europe"
]
}
},
{
"tags": {
"name": "Environment",
"operator": "In",
"values": [
"UAT",
"Prod"
]
}
}
]
},
{
"dimensions": {
"name": "ResourceGroup",
"operator": "In",
"values": [
"API"
]
}
}
]
}
}
}
Sample Response
{
"id": "providers/Microsoft.CostManagement/externalBillingAccounts/100/query/6dc7b06a-d90a-4df5-b655-ce6cf1c0814d",
"name": "6dc7b06a-d90a-4df5-b655-ce6cf1c0814d",
"type": "Microsoft.CostManagement/query",
"properties": {
"nextLink": null,
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "ServiceName",
"type": "String"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": [
[
0,
"abc db",
"USD"
],
[
30.2572751438,
"abc compute cloud",
"USD"
],
[
0.07675760200000002,
"abc file system",
"USD"
],
[
50.43096419040001,
"abc elasticache",
"USD"
]
]
}
}
ExternalSubscriptionsQuery
Sample Request
POST https://management.azure.com/providers/Microsoft.CostManagement/externalSubscriptions/100/query?api-version=2023-11-01
{
"type": "Usage",
"timeframe": "MonthToDate",
"dataset": {
"granularity": "Daily",
"filter": {
"and": [
{
"or": [
{
"dimensions": {
"name": "ResourceLocation",
"operator": "In",
"values": [
"East US",
"West Europe"
]
}
},
{
"tags": {
"name": "Environment",
"operator": "In",
"values": [
"UAT",
"Prod"
]
}
}
]
},
{
"dimensions": {
"name": "ResourceGroup",
"operator": "In",
"values": [
"API"
]
}
}
]
}
}
}
Sample Response
{
"id": "providers/Microsoft.CostManagement/externalSubscriptions/100/query/d99477af-7510-40ee-aca2-e59bdca0d10d",
"name": "d99477af-7510-40ee-aca2-e59bdca0d10d",
"type": "Microsoft.CostManagement/query",
"properties": {
"nextLink": null,
"columns": [
{
"name": "PreTaxCost",
"type": "Number"
},
{
"name": "UsageDate",
"type": "Number"
},
{
"name": "Currency",
"type": "String"
}
],
"rows": []
}
}
定義
名前 | 説明 |
---|---|
Error |
エラーの詳細。 |
Error |
エラー応答は、サービスが受信要求を処理できないことを示します。 理由は、エラー メッセージに表示されます。 いくつかのエラー応答:
|
Export |
クエリの種類。 |
external |
ディメンション/クエリ操作に関連付けられている外部クラウド プロバイダーの種類。 これには、リンクされたアカウントの 'externalSubscriptions' と統合アカウントの 'externalBillingAccounts' が含まれます。 |
Function |
使用する集計関数の名前。 |
Granularity |
予測の行の粒度。 |
Query |
クエリで使用する集計式。 |
Query |
QueryColumn プロパティ |
Query |
エクスポート内の列の型。 |
Query |
クエリで使用する比較式。 |
Query |
クエリに存在するデータの定義。 |
Query |
クエリ内のデータセットの構成。 |
Query |
クエリの定義。 |
Query |
エクスポートで使用するフィルター式。 |
Query |
クエリで使用するグループ化式。 |
Query |
比較に使用する演算子。 |
Query |
クエリの結果。 グループ化と集計の下に一覧表示されているすべての列が含まれます。 |
Query |
クエリのデータをプルするための開始日と終了日。 |
Timeframe |
クエリのデータをプルする期間。 カスタムの場合は、特定の期間を指定する必要があります。 |
ErrorDetails
エラーの詳細。
名前 | 型 | 説明 |
---|---|---|
code |
string |
エラー コード。 |
message |
string |
操作が失敗した理由を示すエラー メッセージ。 |
ErrorResponse
エラー応答は、サービスが受信要求を処理できないことを示します。 理由は、エラー メッセージに表示されます。
いくつかのエラー応答:
429 TooManyRequests - 要求が調整されました。 "x-ms-ratelimit-microsoft.consumption-retry-after" ヘッダーで指定された時間を待ってから再試行します。
503 ServiceUnavailable - サービスは一時的に使用できません。 "Retry-After" ヘッダーで指定された時刻まで待ってから、再試行してください。
名前 | 型 | 説明 |
---|---|---|
error |
エラーの詳細。 |
ExportType
クエリの種類。
名前 | 型 | 説明 |
---|---|---|
ActualCost |
string |
|
AmortizedCost |
string |
|
Usage |
string |
externalCloudProviderType
ディメンション/クエリ操作に関連付けられている外部クラウド プロバイダーの種類。 これには、リンクされたアカウントの 'externalSubscriptions' と統合アカウントの 'externalBillingAccounts' が含まれます。
名前 | 型 | 説明 |
---|---|---|
externalBillingAccounts |
string |
|
externalSubscriptions |
string |
FunctionType
使用する集計関数の名前。
名前 | 型 | 説明 |
---|---|---|
Sum |
string |
GranularityType
予測の行の粒度。
名前 | 型 | 説明 |
---|---|---|
Daily |
string |
QueryAggregation
クエリで使用する集計式。
名前 | 型 | 説明 |
---|---|---|
function |
使用する集計関数の名前。 |
|
name |
string |
集計する列の名前。 |
QueryColumn
QueryColumn プロパティ
名前 | 型 | 説明 |
---|---|---|
name |
string |
列の名前。 |
type |
string |
列の型。 |
QueryColumnType
エクスポート内の列の型。
名前 | 型 | 説明 |
---|---|---|
Dimension |
string |
コスト データのディメンション。 |
TagKey |
string |
コスト データに関連付けられているタグ。 |
QueryComparisonExpression
クエリで使用する比較式。
名前 | 型 | 説明 |
---|---|---|
name |
string |
比較に使用する列の名前。 |
operator |
比較に使用する演算子。 |
|
values |
string[] |
比較に使用する値の配列 |
QueryDataset
クエリに存在するデータの定義。
名前 | 型 | 説明 |
---|---|---|
aggregation |
<string,
Query |
クエリで使用する集計式のディクショナリ。 ディクショナリ内の各項目のキーは、集計列の別名です。 クエリには、最大 2 つの集計句を含めることができます。 |
configuration |
エクスポート内のデータの構成情報があります。 集計とグループ化が指定されている場合、構成は無視されます。 |
|
filter |
クエリで使用するフィルター式。 フィルターを適切に書式設定する方法については、クエリ API REST のドキュメントを参照してください。 |
|
granularity |
クエリ内の行の粒度。 |
|
grouping |
クエリで使用するグループ化式の配列。 クエリには、句ごとに最大 2 つのグループを含めることができます。 |
QueryDatasetConfiguration
クエリ内のデータセットの構成。
名前 | 型 | 説明 |
---|---|---|
columns |
string[] |
クエリに含める列名の配列。 任意の有効なクエリ列名を使用できます。 指定しない場合、クエリにはすべての列が含まれます。 |
QueryDefinition
クエリの定義。
名前 | 型 | 説明 |
---|---|---|
dataset |
このクエリのデータの定義があります。 |
|
timePeriod |
クエリのデータをプルするための期間があります。 |
|
timeframe |
クエリのデータをプルする期間。 カスタムの場合は、特定の期間を指定する必要があります。 |
|
type |
クエリの種類。 |
QueryFilter
エクスポートで使用するフィルター式。
名前 | 型 | 説明 |
---|---|---|
and |
論理 "AND" 式。 少なくとも 2 つの項目が必要です。 |
|
dimensions |
ディメンションの比較式がある |
|
or |
論理 "OR" 式。 少なくとも 2 つの項目が必要です。 |
|
tags |
タグの比較式がある |
QueryGrouping
クエリで使用するグループ化式。
名前 | 型 | 説明 |
---|---|---|
name |
string |
グループ化する列の名前。 |
type |
グループ化する列の型を持っています。 |
QueryOperatorType
比較に使用する演算子。
名前 | 型 | 説明 |
---|---|---|
In |
string |
QueryResult
クエリの結果。 グループ化と集計の下に一覧表示されているすべての列が含まれます。
名前 | 型 | 説明 |
---|---|---|
eTag |
string |
リソースの ETag。 |
id |
string |
リソース ID。 |
location |
string |
リソースの場所。 |
name |
string |
リソース名。 |
properties.columns |
列の配列 |
|
properties.nextLink |
string |
結果の次のページへのリンク (URL)。 |
properties.rows |
Rows[] |
行の配列 |
sku |
string |
リソースの SKU。 |
tags |
object |
リソース タグ。 |
type |
string |
リソースの種類。 |
QueryTimePeriod
クエリのデータをプルするための開始日と終了日。
名前 | 型 | 説明 |
---|---|---|
from |
string |
データをプルする開始日。 |
to |
string |
データをプルする終了日。 |
TimeframeType
クエリのデータをプルする期間。 カスタムの場合は、特定の期間を指定する必要があります。
名前 | 型 | 説明 |
---|---|---|
BillingMonthToDate |
string |
|
Custom |
string |
|
MonthToDate |
string |
|
TheLastBillingMonth |
string |
|
TheLastMonth |
string |
|
WeekToDate |
string |