通过


你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Savings Plans - Get By Billing Account

按计费帐户获取储蓄计划。

GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}?api-version=2024-04-01
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/savingsPlanOrders/{savingsPlanOrderId}/savingsPlans/{savingsPlanId}?api-version=2024-04-01&expand={expand}

URI 参数

名称 必需 类型 说明
billingAccountName
path True

string

pattern: ^([0-9]+|([Pp][Cc][Nn]\.[A-Za-z0-9]+)|[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}(:[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}_[0-9]{4}(-[0-9]{2}){2})?)$

唯一标识计费帐户的 ID。

savingsPlanId
path True

string

节省计划的 ID

savingsPlanOrderId
path True

string

保存计划的顺序 ID

api-version
query True

string

minLength: 1

用于此作的 API 版本。

expand
query

string

可用于扩展 planInformation。

响应

名称 类型 说明
200 OK

SavingsPlanModel

Azure 运营顺利完成。

Other Status Codes

ErrorResponse

意外的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

SavingsPlanGet
SavingsPlanGetExpandRenewProperties

SavingsPlanGet

示例请求

GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000?api-version=2024-04-01

示例响应

{
  "name": "30000000-0000-0000-0000-000000000000",
  "type": "microsoft.billing/billingAccounts/savingsPlanOrders/savingsPlans",
  "id": "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000",
  "properties": {
    "appliedScopeProperties": {
      "displayName": "TestRg",
      "managementGroupId": "/providers/Microsoft.Management/managementGroups/TestRg",
      "tenantId": "70000000-0000-0000-0000-000000000000"
    },
    "appliedScopeType": "ManagementGroup",
    "benefitStartTime": "2022-11-16T02:25:11.7183866Z",
    "billingAccountId": "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31",
    "billingPlan": "P1M",
    "billingProfileId": "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/AAAA-BBBB-CCC-DDD",
    "billingScopeId": "/subscriptions/50000000-0000-0000-0000-000000000000",
    "commitment": {
      "amount": 0.001,
      "currencyCode": "USD",
      "grain": "Hourly"
    },
    "displayName": "SP1",
    "displayProvisioningState": "NoBenefit",
    "effectiveDateTime": "2022-12-16T01:35:36.2909462Z",
    "expiryDateTime": "2025-11-16T02:25:11.7183866Z",
    "productCode": "20000000-0000-0000-0000-000000000005",
    "provisioningState": "Succeeded",
    "purchaseDateTime": "2022-11-16T02:23:21.3864783Z",
    "renew": false,
    "term": "P3Y",
    "userFriendlyAppliedScopeType": "ManagementGroup",
    "utilization": {
      "aggregates": [
        {
          "grain": 1,
          "grainUnit": "days",
          "value": 0,
          "valueUnit": "percentage"
        },
        {
          "grain": 7,
          "grainUnit": "days",
          "value": 0,
          "valueUnit": "percentage"
        },
        {
          "grain": 30,
          "grainUnit": "days",
          "value": 0,
          "valueUnit": "percentage"
        }
      ],
      "trend": "SAME"
    }
  },
  "sku": {
    "name": "Compute_Savings_Plan"
  },
  "tags": {
    "key1": "value1",
    "key2": "value2"
  }
}

SavingsPlanGetExpandRenewProperties

示例请求

GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000?api-version=2024-04-01

示例响应

{
  "name": "30000000-0000-0000-0000-000000000000",
  "type": "microsoft.billing/billingAccounts/savingsPlanOrders/savingsPlans",
  "id": "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/savingsPlanOrders/20000000-0000-0000-0000-000000000000/savingsPlans/30000000-0000-0000-0000-000000000000",
  "properties": {
    "appliedScopeProperties": {
      "displayName": "TestRg",
      "managementGroupId": "/providers/Microsoft.Management/managementGroups/TestRg",
      "tenantId": "70000000-0000-0000-0000-000000000000"
    },
    "appliedScopeType": "ManagementGroup",
    "benefitStartTime": "2022-11-16T02:25:11.7183866Z",
    "billingAccountId": "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31",
    "billingPlan": "P1M",
    "billingProfileId": "/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/AAAA-BBBB-CCC-DDD",
    "billingScopeId": "/subscriptions/50000000-0000-0000-0000-000000000000",
    "commitment": {
      "amount": 0.001,
      "currencyCode": "USD",
      "grain": "Hourly"
    },
    "displayName": "SP1",
    "displayProvisioningState": "NoBenefit",
    "effectiveDateTime": "2022-12-16T01:35:36.2909462Z",
    "expiryDateTime": "2025-11-16T02:25:11.7183866Z",
    "productCode": "20000000-0000-0000-0000-000000000005",
    "provisioningState": "Succeeded",
    "purchaseDateTime": "2022-11-16T02:23:21.3864783Z",
    "renew": false,
    "renewProperties": {
      "purchaseProperties": {
        "properties": {
          "appliedScopeProperties": {
            "managementGroupId": "/providers/Microsoft.Management/managementGroups/TestRg",
            "tenantId": "70000000-0000-0000-0000-000000000000"
          },
          "appliedScopeType": "ManagementGroup",
          "billingPlan": "Monthly",
          "billingScopeId": "/subscriptions/50000000-0000-0000-0000-000000000000",
          "commitment": {
            "amount": 0.001,
            "currencyCode": "USD",
            "grain": "Hourly"
          },
          "displayName": "SP1_renewed",
          "term": "P3Y"
        },
        "sku": {
          "name": "Compute_Savings_Plan"
        }
      }
    },
    "term": "P3Y",
    "userFriendlyAppliedScopeType": "ManagementGroup",
    "utilization": {
      "aggregates": [
        {
          "grain": 1,
          "grainUnit": "days",
          "value": 0,
          "valueUnit": "percentage"
        },
        {
          "grain": 7,
          "grainUnit": "days",
          "value": 0,
          "valueUnit": "percentage"
        },
        {
          "grain": 30,
          "grainUnit": "days",
          "value": 0,
          "valueUnit": "percentage"
        }
      ],
      "trend": "SAME"
    }
  },
  "sku": {
    "name": "Compute_Savings_Plan"
  },
  "tags": {
    "key1": "value1",
    "key2": "value2"
  }
}

定义

名称 说明
AppliedScopeProperties

特定于应用的范围类型的属性。 如果不适用,则不需要。

AppliedScopeType

应用的作用域的类型。

BillingPlan

表示 ISO 8601 格式的计费计划。 仅每月购买所必需的。

Commitment

承诺实现权益。

CommitmentGrain

承诺粒度。

createdByType

创建资源的标识的类型。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

ExtendedStatusInfo

扩展状态信息

ProvisioningState

资源在长期运行操作中的配置状态。

PurchaseRequest

购买请求。

RenewProperties

特定于续订的属性。

SavingsPlanModel

储蓄计划

SavingsPlanTerm

表示 ISO 8601 格式的“储蓄计划”术语。

Sku

要为此资源应用的 SKU

systemData

与创建和上次修改资源相关的元数据。

Utilization

节省计划利用率

UtilizationAggregates

节省计划利用率的聚合值

AppliedScopeProperties

特定于应用的范围类型的属性。 如果不适用,则不需要。

名称 类型 说明
displayName

string

显示名称

managementGroupId

string

应用权益的管理组的完全限定标识符。

resourceGroupId

string

应用权益的资源组的完全限定标识符。

subscriptionId

string

应用权益的订阅的完全限定标识符。

tenantId

string

应用权益的节省计划所在的租户 ID。

AppliedScopeType

应用的作用域的类型。

说明
Single

Single

Shared

共享

ManagementGroup

ManagementGroup

BillingPlan

表示 ISO 8601 格式的计费计划。 仅每月购买所必需的。

说明
P1M

P1M

Commitment

承诺实现权益。

名称 类型 说明
amount

number (double)

currencyCode

string

此购买记录使用的货币的 ISO 4217 3 字母货币代码。

grain

CommitmentGrain

承诺粒度。

CommitmentGrain

承诺粒度。

说明
Hourly

每小时

createdByType

创建资源的标识的类型。

说明
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

ExtendedStatusInfo

扩展状态信息

名称 类型 说明
message

string

该消息提供有关状态代码的详细信息。

properties.subscriptionId

string

信用额度检查失败的订阅。

statusCode

string

提供其他信息的状态代码。

ProvisioningState

资源在长期运行操作中的配置状态。

说明
Succeeded

成功

Canceled

已取消

Failed

Failed

New

新增内容

Pending

待处理

Provisioning

Provisioning

PendingBilling

待定账单

ConfirmedBilling

确认账单

Creating

创建

Created

已创建

Expired

已过期

PurchaseRequest

购买请求。

名称 类型 默认值 说明
properties.appliedScopeProperties

AppliedScopeProperties

特定于应用的范围类型的属性。 如果不适用,则不需要。

properties.appliedScopeType

AppliedScopeType

应用的作用域的类型。

properties.billingPlan

BillingPlan

表示 ISO 8601 格式的计费计划。 仅每月购买所必需的。

properties.billingScopeId

string

购买 SavingsPlan 时需付费的订阅

properties.commitment

Commitment

承诺实现权益。

properties.displayName

string

储蓄计划的友好名称

properties.renew

boolean

False

将此项设置为 true 将在到期日期时间自动购买新权益。

properties.term

SavingsPlanTerm

表示 ISO 8601 格式的“储蓄计划”术语。

sku

Sku

要为此资源应用的 SKU

RenewProperties

特定于续订的属性。

名称 类型 说明
purchaseProperties

PurchaseRequest

购买请求。

SavingsPlanModel

储蓄计划

名称 类型 默认值 说明
id

string (arm-id)

资源的完全限定资源 ID。 例如“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}”

name

string

资源的名称

properties.appliedScopeProperties

AppliedScopeProperties

特定于应用的范围类型的属性。 如果不适用,则不需要。

properties.appliedScopeType

AppliedScopeType

应用的作用域的类型。

properties.benefitStartTime

string (date-time)

这是储蓄计划权益启动时的 DateTime。

properties.billingAccountId

string

应用储蓄计划的计费帐户的完全限定标识符。

properties.billingPlan

BillingPlan

表示 ISO 8601 格式的计费计划。 仅每月购买所必需的。

properties.billingProfileId

string

应用储蓄计划的计费配置文件的完全限定标识符。 仅针对字段主导或客户主导的客户提供。

properties.billingScopeId

string

购买 SavingsPlan 时需付费的订阅

properties.commitment

Commitment

承诺实现权益。

properties.customerId

string

应用储蓄计划的客户完全限定的标识符。 仅适用于合作伙伴主导的客户。

properties.displayName

string

显示名称

properties.displayProvisioningState

string

用于显示的保存计划的预配状态,例如成功

properties.effectiveDateTime

string (date-time)

从此版本生效时开始的保存计划的 DateTime。

properties.expiryDateTime

string (date-time)

这是节省计划到期的日期时间。

properties.extendedStatusInfo

ExtendedStatusInfo

扩展状态信息

properties.productCode

string

表示 UPN

properties.provisioningState

ProvisioningState

资源在长期运行操作中的配置状态。

properties.purchaseDateTime

string (date-time)

购买储蓄计划的日期时间。

properties.renew

boolean

False

将此项设置为 true 将在到期日期时间自动购买新权益。

properties.renewDestination

string

由于续订而购买的 SavingsPlan 的 SavingsPlan ID。

properties.renewProperties

RenewProperties

特定于续订的属性。

properties.renewSource

string

从中续订此 SavingsPlan 的 SavingsPlan 的 SavingsPlan ID。

properties.term

SavingsPlanTerm

表示 ISO 8601 格式的“储蓄计划”术语。

properties.userFriendlyAppliedScopeType

string

用于显示的储蓄计划的已应用范围类型,例如共享

properties.utilization

Utilization

节省计划利用率

sku

Sku

节省计划 SKU

systemData

systemData

包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。

tags

object

与资源关联的元数据字典。 它可能不会针对所有资源类型进行填充。 支持的最大键/值长度为 256 个字符。 键/值不应为空值,也不应为 null。 键不能包含 <> % & \ ? /

type

string

资源的类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

SavingsPlanTerm

表示 ISO 8601 格式的“储蓄计划”术语。

说明
P1Y

P1Y

P3Y

P3Y

P5Y

P5Y

Sku

要为此资源应用的 SKU

名称 类型 说明
name

string

要应用的 SKU 的名称

systemData

与创建和上次修改资源相关的元数据。

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

上次修改的资源时间戳(UTC)

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

上次修改资源的标识的类型。

Utilization

节省计划利用率

名称 类型 说明
aggregates

UtilizationAggregates[]

节省计划利用率聚合的数组

trend

string

节省计划利用率的趋势

UtilizationAggregates

节省计划利用率的聚合值

名称 类型 说明
grain

number (float)

聚合的粒度

grainUnit

string

聚合的粒度单位

value

number (float)

聚合值

valueUnit

string

聚合值单位