Создайте план экономии. Дополнительные сведения о разрешениях, необходимых в https://go.microsoft.com/fwlink/?linkid=2215851
PUT https://management.azure.com/providers/Microsoft.BillingBenefits/savingsPlanOrderAliases/{savingsPlanOrderAliasName}?api-version=2022-11-01
Параметры URI
Имя |
В |
Обязательно |
Тип |
Описание |
savingsPlanOrderAliasName
|
path |
True
|
string
pattern: ^[a-zA-Z0-9_\-\.]+$
|
Имя псевдонима заказа плана экономии
|
api-version
|
query |
True
|
string
|
Версия API, используемая службой
|
Текст запроса
Имя |
Обязательно |
Тип |
Описание |
sku
|
True
|
Sku
|
Номер SKU плана экономии
|
kind
|
|
string
|
Тип поставщика ресурсов
|
properties.appliedScopeProperties
|
|
AppliedScopeProperties
|
Свойства, относящиеся к примененным типу области. Не требуется, если применимо.
|
properties.appliedScopeType
|
|
AppliedScopeType
|
Тип примененной области.
|
properties.billingPlan
|
|
BillingPlan
|
Представляет план выставления счетов в формате ISO 8601. Требуется только для ежемесячных планов выставления счетов.
|
properties.billingScopeId
|
|
string
|
Подписка, которая будет взиматься за приобретение преимущества
|
properties.commitment
|
|
Commitment
|
Приверженность преимуществам.
|
properties.displayName
|
|
string
|
Показать имя
|
properties.renew
|
|
boolean
|
Если задано значение true, вы автоматически приобретете новое преимущество в течение даты окончания срока действия.
|
properties.term
|
|
Term
|
Представляет термин преимущества в формате ISO 8601.
|
Ответы
Безопасность
azure_auth
Поток OAuth2 Azure Active Directory
Тип:
oauth2
Flow:
implicit
URL-адрес авторизации:
https://login.microsoftonline.com/common/oauth2/authorize
Области
Имя |
Описание |
user_impersonation
|
олицетворения учетной записи пользователя
|
Примеры
SavingsPlanOrderAliasCreate
Образец запроса
PUT https://management.azure.com/providers/Microsoft.BillingBenefits/savingsPlanOrderAliases/spAlias123?api-version=2022-11-01
{
"sku": {
"name": "Compute_Savings_Plan"
},
"properties": {
"billingScopeId": "/subscriptions/30000000-0000-0000-0000-000000000000",
"term": "P3Y",
"appliedScopeType": "Shared",
"appliedScopeProperties": null,
"displayName": "Compute_SavingsPlan_10-28-2022_16-38",
"billingPlan": "P1M",
"commitment": {
"grain": "Hourly",
"currencyCode": "USD",
"amount": 0.001
}
}
}
import com.azure.resourcemanager.billingbenefits.fluent.models.SavingsPlanOrderAliasModelInner;
import com.azure.resourcemanager.billingbenefits.models.AppliedScopeType;
import com.azure.resourcemanager.billingbenefits.models.BillingPlan;
import com.azure.resourcemanager.billingbenefits.models.Commitment;
import com.azure.resourcemanager.billingbenefits.models.CommitmentGrain;
import com.azure.resourcemanager.billingbenefits.models.Sku;
import com.azure.resourcemanager.billingbenefits.models.Term;
/**
* Samples for SavingsPlanOrderAlias Create.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/
* SavingsPlanOrderAliasCreate.json
*/
/**
* Sample code: SavingsPlanOrderAliasCreate.
*
* @param manager Entry point to BillingBenefitsManager.
*/
public static void
savingsPlanOrderAliasCreate(com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
manager.savingsPlanOrderAlias().create("spAlias123",
new SavingsPlanOrderAliasModelInner().withSku(new Sku().withName("Compute_Savings_Plan"))
.withDisplayName("Compute_SavingsPlan_10-28-2022_16-38")
.withBillingScopeId("/subscriptions/30000000-0000-0000-0000-000000000000").withTerm(Term.P3Y)
.withBillingPlan(BillingPlan.P1M).withAppliedScopeType(AppliedScopeType.SHARED)
.withCommitment(new Commitment().withCurrencyCode("fakeTokenPlaceholder").withAmount(0.001D)
.withGrain(CommitmentGrain.HOURLY)),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.billingbenefits import BillingBenefitsRP
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-billingbenefits
# USAGE
python savings_plan_order_alias_create.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BillingBenefitsRP(
credential=DefaultAzureCredential(),
)
response = client.savings_plan_order_alias.begin_create(
savings_plan_order_alias_name="spAlias123",
body={
"properties": {
"appliedScopeProperties": None,
"appliedScopeType": "Shared",
"billingPlan": "P1M",
"billingScopeId": "/subscriptions/30000000-0000-0000-0000-000000000000",
"commitment": {"amount": 0.001, "currencyCode": "USD", "grain": "Hourly"},
"displayName": "Compute_SavingsPlan_10-28-2022_16-38",
"term": "P3Y",
},
"sku": {"name": "Compute_Savings_Plan"},
},
).result()
print(response)
# x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasCreate.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbillingbenefits_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasCreate.json
func ExampleSavingsPlanOrderAliasClient_BeginCreate_savingsPlanOrderAliasCreate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSavingsPlanOrderAliasClient().BeginCreate(ctx, "spAlias123", armbillingbenefits.SavingsPlanOrderAliasModel{
Properties: &armbillingbenefits.SavingsPlanOrderAliasProperties{
AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeShared),
BillingPlan: to.Ptr(armbillingbenefits.BillingPlanP1M),
BillingScopeID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000000"),
Commitment: &armbillingbenefits.Commitment{
Amount: to.Ptr[float64](0.001),
CurrencyCode: to.Ptr("USD"),
Grain: to.Ptr(armbillingbenefits.CommitmentGrainHourly),
},
DisplayName: to.Ptr("Compute_SavingsPlan_10-28-2022_16-38"),
Term: to.Ptr(armbillingbenefits.TermP3Y),
},
SKU: &armbillingbenefits.SKU{
Name: to.Ptr("Compute_Savings_Plan"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.SavingsPlanOrderAliasModel = armbillingbenefits.SavingsPlanOrderAliasModel{
// Name: to.Ptr("SavingsPlan_1667000324595"),
// Type: to.Ptr("Microsoft.BillingBenefits/savingsPlanOrderAliases"),
// ID: to.Ptr("/providers/microsoft.billingbenefits/savingsPlanOrderAliases/SavingsPlan_1667000324595"),
// Properties: &armbillingbenefits.SavingsPlanOrderAliasProperties{
// AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeShared),
// BillingPlan: to.Ptr(armbillingbenefits.BillingPlanP1M),
// BillingScopeID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000000"),
// Commitment: &armbillingbenefits.Commitment{
// Amount: to.Ptr[float64](0.001),
// CurrencyCode: to.Ptr("USD"),
// Grain: to.Ptr(armbillingbenefits.CommitmentGrainHourly),
// },
// DisplayName: to.Ptr("Compute_SavingsPlan_10-28-2022_16-38"),
// ProvisioningState: to.Ptr(armbillingbenefits.ProvisioningStateSucceeded),
// SavingsPlanOrderID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/30000000-0000-0000-0000-000000000023"),
// Term: to.Ptr(armbillingbenefits.TermP3Y),
// },
// SKU: &armbillingbenefits.SKU{
// Name: to.Ptr("Compute_Savings_Plan"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BillingBenefitsRP } = require("@azure/arm-billingbenefits");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851
*
* @summary Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851
* x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasCreate.json
*/
async function savingsPlanOrderAliasCreate() {
const savingsPlanOrderAliasName = "spAlias123";
const body = {
appliedScopeProperties: {},
appliedScopeType: "Shared",
billingPlan: "P1M",
billingScopeId: "/subscriptions/30000000-0000-0000-0000-000000000000",
commitment: { amount: 0.001, currencyCode: "USD", grain: "Hourly" },
displayName: "Compute_SavingsPlan_10-28-2022_16-38",
sku: { name: "Compute_Savings_Plan" },
term: "P3Y",
};
const credential = new DefaultAzureCredential();
const client = new BillingBenefitsRP(credential);
const result = await client.savingsPlanOrderAlias.beginCreateAndWait(
savingsPlanOrderAliasName,
body
);
console.log(result);
}
savingsPlanOrderAliasCreate().catch(console.error);
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
Azure-AsyncOperation: https://management.azure.com/Microsoft.BillingBenefits/operationResults/4e2ffff7-b331-4fcb-ab11-b5fa49368188?api-version=2021-07-01-privatepreview
Retry-After: 5
{
"id": "/providers/microsoft.billingbenefits/savingsPlanOrderAliases/SavingsPlan_1667000324595",
"name": "SavingsPlan_1667000324595",
"type": "Microsoft.BillingBenefits/savingsPlanOrderAliases",
"kind": null,
"sku": {
"name": "Compute_Savings_Plan"
},
"properties": {
"savingsPlanOrderId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/30000000-0000-0000-0000-000000000023",
"billingScopeId": "/subscriptions/30000000-0000-0000-0000-000000000000",
"billingPlan": "P1M",
"appliedScopeProperties": null,
"commitment": {
"grain": "Hourly",
"currencyCode": "USD",
"amount": 0.001
},
"appliedScopeType": "Shared",
"displayName": "Compute_SavingsPlan_10-28-2022_16-38",
"provisioningState": "Created",
"term": "P3Y"
}
}
{
"id": "/providers/microsoft.billingbenefits/savingsPlanOrderAliases/SavingsPlan_1667000324595",
"name": "SavingsPlan_1667000324595",
"type": "Microsoft.BillingBenefits/savingsPlanOrderAliases",
"kind": null,
"sku": {
"name": "Compute_Savings_Plan"
},
"properties": {
"savingsPlanOrderId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/30000000-0000-0000-0000-000000000023",
"billingScopeId": "/subscriptions/30000000-0000-0000-0000-000000000000",
"billingPlan": "P1M",
"appliedScopeProperties": null,
"commitment": {
"grain": "Hourly",
"currencyCode": "USD",
"amount": 0.001
},
"appliedScopeType": "Shared",
"displayName": "Compute_SavingsPlan_10-28-2022_16-38",
"provisioningState": "Created",
"term": "P3Y"
}
}
SavingsPlanOrderAliasCreateSingleScope
Образец запроса
PUT https://management.azure.com/providers/Microsoft.BillingBenefits/savingsPlanOrderAliases/spAlias123?api-version=2022-11-01
{
"sku": {
"name": "Compute_Savings_Plan"
},
"properties": {
"billingScopeId": "/providers/Microsoft.Billing/billingAccounts/1234567/billingSubscriptions/30000000-0000-0000-0000-000000000000",
"appliedScopeType": "Single",
"appliedScopeProperties": {
"subscriptionId": "/subscriptions/30000000-0000-0000-0000-000000000000"
},
"term": "P3Y",
"displayName": "Compute_SavingsPlan_10-28-2022_16-38",
"billingPlan": "P1M",
"commitment": {
"grain": "Hourly",
"currencyCode": "USD",
"amount": 0.001
}
}
}
import com.azure.resourcemanager.billingbenefits.fluent.models.SavingsPlanOrderAliasModelInner;
import com.azure.resourcemanager.billingbenefits.models.AppliedScopeProperties;
import com.azure.resourcemanager.billingbenefits.models.AppliedScopeType;
import com.azure.resourcemanager.billingbenefits.models.BillingPlan;
import com.azure.resourcemanager.billingbenefits.models.Commitment;
import com.azure.resourcemanager.billingbenefits.models.CommitmentGrain;
import com.azure.resourcemanager.billingbenefits.models.Sku;
import com.azure.resourcemanager.billingbenefits.models.Term;
/**
* Samples for SavingsPlanOrderAlias Create.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/
* SavingsPlanOrderAliasCreateSingleScope.json
*/
/**
* Sample code: SavingsPlanOrderAliasCreateSingleScope.
*
* @param manager Entry point to BillingBenefitsManager.
*/
public static void savingsPlanOrderAliasCreateSingleScope(
com.azure.resourcemanager.billingbenefits.BillingBenefitsManager manager) {
manager.savingsPlanOrderAlias().create("spAlias123", new SavingsPlanOrderAliasModelInner()
.withSku(new Sku().withName("Compute_Savings_Plan")).withDisplayName("Compute_SavingsPlan_10-28-2022_16-38")
.withBillingScopeId(
"/providers/Microsoft.Billing/billingAccounts/1234567/billingSubscriptions/30000000-0000-0000-0000-000000000000")
.withTerm(Term.P3Y).withBillingPlan(BillingPlan.P1M).withAppliedScopeType(AppliedScopeType.SINGLE)
.withAppliedScopeProperties(
new AppliedScopeProperties().withSubscriptionId("/subscriptions/30000000-0000-0000-0000-000000000000"))
.withCommitment(new Commitment().withCurrencyCode("fakeTokenPlaceholder").withAmount(0.001D)
.withGrain(CommitmentGrain.HOURLY)),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.billingbenefits import BillingBenefitsRP
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-billingbenefits
# USAGE
python savings_plan_order_alias_create_single_scope.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BillingBenefitsRP(
credential=DefaultAzureCredential(),
)
response = client.savings_plan_order_alias.begin_create(
savings_plan_order_alias_name="spAlias123",
body={
"properties": {
"appliedScopeProperties": {"subscriptionId": "/subscriptions/30000000-0000-0000-0000-000000000000"},
"appliedScopeType": "Single",
"billingPlan": "P1M",
"billingScopeId": "/providers/Microsoft.Billing/billingAccounts/1234567/billingSubscriptions/30000000-0000-0000-0000-000000000000",
"commitment": {"amount": 0.001, "currencyCode": "USD", "grain": "Hourly"},
"displayName": "Compute_SavingsPlan_10-28-2022_16-38",
"term": "P3Y",
},
"sku": {"name": "Compute_Savings_Plan"},
},
).result()
print(response)
# x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasCreateSingleScope.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbillingbenefits_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billingbenefits/armbillingbenefits/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasCreateSingleScope.json
func ExampleSavingsPlanOrderAliasClient_BeginCreate_savingsPlanOrderAliasCreateSingleScope() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbillingbenefits.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewSavingsPlanOrderAliasClient().BeginCreate(ctx, "spAlias123", armbillingbenefits.SavingsPlanOrderAliasModel{
Properties: &armbillingbenefits.SavingsPlanOrderAliasProperties{
AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{
SubscriptionID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000000"),
},
AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle),
BillingPlan: to.Ptr(armbillingbenefits.BillingPlanP1M),
BillingScopeID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/1234567/billingSubscriptions/30000000-0000-0000-0000-000000000000"),
Commitment: &armbillingbenefits.Commitment{
Amount: to.Ptr[float64](0.001),
CurrencyCode: to.Ptr("USD"),
Grain: to.Ptr(armbillingbenefits.CommitmentGrainHourly),
},
DisplayName: to.Ptr("Compute_SavingsPlan_10-28-2022_16-38"),
Term: to.Ptr(armbillingbenefits.TermP3Y),
},
SKU: &armbillingbenefits.SKU{
Name: to.Ptr("Compute_Savings_Plan"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.SavingsPlanOrderAliasModel = armbillingbenefits.SavingsPlanOrderAliasModel{
// Name: to.Ptr("SavingsPlan_1667000324595"),
// Type: to.Ptr("Microsoft.BillingBenefits/savingsPlanOrderAliases"),
// ID: to.Ptr("/providers/microsoft.billingbenefits/savingsPlanOrderAliases/SavingsPlan_1667000324595"),
// Properties: &armbillingbenefits.SavingsPlanOrderAliasProperties{
// AppliedScopeProperties: &armbillingbenefits.AppliedScopeProperties{
// SubscriptionID: to.Ptr("/subscriptions/30000000-0000-0000-0000-000000000000"),
// },
// AppliedScopeType: to.Ptr(armbillingbenefits.AppliedScopeTypeSingle),
// BillingPlan: to.Ptr(armbillingbenefits.BillingPlanP1M),
// BillingScopeID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/1234567/billingSubscriptions/30000000-0000-0000-0000-000000000000"),
// Commitment: &armbillingbenefits.Commitment{
// Amount: to.Ptr[float64](0.001),
// CurrencyCode: to.Ptr("USD"),
// Grain: to.Ptr(armbillingbenefits.CommitmentGrainHourly),
// },
// DisplayName: to.Ptr("Compute_SavingsPlan_10-28-2022_16-38"),
// ProvisioningState: to.Ptr(armbillingbenefits.ProvisioningStateSucceeded),
// SavingsPlanOrderID: to.Ptr("/providers/Microsoft.BillingBenefits/savingsPlanOrders/30000000-0000-0000-0000-000000000023"),
// Term: to.Ptr(armbillingbenefits.TermP3Y),
// },
// SKU: &armbillingbenefits.SKU{
// Name: to.Ptr("Compute_Savings_Plan"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BillingBenefitsRP } = require("@azure/arm-billingbenefits");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851
*
* @summary Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851
* x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasCreateSingleScope.json
*/
async function savingsPlanOrderAliasCreateSingleScope() {
const savingsPlanOrderAliasName = "spAlias123";
const body = {
appliedScopeProperties: {
subscriptionId: "/subscriptions/30000000-0000-0000-0000-000000000000",
},
appliedScopeType: "Single",
billingPlan: "P1M",
billingScopeId:
"/providers/Microsoft.Billing/billingAccounts/1234567/billingSubscriptions/30000000-0000-0000-0000-000000000000",
commitment: { amount: 0.001, currencyCode: "USD", grain: "Hourly" },
displayName: "Compute_SavingsPlan_10-28-2022_16-38",
sku: { name: "Compute_Savings_Plan" },
term: "P3Y",
};
const credential = new DefaultAzureCredential();
const client = new BillingBenefitsRP(credential);
const result = await client.savingsPlanOrderAlias.beginCreateAndWait(
savingsPlanOrderAliasName,
body
);
console.log(result);
}
savingsPlanOrderAliasCreateSingleScope().catch(console.error);
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Пример ответа
Azure-AsyncOperation: https://management.azure.com/Microsoft.BillingBenefits/operationResults/4e2ffff7-b331-4fcb-ab11-b5fa49368188?api-version=2021-07-01-privatepreview
Retry-After: 5
{
"id": "/providers/microsoft.billingbenefits/savingsPlanOrderAliases/SavingsPlan_1667000324595",
"name": "SavingsPlan_1667000324595",
"type": "Microsoft.BillingBenefits/savingsPlanOrderAliases",
"kind": null,
"sku": {
"name": "Compute_Savings_Plan"
},
"properties": {
"savingsPlanOrderId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/30000000-0000-0000-0000-000000000023",
"billingPlan": "P1M",
"billingScopeId": "/providers/Microsoft.Billing/billingAccounts/1234567/billingSubscriptions/30000000-0000-0000-0000-000000000000",
"appliedScopeType": "Single",
"appliedScopeProperties": {
"subscriptionId": "/subscriptions/30000000-0000-0000-0000-000000000000"
},
"commitment": {
"grain": "Hourly",
"currencyCode": "USD",
"amount": 0.001
},
"displayName": "Compute_SavingsPlan_10-28-2022_16-38",
"provisioningState": "Created",
"term": "P3Y"
}
}
{
"id": "/providers/microsoft.billingbenefits/savingsPlanOrderAliases/SavingsPlan_1667000324595",
"name": "SavingsPlan_1667000324595",
"type": "Microsoft.BillingBenefits/savingsPlanOrderAliases",
"kind": null,
"sku": {
"name": "Compute_Savings_Plan"
},
"properties": {
"savingsPlanOrderId": "/providers/Microsoft.BillingBenefits/savingsPlanOrders/30000000-0000-0000-0000-000000000023",
"billingPlan": "P1M",
"billingScopeId": "/providers/Microsoft.Billing/billingAccounts/1234567/billingSubscriptions/30000000-0000-0000-0000-000000000000",
"appliedScopeType": "Single",
"appliedScopeProperties": {
"subscriptionId": "/subscriptions/30000000-0000-0000-0000-000000000000"
},
"commitment": {
"grain": "Hourly",
"currencyCode": "USD",
"amount": 0.001
},
"displayName": "Compute_SavingsPlan_10-28-2022_16-38",
"provisioningState": "Created",
"term": "P3Y"
}
}
Определения
AppliedScopeProperties
Object
Свойства, относящиеся к примененным типу области. Не требуется, если применимо.
Имя |
Тип |
Описание |
displayName
|
string
|
Показать имя
|
managementGroupId
|
string
|
Полный идентификатор группы управления, в которой необходимо применить преимущество.
|
resourceGroupId
|
string
|
Полный идентификатор группы ресурсов.
|
subscriptionId
|
string
|
Полный идентификатор подписки.
|
tenantId
|
string
|
Идентификатор клиента, в котором применяется преимущество.
|
AppliedScopeType
Перечисление
Тип примененной области.
Значение |
Описание |
ManagementGroup
|
|
Shared
|
|
Single
|
|
BillingPlan
Перечисление
Представляет план выставления счетов в формате ISO 8601. Требуется только для ежемесячных планов выставления счетов.
Commitment
Object
Приверженность преимуществам.
Имя |
Тип |
Описание |
amount
|
number
(double)
|
|
currencyCode
|
string
|
Код валюты ISO 4217 3-буквы для валюты, используемой этой записью покупки.
|
grain
|
CommitmentGrain
|
Зерно обязательств.
|
CommitmentGrain
Перечисление
Зерно обязательств.
createdByType
Перечисление
Тип удостоверения, создавшего ресурс.
Значение |
Описание |
Application
|
|
Key
|
|
ManagedIdentity
|
|
User
|
|
ErrorAdditionalInfo
Object
Дополнительные сведения об ошибке управления ресурсами.
Имя |
Тип |
Описание |
info
|
object
|
Дополнительные сведения.
|
type
|
string
|
Дополнительный тип сведений.
|
ErrorDetail
Object
Сведения об ошибке.
Имя |
Тип |
Описание |
additionalInfo
|
ErrorAdditionalInfo[]
|
Дополнительные сведения об ошибке.
|
code
|
string
|
Код ошибки.
|
details
|
ErrorDetail[]
|
Сведения об ошибке.
|
message
|
string
|
Сообщение об ошибке.
|
target
|
string
|
Целевой объект ошибки.
|
ErrorResponse
Object
Ответ на ошибку
ProvisioningState
Перечисление
Состояние подготовки
Значение |
Описание |
Cancelled
|
|
ConfirmedBilling
|
|
Created
|
|
Creating
|
|
Expired
|
|
Failed
|
|
PendingBilling
|
|
Succeeded
|
|
SavingsPlanOrderAliasModel
Object
Псевдоним заказа на экономию
Имя |
Тип |
Default value |
Описание |
id
|
string
|
|
Полный идентификатор ресурса для ресурса. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
kind
|
string
|
|
Тип поставщика ресурсов
|
name
|
string
|
|
Имя ресурса
|
properties.appliedScopeProperties
|
AppliedScopeProperties
|
|
Свойства, относящиеся к примененным типу области. Не требуется, если применимо.
|
properties.appliedScopeType
|
AppliedScopeType
|
|
Тип примененной области.
|
properties.billingPlan
|
BillingPlan
|
|
Представляет план выставления счетов в формате ISO 8601. Требуется только для ежемесячных планов выставления счетов.
|
properties.billingScopeId
|
string
|
|
Подписка, которая будет взиматься за приобретение преимущества
|
properties.commitment
|
Commitment
|
|
Приверженность преимуществам.
|
properties.displayName
|
string
|
|
Показать имя
|
properties.provisioningState
|
ProvisioningState
|
|
Состояние подготовки
|
properties.renew
|
boolean
|
False
|
Если задано значение true, вы автоматически приобретете новое преимущество в течение даты окончания срока действия.
|
properties.savingsPlanOrderId
|
string
|
|
Идентификатор созданного плана экономии
|
properties.term
|
Term
|
|
Представляет термин преимущества в формате ISO 8601.
|
sku
|
Sku
|
|
Номер SKU плана экономии
|
systemData
|
systemData
|
|
Метаданные Azure Resource Manager, содержащие данные createdBy и modifiedBy.
|
type
|
string
|
|
Тип ресурса. Например, "Microsoft.Compute/virtualMachines" или "Microsoft.Storage/storageAccounts"
|
Sku
Object
Номер SKU для этого ресурса
Имя |
Тип |
Описание |
name
|
string
|
Имя применяемого номера SKU
|
systemData
Object
Метаданные, относящиеся к созданию и последнему изменении ресурса.
Имя |
Тип |
Описание |
createdAt
|
string
(date-time)
|
Метка времени создания ресурса (UTC).
|
createdBy
|
string
|
Удостоверение, создающее ресурс.
|
createdByType
|
createdByType
|
Тип удостоверения, создавшего ресурс.
|
lastModifiedAt
|
string
(date-time)
|
Метка времени последнего изменения ресурса (UTC)
|
lastModifiedBy
|
string
|
Идентификатор, который последний раз изменил ресурс.
|
lastModifiedByType
|
createdByType
|
Тип удостоверения, который последний раз изменил ресурс.
|
Term
Перечисление
Представляет термин преимущества в формате ISO 8601.
Значение |
Описание |
P1Y
|
|
P3Y
|
|
P5Y
|
|