Views - Create Or Update By Scope

뷰를 만들거나 업데이트하는 작업입니다. 업데이트 작업을 수행하려면 요청에 최신 eTag를 설정해야 합니다. get 작업을 수행하여 최신 eTag를 가져올 수 있습니다. 만들기 작업에는 eTag가 필요하지 않습니다.

PUT https://management.azure.com/{scope}/providers/Microsoft.CostManagement/views/{viewName}?api-version=2023-11-01

URI 매개 변수

Name In(다음 안에) 필수 형식 Description
scope
path True

string

보기 작업과 연결된 scope. 여기에는 구독 scope 대한 'subscriptions/{subscriptionId}'가 포함됩니다. 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' scope, 청구 계정 scope 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}', 부서 scope 대한 'providers/Microsoft.Billing/billingAccountId}/{departmentId}'EnrollmentAccount scope 대한 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' BillingProfile scope 대한 'providers/Microsoft.Billing/billingAccountId}/{billingAccountId}/{billingProfileId}' , InvoiceSection scope 대한 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSectionSectionId}', 관리 그룹 scope 대한 'providers/Microsoft.Management/managementGroups/{managementGroupId}', 외부 청구 계정 scope 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}'의 경우 'providers/Microsoft.CostManagement/externalBillingAccountName}' scope.

viewName
path True

string

뷰 이름

api-version
query True

string

이 작업에 사용할 API 버전입니다.

요청 본문

Name 필수 형식 Description
properties.query.timeframe True

ReportTimeframeType

보고서의 데이터를 끌어당기는 시간 프레임입니다. 사용자 지정하는 경우 특정 기간을 제공해야 합니다.

properties.query.type True

ReportType

보고서의 형식입니다. 사용량은 실제 사용량을 나타내고 예측은 예측 데이터를 나타내고 UsageAndForecast는 사용량 및 예측 데이터를 모두 나타냅니다. 실제 사용량 및 예측 데이터는 날짜를 기준으로 구분할 수 있습니다.

eTag

string

리소스의 eTag입니다. 동시 업데이트 시나리오를 처리하기 위해 이 필드는 사용자가 최신 버전을 업데이트하고 있는지 여부를 확인하는 데 사용됩니다.

properties.accumulated

AccumulatedType

시간이 지남에 따라 누적된 비용을 표시합니다.

properties.chart

ChartType

비용 분석에서 기본 보기의 차트 유형입니다. 필수 사항입니다.

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.scope

string

Cost Management scope 보기를 저장합니다. 여기에는 구독 scope 대한 'subscriptions/{subscriptionId}'가 포함됩니다. 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' scope, 청구 계정 scope 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}', 부서 scope 대한 'providers/Microsoft.Billing/billingAccountId}/{departmentId}'EnrollmentAccount scope 대한 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' BillingProfile scope 대한 'providers/Microsoft.Billing/billingAccountId}/{billingAccountId}/{billingProfileId}' , InvoiceSection scope 대한 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSectionSectionId}', 관리 그룹 scope 대한 'providers/Microsoft.Management/managementGroups/{managementGroupId}' , ExternalBillingAccount scope 대한 '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' 및 ExternalSubscription scope 대한 '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}'

응답

Name 형식 Description
200 OK

View

OK. 요청이 성공했습니다.

201 Created

View

만들어졌습니다.

Other Status Codes

ErrorResponse

작업이 실패한 이유를 설명하는 오류 응답입니다.

보안

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation 사용자 계정 가장

예제

ResourceGroupCreateOrUpdateView

Sample Request

PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/views/swaggerExample?api-version=2023-11-01

{
  "eTag": "\"1d4ff9fe66f1d10\"",
  "properties": {
    "displayName": "swagger Example",
    "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"
      }
    ]
  }
}

Sample Response

{
  "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/views/swaggerExample",
  "name": "swaggerExample",
  "type": "Microsoft.CostManagement/Views",
  "eTag": "\"1d4ffa5a9c2430c\"",
  "properties": {
    "displayName": "swagger Example",
    "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG",
    "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": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/views/swaggerExample",
  "name": "swaggerExample",
  "type": "Microsoft.CostManagement/Views",
  "eTag": "\"1d4ffa5a9c2430c\"",
  "properties": {
    "displayName": "swagger Example",
    "scope": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG",
    "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"
      }
    ]
  }
}

정의

Name 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

비용 분석의 상태 및 구성입니다.

AccumulatedType

시간이 지남에 따라 누적된 비용을 표시합니다.

Name 형식 Description
false

string

true

string

ChartType

비용 분석에서 기본 보기의 차트 종류입니다. 필수 사항입니다.

Name 형식 Description
Area

string

GroupedColumn

string

Line

string

StackedColumn

string

Table

string

ErrorDetails

오류의 세부 정보입니다.

Name 형식 Description
code

string

오류 코드

message

string

작업이 실패한 이유를 나타내는 오류 메시지입니다.

ErrorResponse

오류 응답은 서비스가 들어오는 요청을 처리할 수 없음을 나타냅니다. 그 이유는 오류 메시지에 제공됩니다.

일부 오류 응답:

  • 429 TooManyRequests - 요청이 제한됩니다. "x-ms-ratelimit-microsoft.consumption-retry-after" 헤더에 지정된 시간을 기다린 후 다시 시도합니다.

  • 503 ServiceUnavailable - 서비스를 일시적으로 사용할 수 없습니다. "Retry-After" 헤더에 지정된 시간 동안 기다린 후 다시 시도합니다.

Name 형식 Description
error

ErrorDetails

오류의 세부 정보입니다.

FunctionType

사용할 집계 함수의 이름입니다.

Name 형식 Description
Sum

string

KpiProperties

각 KPI에는 'type' 및 'enabled' 키가 포함되어야 합니다.

Name 형식 Description
enabled

boolean

UI에 KPI를 표시합니까?

id

string

메트릭(예산)과 관련된 리소스의 ID입니다.

type

KpiTypeType

KPI 유형(예측, 예산).

KpiTypeType

KPI 유형(예측, 예산).

Name 형식 Description
Budget

string

Forecast

string

MetricType

비용을 표시할 때 사용할 메트릭입니다.

Name 형식 Description
AHUB

string

ActualCost

string

AmortizedCost

string

OperatorType

비교에 사용할 연산자입니다.

Name 형식 Description
Contains

string

In

string

PivotProperties

각 피벗에는 'type' 및 'name'이 포함되어야 합니다.

Name 형식 Description
name

string

보기에 표시할 데이터 필드입니다.

type

PivotTypeType

보기에 표시할 데이터 형식입니다.

PivotTypeType

보기에 표시할 데이터 형식입니다.

Name 형식 Description
Dimension

string

TagKey

string

QueryColumnType

내보내기에서 열의 형식입니다.

Name 형식 Description
Dimension

string

비용 데이터의 차원입니다.

TagKey

string

비용 데이터와 연결된 태그입니다.

ReportConfigAggregation

보고서에 사용할 집계 식입니다.

Name 형식 Description
function

FunctionType

사용할 집계 함수의 이름입니다.

name

string

집계할 열의 이름입니다.

ReportConfigComparisonExpression

보고서에서 사용할 비교 식입니다.

Name 형식 Description
name

string

비교할 열의 이름입니다.

operator

OperatorType

비교에 사용할 연산자입니다.

values

string[]

비교에 사용할 값의 배열

ReportConfigDataset

보고서에 있는 데이터의 정의입니다.

Name 형식 Description
aggregation

<string,  ReportConfigAggregation>

보고서에 사용할 집계 식의 사전입니다. 사전에 있는 각 항목의 키는 집계된 열의 별칭입니다. 보고서에는 최대 2개의 집계 절이 있을 수 있습니다.

configuration

ReportConfigDatasetConfiguration

보고서의 데이터에 대한 구성 정보가 있습니다. 집계 및 그룹화가 제공되면 구성이 무시됩니다.

filter

ReportConfigFilter

보고서에 사용할 필터 식이 있습니다.

granularity

ReportGranularityType

보고서의 행 세분성입니다.

grouping

ReportConfigGrouping[]

보고서에 사용할 식별 그룹 배열입니다. 보고서에는 절별로 최대 2개의 그룹화가 있을 수 있습니다.

sorting

ReportConfigSorting[]

보고서에 사용할 식별 순서 배열입니다.

ReportConfigDatasetConfiguration

보고서의 데이터 세트 구성입니다.

Name 형식 Description
columns

string[]

보고서에 포함할 열 이름의 배열입니다. 유효한 보고서 열 이름이 허용됩니다. 제공되지 않으면 보고서에 모든 열이 포함됩니다.

ReportConfigFilter

보고서에 사용할 필터 식입니다.

Name 형식 Description
and

ReportConfigFilter[]

논리적 "AND" 식입니다. 항목이 2개 이상 있어야 합니다.

dimensions

ReportConfigComparisonExpression

차원에 대한 비교 식이 있습니다.

or

ReportConfigFilter[]

논리적 "OR" 식입니다. 항목이 2개 이상 있어야 합니다.

tags

ReportConfigComparisonExpression

태그에 대한 비교 식이 있습니다.

ReportConfigGrouping

보고서에 사용할 식별 그룹입니다.

Name 형식 Description
name

string

그룹화할 열의 이름입니다. 이 버전은 가능한 가장 낮은 구독 조직을 지원합니다.

type

QueryColumnType

그룹화할 열의 형식이 있습니다.

ReportConfigSorting

보고서에 사용할 식별 순서입니다.

Name 형식 Description
direction

ReportConfigSortingType

정렬 방향입니다.

name

string

정렬할 열의 이름입니다.

ReportConfigSortingType

정렬 방향입니다.

Name 형식 Description
Ascending

string

Descending

string

ReportConfigTimePeriod

보고서의 데이터를 끌어올리기 위한 시작 및 종료 날짜입니다.

Name 형식 Description
from

string

데이터를 끌어올 시작 날짜입니다.

to

string

데이터를 끌어올 종료 날짜입니다.

ReportGranularityType

보고서의 행 세분성입니다.

Name 형식 Description
Daily

string

Monthly

string

ReportTimeframeType

보고서의 데이터를 끌어당기는 시간 프레임입니다. 사용자 지정하는 경우 특정 기간을 제공해야 합니다.

Name 형식 Description
Custom

string

MonthToDate

string

WeekToDate

string

YearToDate

string

ReportType

보고서의 형식입니다. 사용량은 실제 사용량을 나타내고 예측은 예측 데이터를 나타내고 UsageAndForecast는 사용량 및 예측 데이터를 모두 나타냅니다. 실제 사용량 및 예측 데이터는 날짜를 기준으로 구분할 수 있습니다.

Name 형식 Description
Usage

string

View

비용 분석의 상태 및 구성입니다.

Name 형식 Description
eTag

string

리소스의 eTag입니다. 동시 업데이트 시나리오를 처리하기 위해 이 필드는 사용자가 최신 버전을 업데이트하는지 여부를 확인하는 데 사용됩니다.

id

string

리소스 ID입니다.

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

Cost Management scope 보기를 저장합니다. 여기에는 구독 scope 대한 'subscriptions/{subscriptionId}'가 포함됩니다. 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' resourceGroup scope, 청구 계정 scope 'providers/Microsoft.Billing/billingAccountId}', 부서 scope 대한 'providers/Microsoft.Billing/billingAccountId}/{departmentId}', EnrollmentAccount scope 대한 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' BillingProfile scope 대한 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/{billingProfileId}' , InvoiceSection scope 대한 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/{invoiceSectionId}', 관리 그룹 scope 대한 'providers/Microsoft.Management/managementGroups/{managementGroupId}', ExternalBillingAccount scope '/providers/Microsoft.CostManagement/externalBillingAccountName}' 및 ExternalSubscription scope 대한 '/providers/Microsoft.CostManagement/externalSubscriptionName}'

type

string

리소스 종류.