다음을 통해 공유


Cost Allocation Rules - Get

규칙 이름 및 청구 계정 또는 엔터프라이즈 등록별로 비용 할당 규칙을 가져옵니다.

GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/costAllocationRules/{ruleName}?api-version=2024-08-01

URI 매개 변수

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

string

BillingAccount ID

ruleName
path True

string

pattern: [A-Za-z0-9\-_]+

비용 할당 규칙 이름입니다. 이름에는 공백이나 '_' 및 '-' 이외의 영숫자가 아닌 문자가 포함될 수 없습니다. 최대 길이는 260자입니다.

api-version
query True

string

minLength: 1

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

응답

Name 형식 Description
200 OK

CostAllocationRuleDefinition

그래. 요청이 성공했습니다.

Other Status Codes

ErrorResponse

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

보안

azure_auth

Azure Active Directory OAuth2 Flow.

형식: oauth2
Flow: implicit
권한 부여 URL: https://login.microsoftonline.com/common/oauth2/authorize

범위

Name Description
user_impersonation 사용자 계정 가장

예제

CostAllocationRules

샘플 요청

GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/100/providers/Microsoft.CostManagement/costAllocationRules/testRule?api-version=2024-08-01

샘플 응답

{
  "id": "providers/Microsoft.Billing/billingAccounts/100/providers/Microsoft.CostManagement/costAllocationRules/testRule",
  "name": "testRule",
  "type": "Microsoft.CostManagement/costAllocationRules",
  "properties": {
    "description": "This is a testRule",
    "createdDate": "2020-06-18T22:21:51.1287144Z",
    "updatedDate": "2020-06-18T22:21:51.1287144Z",
    "status": "NotActive",
    "details": {
      "sourceResources": [
        {
          "resourceType": "Dimension",
          "name": "ResourceGroupName",
          "values": [
            "sampleRG"
          ]
        }
      ],
      "targetResources": [
        {
          "resourceType": "Dimension",
          "policyType": "FixedProportion",
          "name": "ResourceGroupName",
          "values": [
            {
              "name": "destinationRG",
              "percentage": 50
            },
            {
              "name": "destinationRG2",
              "percentage": 50
            }
          ]
        }
      ]
    }
  }
}

정의

Name Description
CostAllocationPolicyType

비용을 할당하는 데 사용할 메서드입니다. FixedProportion은 지정된 백분율 값에 따라 비용이 분할됨을 나타냅니다.

CostAllocationProportion

대상 리소스 및 할당

CostAllocationResourceType

할당에 사용할 리소스의 범주입니다.

CostAllocationRuleDefinition

비용 할당 규칙 모델 정의

CostAllocationRuleDetails

비용 할당 규칙의 리소스 세부 정보

CostAllocationRuleProperties

비용 할당 규칙의 속성

ErrorDetails

오류의 세부 정보입니다.

ErrorResponse

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

일부 오류 응답:

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

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

RuleStatus

규칙의 현재 상태입니다.

SourceCostAllocationResource

비용 할당을 위한 원본 리소스

TargetCostAllocationResource

비용 할당을 위한 대상 리소스입니다.

CostAllocationPolicyType

비용을 할당하는 데 사용할 메서드입니다. FixedProportion은 지정된 백분율 값에 따라 비용이 분할됨을 나타냅니다.

Description
FixedProportion

CostAllocationProportion

대상 리소스 및 할당

Name 형식 Description
name

string

비용 할당을 위한 대상 리소스

percentage

number

이 리소스에 할당할 원본 비용의 백분율입니다. 이 값은 10진수 두 자리로 지정할 수 있으며 이 규칙의 모든 리소스의 총 백분율은 100.00으로 합산해야 합니다.

CostAllocationResourceType

할당에 사용할 리소스의 범주입니다.

Description
Dimension

구독 ID 또는 리소스 그룹 이름과 같은 Azure 차원이 할당에 사용되고 있음을 나타냅니다.

Tag

Azure Tag 키 값 쌍에 따라 비용을 할당합니다.

CostAllocationRuleDefinition

비용 할당 규칙 모델 정의

Name 형식 Description
id

string

규칙에 대한 Azure Resource Manager ID입니다. 읽기용 값입니다.

name

string

규칙의 이름입니다. 읽기 전용 값입니다.

properties

CostAllocationRuleProperties

비용 할당 규칙 속성

type

string

규칙의 리소스 종류입니다. Microsoft.CostManagement/CostAllocationRule의 읽기 전용 값입니다.

CostAllocationRuleDetails

비용 할당 규칙의 리소스 세부 정보

Name 형식 Description
sourceResources

SourceCostAllocationResource[]

비용 할당을 위한 원본 리소스입니다. 현재 이 목록에는 하나 이상의 요소가 포함될 수 있습니다.

targetResources

TargetCostAllocationResource[]

비용 할당을 위한 대상 리소스입니다. 현재 이 목록에는 하나 이상의 요소가 포함될 수 있습니다.

CostAllocationRuleProperties

비용 할당 규칙의 속성

Name 형식 Description
createdDate

string (date-time)

규칙이 만들어진 시간입니다. 동일한 리소스에 대한 비용을 변경하는 규칙은 생성 순서대로 적용됩니다.

description

string

비용 할당 규칙에 대한 설명입니다.

details

CostAllocationRuleDetails

비용 할당 규칙에 대한 리소스 정보

status

RuleStatus

규칙의 상태

updatedDate

string (date-time)

규칙이 마지막으로 업데이트된 시간입니다.

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

오류의 세부 정보입니다.

RuleStatus

규칙의 현재 상태입니다.

Description
Active

규칙이 저장되고 비용 할당에 영향을 미칩니다.

NotActive

규칙은 저장되지만 비용을 할당하는 데 사용되지 않습니다.

Processing

규칙이 저장되고 비용 할당이 업데이트됩니다. put 요청에서 제출할 수 없는 읽기 전용 값입니다.

SourceCostAllocationResource

비용 할당을 위한 원본 리소스

Name 형식 Description
name

string

리소스 종류가 차원인 경우 ResourceGroupName 또는 SubscriptionId여야 합니다. 리소스 종류가 태그인 경우 유효한 Azure 태그여야 합니다.

resourceType

CostAllocationResourceType

이 비용 할당 규칙에 포함된 리소스 유형

values

string[]

비용 할당을 위한 원본 리소스입니다. 이 목록에는 25개 이상의 값이 포함될 수 없습니다.

TargetCostAllocationResource

비용 할당을 위한 대상 리소스입니다.

Name 형식 Description
name

string

리소스 종류가 차원인 경우 ResourceGroupName 또는 SubscriptionId여야 합니다. 리소스 종류가 태그인 경우 유효한 Azure 태그여야 합니다.

policyType

CostAllocationPolicyType

규칙에 대한 비용 할당 방법

resourceType

CostAllocationResourceType

이 비용 할당 규칙에 포함된 리소스 유형

values

CostAllocationProportion[]

비용 할당을 위한 대상 리소스입니다. 이 목록에는 25개 이상의 값이 포함될 수 없습니다.