Åtgärden som hämtar information om kapacitetsreservationen.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}?api-version=2026-04-01
Med valfria parametrar:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}?api-version=2026-04-01&$expand=instanceView
URI-parametrar
| Name |
I |
Obligatorisk |
Typ |
Description |
|
capacityReservationGroupName
|
path |
True
|
string
|
Namnet på kapacitetsreservationsgruppen.
|
|
capacityReservationName
|
path |
True
|
string
|
Namnet på kapacitetsreservationen.
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Namnet på resursgruppen. Namnet är skiftlägesokänsligt.
|
|
subscriptionId
|
path |
True
|
string
minLength: 1
|
ID för målprenumerationen.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
Den API-version som ska användas för den här åtgärden.
|
|
$expand
|
query |
|
CapacityReservationInstanceViewTypes
|
Det expanderingsuttryck som ska tillämpas på åtgärden. "InstanceView" hämtar en ögonblicksbild av körningsegenskaperna för kapacitetsreservationen som hanteras av plattformen och kan ändras utanför kontrollplanets åtgärder.
|
Svar
Säkerhet
azure_auth
Azure Active Directory OAuth2-flöde.
Typ:
oauth2
Flow:
implicit
Auktoriseringswebbadress:
https://login.microsoftonline.com/common/oauth2/authorize
Omfattningar
| Name |
Description |
|
user_impersonation
|
personifiera ditt användarkonto
|
Exempel
Get a block capacity reservation.
Exempelbegäran
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/blockCapacityReservationGroup/capacityReservations/blockCapacityReservation?api-version=2026-04-01&$expand=instanceView
import com.azure.resourcemanager.compute.models.CapacityReservationInstanceViewTypes;
/**
* Samples for CapacityReservations Get.
*/
public final class Main {
/*
* x-ms-original-file: 2026-04-01/capacityReservationExamples/BlockCapacityReservation_Get.json
*/
/**
* Sample code: Get a block capacity reservation.
*
* @param manager Entry point to ComputeManager.
*/
public static void getABlockCapacityReservation(com.azure.resourcemanager.compute.ComputeManager manager) {
manager.serviceClient().getCapacityReservations().getWithResponse("myResourceGroup",
"blockCapacityReservationGroup", "blockCapacityReservation",
CapacityReservationInstanceViewTypes.INSTANCE_VIEW, 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.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python block_capacity_reservation_get.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 = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.capacity_reservations.get(
resource_group_name="myResourceGroup",
capacity_reservation_group_name="blockCapacityReservationGroup",
capacity_reservation_name="blockCapacityReservation",
)
print(response)
# x-ms-original-file: 2026-04-01/capacityReservationExamples/BlockCapacityReservation_Get.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 armcompute_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/compute/armcompute/v8"
)
// Generated from example definition: 2026-04-01/capacityReservationExamples/BlockCapacityReservation_Get.json
func ExampleCapacityReservationsClient_Get_getABlockCapacityReservation() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("{subscriptionId}", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCapacityReservationsClient().Get(ctx, "myResourceGroup", "blockCapacityReservationGroup", "blockCapacityReservation", &armcompute.CapacityReservationsClientGetOptions{
Expand: to.Ptr(armcompute.CapacityReservationInstanceViewTypesInstanceView)})
if err != nil {
log.Fatalf("failed to finish the request: %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 = armcompute.CapacityReservationsClientGetResponse{
// CapacityReservation: armcompute.CapacityReservation{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/blockCapacityReservationGroup/capacityReservations/blockCapacityReservation"),
// Properties: &armcompute.CapacityReservationProperties{
// PlatformFaultDomainCount: to.Ptr[int32](3),
// ReservationID: to.Ptr("{GUID}"),
// ProvisioningTime: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"),
// },
// },
// ProvisioningState: to.Ptr("Succeeded"),
// InstanceView: &armcompute.CapacityReservationInstanceView{
// UtilizationInfo: &armcompute.CapacityReservationUtilization{
// CurrentCapacity: to.Ptr[int32](5),
// VirtualMachinesAllocated: []*armcompute.SubResourceReadOnly{
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"),
// },
// },
// },
// Statuses: []*armcompute.InstanceViewStatus{
// {
// Code: to.Ptr("ProvisioningState/succeeded"),
// Level: to.Ptr(armcompute.StatusLevelTypesInfo),
// DisplayStatus: to.Ptr("Provisioning succeeded"),
// },
// },
// },
// ScheduleProfile: &armcompute.ScheduleProfile{
// Start: to.Ptr("2025-08-01T12:00:00Z"),
// End: to.Ptr("2025-08-02T11:30:00Z"),
// },
// TimeCreated: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "department": to.Ptr("HR"),
// },
// SKU: &armcompute.SKU{
// Name: to.Ptr("Standard_ND96isr_H100_v5"),
// Capacity: to.Ptr[int64](1),
// },
// Zones: []*string{
// to.Ptr("1"),
// },
// Name: to.Ptr("blockCapacityReservation"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to the operation that retrieves information about the capacity reservation.
*
* @summary the operation that retrieves information about the capacity reservation.
* x-ms-original-file: 2026-04-01/capacityReservationExamples/BlockCapacityReservation_Get.json
*/
async function getABlockCapacityReservation() {
const credential = new DefaultAzureCredential();
const subscriptionId = "{subscriptionId}";
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.capacityReservations.get(
"myResourceGroup",
"blockCapacityReservationGroup",
"blockCapacityReservation",
{ expand: "instanceView" },
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Exempelsvar
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/blockCapacityReservationGroup/capacityReservations/blockCapacityReservation",
"properties": {
"platformFaultDomainCount": 3,
"reservationId": "{GUID}",
"provisioningTime": "2021-06-27T01:02:38.3138469+00:00",
"virtualMachinesAssociated": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"
}
],
"provisioningState": "Succeeded",
"instanceView": {
"utilizationInfo": {
"currentCapacity": 5,
"virtualMachinesAllocated": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"
}
]
},
"statuses": [
{
"code": "ProvisioningState/succeeded",
"level": "Info",
"displayStatus": "Provisioning succeeded"
}
]
},
"scheduleProfile": {
"start": "2025-08-01T12:00:00Z",
"end": "2025-08-02T11:30:00Z"
},
"timeCreated": "2021-06-27T01:02:38.3138469+00:00"
},
"location": "westus",
"tags": {
"department": "HR"
},
"sku": {
"name": "Standard_ND96isr_H100_v5",
"capacity": 1
},
"zones": [
"1"
],
"name": "blockCapacityReservation"
}
Get a capacity reservation.
Exempelbegäran
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation?api-version=2026-04-01&$expand=instanceView
import com.azure.resourcemanager.compute.models.CapacityReservationInstanceViewTypes;
/**
* Samples for CapacityReservations Get.
*/
public final class Main {
/*
* x-ms-original-file: 2026-04-01/capacityReservationExamples/CapacityReservation_Get.json
*/
/**
* Sample code: Get a capacity reservation.
*
* @param manager Entry point to ComputeManager.
*/
public static void getACapacityReservation(com.azure.resourcemanager.compute.ComputeManager manager) {
manager.serviceClient().getCapacityReservations().getWithResponse("myResourceGroup",
"myCapacityReservationGroup", "myCapacityReservation", CapacityReservationInstanceViewTypes.INSTANCE_VIEW,
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.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python capacity_reservation_get.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 = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.capacity_reservations.get(
resource_group_name="myResourceGroup",
capacity_reservation_group_name="myCapacityReservationGroup",
capacity_reservation_name="myCapacityReservation",
)
print(response)
# x-ms-original-file: 2026-04-01/capacityReservationExamples/CapacityReservation_Get.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 armcompute_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/compute/armcompute/v8"
)
// Generated from example definition: 2026-04-01/capacityReservationExamples/CapacityReservation_Get.json
func ExampleCapacityReservationsClient_Get_getACapacityReservation() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("{subscriptionId}", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCapacityReservationsClient().Get(ctx, "myResourceGroup", "myCapacityReservationGroup", "myCapacityReservation", &armcompute.CapacityReservationsClientGetOptions{
Expand: to.Ptr(armcompute.CapacityReservationInstanceViewTypesInstanceView)})
if err != nil {
log.Fatalf("failed to finish the request: %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 = armcompute.CapacityReservationsClientGetResponse{
// CapacityReservation: armcompute.CapacityReservation{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation"),
// Properties: &armcompute.CapacityReservationProperties{
// PlatformFaultDomainCount: to.Ptr[int32](3),
// ReservationID: to.Ptr("{GUID}"),
// ProvisioningTime: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"),
// },
// },
// ProvisioningState: to.Ptr("Succeeded"),
// InstanceView: &armcompute.CapacityReservationInstanceView{
// UtilizationInfo: &armcompute.CapacityReservationUtilization{
// CurrentCapacity: to.Ptr[int32](5),
// VirtualMachinesAllocated: []*armcompute.SubResourceReadOnly{
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"),
// },
// },
// },
// Statuses: []*armcompute.InstanceViewStatus{
// {
// Code: to.Ptr("ProvisioningState/succeeded"),
// Level: to.Ptr(armcompute.StatusLevelTypesInfo),
// DisplayStatus: to.Ptr("Provisioning succeeded"),
// },
// },
// },
// TimeCreated: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "department": to.Ptr("HR"),
// },
// SKU: &armcompute.SKU{
// Name: to.Ptr("Standard_DS1_v2"),
// Capacity: to.Ptr[int64](4),
// },
// Zones: []*string{
// to.Ptr("1"),
// },
// Name: to.Ptr("myCapacityReservation"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to the operation that retrieves information about the capacity reservation.
*
* @summary the operation that retrieves information about the capacity reservation.
* x-ms-original-file: 2026-04-01/capacityReservationExamples/CapacityReservation_Get.json
*/
async function getACapacityReservation() {
const credential = new DefaultAzureCredential();
const subscriptionId = "{subscriptionId}";
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.capacityReservations.get(
"myResourceGroup",
"myCapacityReservationGroup",
"myCapacityReservation",
{ expand: "instanceView" },
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Exempelsvar
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation",
"properties": {
"platformFaultDomainCount": 3,
"reservationId": "{GUID}",
"provisioningTime": "2021-06-27T01:02:38.3138469+00:00",
"virtualMachinesAssociated": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"
}
],
"provisioningState": "Succeeded",
"instanceView": {
"utilizationInfo": {
"currentCapacity": 5,
"virtualMachinesAllocated": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"
}
]
},
"statuses": [
{
"code": "ProvisioningState/succeeded",
"level": "Info",
"displayStatus": "Provisioning succeeded"
}
]
},
"timeCreated": "2021-06-27T01:02:38.3138469+00:00"
},
"location": "westus",
"tags": {
"department": "HR"
},
"sku": {
"name": "Standard_DS1_v2",
"capacity": 4
},
"zones": [
"1"
],
"name": "myCapacityReservation"
}
Get a Future capacity reservation.
Exempelbegäran
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/futureCapacityReservationGroup/capacityReservations/futureCapacityReservation?api-version=2026-04-01&$expand=instanceView
import com.azure.resourcemanager.compute.models.CapacityReservationInstanceViewTypes;
/**
* Samples for CapacityReservations Get.
*/
public final class Main {
/*
* x-ms-original-file: 2026-04-01/capacityReservationExamples/FutureCapacityReservation_Get.json
*/
/**
* Sample code: Get a Future capacity reservation.
*
* @param manager Entry point to ComputeManager.
*/
public static void getAFutureCapacityReservation(com.azure.resourcemanager.compute.ComputeManager manager) {
manager.serviceClient().getCapacityReservations().getWithResponse("myResourceGroup",
"futureCapacityReservationGroup", "futureCapacityReservation",
CapacityReservationInstanceViewTypes.INSTANCE_VIEW, 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.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python future_capacity_reservation_get.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 = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.capacity_reservations.get(
resource_group_name="myResourceGroup",
capacity_reservation_group_name="futureCapacityReservationGroup",
capacity_reservation_name="futureCapacityReservation",
)
print(response)
# x-ms-original-file: 2026-04-01/capacityReservationExamples/FutureCapacityReservation_Get.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 armcompute_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/compute/armcompute/v8"
)
// Generated from example definition: 2026-04-01/capacityReservationExamples/FutureCapacityReservation_Get.json
func ExampleCapacityReservationsClient_Get_getAFutureCapacityReservation() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("{subscriptionId}", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCapacityReservationsClient().Get(ctx, "myResourceGroup", "futureCapacityReservationGroup", "futureCapacityReservation", &armcompute.CapacityReservationsClientGetOptions{
Expand: to.Ptr(armcompute.CapacityReservationInstanceViewTypesInstanceView)})
if err != nil {
log.Fatalf("failed to finish the request: %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 = armcompute.CapacityReservationsClientGetResponse{
// CapacityReservation: armcompute.CapacityReservation{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/futureCapacityReservationGroup/capacityReservations/futureCapacityReservation"),
// Properties: &armcompute.CapacityReservationProperties{
// PlatformFaultDomainCount: to.Ptr[int32](3),
// ReservationID: to.Ptr("{GUID}"),
// ProvisioningTime: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"),
// },
// },
// ProvisioningState: to.Ptr("Succeeded"),
// InstanceView: &armcompute.CapacityReservationInstanceView{
// UtilizationInfo: &armcompute.CapacityReservationUtilization{
// CurrentCapacity: to.Ptr[int32](4),
// VirtualMachinesAllocated: []*armcompute.SubResourceReadOnly{
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"),
// },
// },
// },
// Statuses: []*armcompute.InstanceViewStatus{
// {
// Code: to.Ptr("ProvisioningState/succeeded"),
// Level: to.Ptr(armcompute.StatusLevelTypesInfo),
// DisplayStatus: to.Ptr("Provisioning succeeded"),
// },
// },
// ReservationStateInfo: &armcompute.CapacityReservationStateInfo{
// ReservationState: to.Ptr(armcompute.ReservationStateLive),
// },
// },
// ScheduleProfile: &armcompute.ScheduleProfile{
// Start: to.Ptr("2026-08-01T12:00:00Z"),
// MinimumCommitmentDays: to.Ptr[int32](30),
// ModifiableUntil: to.Ptr(time.Date(2026, time.June, 6, 12, 0, 0, 0, time.UTC)),
// },
// TimeCreated: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "department": to.Ptr("HR"),
// },
// SKU: &armcompute.SKU{
// Name: to.Ptr("Standard_DS1_v2"),
// Capacity: to.Ptr[int64](4),
// },
// Zones: []*string{
// to.Ptr("1"),
// },
// Name: to.Ptr("futureCapacityReservation"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to the operation that retrieves information about the capacity reservation.
*
* @summary the operation that retrieves information about the capacity reservation.
* x-ms-original-file: 2026-04-01/capacityReservationExamples/FutureCapacityReservation_Get.json
*/
async function getAFutureCapacityReservation() {
const credential = new DefaultAzureCredential();
const subscriptionId = "{subscriptionId}";
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.capacityReservations.get(
"myResourceGroup",
"futureCapacityReservationGroup",
"futureCapacityReservation",
{ expand: "instanceView" },
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Exempelsvar
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/futureCapacityReservationGroup/capacityReservations/futureCapacityReservation",
"properties": {
"platformFaultDomainCount": 3,
"reservationId": "{GUID}",
"provisioningTime": "2021-06-27T01:02:38.3138469+00:00",
"virtualMachinesAssociated": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"
}
],
"provisioningState": "Succeeded",
"instanceView": {
"utilizationInfo": {
"currentCapacity": 4,
"virtualMachinesAllocated": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"
}
]
},
"statuses": [
{
"code": "ProvisioningState/succeeded",
"level": "Info",
"displayStatus": "Provisioning succeeded"
}
],
"reservationStateInfo": {
"reservationState": "Live"
}
},
"scheduleProfile": {
"start": "2026-08-01T12:00:00Z",
"minimumCommitmentDays": 30,
"modifiableUntil": "2026-06-06T12:00:00Z"
},
"timeCreated": "2021-06-27T01:02:38.3138469+00:00"
},
"location": "westus",
"tags": {
"department": "HR"
},
"sku": {
"name": "Standard_DS1_v2",
"capacity": 4
},
"zones": [
"1"
],
"name": "futureCapacityReservation"
}
Get a targeted capacity reservation.
Exempelbegäran
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/targetedCapacityReservationGroup/capacityReservations/targetedCapacityReservation?api-version=2026-04-01&$expand=instanceView
import com.azure.resourcemanager.compute.models.CapacityReservationInstanceViewTypes;
/**
* Samples for CapacityReservations Get.
*/
public final class Main {
/*
* x-ms-original-file: 2026-04-01/capacityReservationExamples/TargetedCapacityReservation_Get.json
*/
/**
* Sample code: Get a targeted capacity reservation.
*
* @param manager Entry point to ComputeManager.
*/
public static void getATargetedCapacityReservation(com.azure.resourcemanager.compute.ComputeManager manager) {
manager.serviceClient().getCapacityReservations().getWithResponse("myResourceGroup",
"targetedCapacityReservationGroup", "targetedCapacityReservation",
CapacityReservationInstanceViewTypes.INSTANCE_VIEW, 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.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python targeted_capacity_reservation_get.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 = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.capacity_reservations.get(
resource_group_name="myResourceGroup",
capacity_reservation_group_name="targetedCapacityReservationGroup",
capacity_reservation_name="targetedCapacityReservation",
)
print(response)
# x-ms-original-file: 2026-04-01/capacityReservationExamples/TargetedCapacityReservation_Get.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 armcompute_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/compute/armcompute/v8"
)
// Generated from example definition: 2026-04-01/capacityReservationExamples/TargetedCapacityReservation_Get.json
func ExampleCapacityReservationsClient_Get_getATargetedCapacityReservation() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("{subscriptionId}", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCapacityReservationsClient().Get(ctx, "myResourceGroup", "targetedCapacityReservationGroup", "targetedCapacityReservation", &armcompute.CapacityReservationsClientGetOptions{
Expand: to.Ptr(armcompute.CapacityReservationInstanceViewTypesInstanceView)})
if err != nil {
log.Fatalf("failed to finish the request: %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 = armcompute.CapacityReservationsClientGetResponse{
// CapacityReservation: armcompute.CapacityReservation{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/targetedCapacityReservationGroup/capacityReservations/targetedCapacityReservation"),
// Properties: &armcompute.CapacityReservationProperties{
// PlatformFaultDomainCount: to.Ptr[int32](3),
// ReservationID: to.Ptr("{GUID}"),
// ProvisioningTime: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"),
// },
// },
// ProvisioningState: to.Ptr("Succeeded"),
// InstanceView: &armcompute.CapacityReservationInstanceView{
// UtilizationInfo: &armcompute.CapacityReservationUtilization{
// CurrentCapacity: to.Ptr[int32](5),
// VirtualMachinesAllocated: []*armcompute.SubResourceReadOnly{
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"),
// },
// },
// },
// Statuses: []*armcompute.InstanceViewStatus{
// {
// Code: to.Ptr("ProvisioningState/succeeded"),
// Level: to.Ptr(armcompute.StatusLevelTypesInfo),
// DisplayStatus: to.Ptr("Provisioning succeeded"),
// },
// },
// },
// TimeCreated: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "department": to.Ptr("HR"),
// },
// SKU: &armcompute.SKU{
// Name: to.Ptr("Standard_DS1_v2"),
// Capacity: to.Ptr[int64](4),
// },
// Zones: []*string{
// to.Ptr("1"),
// },
// Name: to.Ptr("targetedCapacityReservation"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to the operation that retrieves information about the capacity reservation.
*
* @summary the operation that retrieves information about the capacity reservation.
* x-ms-original-file: 2026-04-01/capacityReservationExamples/TargetedCapacityReservation_Get.json
*/
async function getATargetedCapacityReservation() {
const credential = new DefaultAzureCredential();
const subscriptionId = "{subscriptionId}";
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.capacityReservations.get(
"myResourceGroup",
"targetedCapacityReservationGroup",
"targetedCapacityReservation",
{ expand: "instanceView" },
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Exempelsvar
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/targetedCapacityReservationGroup/capacityReservations/targetedCapacityReservation",
"properties": {
"platformFaultDomainCount": 3,
"reservationId": "{GUID}",
"provisioningTime": "2021-06-27T01:02:38.3138469+00:00",
"virtualMachinesAssociated": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"
}
],
"provisioningState": "Succeeded",
"instanceView": {
"utilizationInfo": {
"currentCapacity": 5,
"virtualMachinesAllocated": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"
}
]
},
"statuses": [
{
"code": "ProvisioningState/succeeded",
"level": "Info",
"displayStatus": "Provisioning succeeded"
}
]
},
"timeCreated": "2021-06-27T01:02:38.3138469+00:00"
},
"location": "westus",
"tags": {
"department": "HR"
},
"sku": {
"name": "Standard_DS1_v2",
"capacity": 4
},
"zones": [
"1"
],
"name": "targetedCapacityReservation"
}
Get an open capacity reservation with instance view.
Exempelbegäran
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/openCapacityReservationGroup/capacityReservations/openCapacityReservation?api-version=2026-04-01&$expand=instanceView
import com.azure.resourcemanager.compute.models.CapacityReservationInstanceViewTypes;
/**
* Samples for CapacityReservations Get.
*/
public final class Main {
/*
* x-ms-original-file: 2026-04-01/capacityReservationExamples/OpenCapacityReservation_Get.json
*/
/**
* Sample code: Get an open capacity reservation with instance view.
*
* @param manager Entry point to ComputeManager.
*/
public static void
getAnOpenCapacityReservationWithInstanceView(com.azure.resourcemanager.compute.ComputeManager manager) {
manager.serviceClient().getCapacityReservations().getWithResponse("myResourceGroup",
"openCapacityReservationGroup", "openCapacityReservation",
CapacityReservationInstanceViewTypes.INSTANCE_VIEW, 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.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python open_capacity_reservation_get.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 = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.capacity_reservations.get(
resource_group_name="myResourceGroup",
capacity_reservation_group_name="openCapacityReservationGroup",
capacity_reservation_name="openCapacityReservation",
)
print(response)
# x-ms-original-file: 2026-04-01/capacityReservationExamples/OpenCapacityReservation_Get.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 armcompute_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/compute/armcompute/v8"
)
// Generated from example definition: 2026-04-01/capacityReservationExamples/OpenCapacityReservation_Get.json
func ExampleCapacityReservationsClient_Get_getAnOpenCapacityReservationWithInstanceView() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("{subscriptionId}", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCapacityReservationsClient().Get(ctx, "myResourceGroup", "openCapacityReservationGroup", "openCapacityReservation", &armcompute.CapacityReservationsClientGetOptions{
Expand: to.Ptr(armcompute.CapacityReservationInstanceViewTypesInstanceView)})
if err != nil {
log.Fatalf("failed to finish the request: %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 = armcompute.CapacityReservationsClientGetResponse{
// CapacityReservation: armcompute.CapacityReservation{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/openCapacityReservationGroup/capacityReservations/openCapacityReservation"),
// Properties: &armcompute.CapacityReservationProperties{
// PlatformFaultDomainCount: to.Ptr[int32](3),
// ReservationID: to.Ptr("{GUID}"),
// ProvisioningTime: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// ProvisioningState: to.Ptr("Succeeded"),
// InstanceView: &armcompute.CapacityReservationInstanceView{
// UtilizationInfo: &armcompute.CapacityReservationUtilization{
// CurrentCapacity: to.Ptr[int32](10),
// UsedReservedCountBySubscription: map[string]*int32{
// "{subscription-id1}": to.Ptr[int32](3),
// "{subscription-id2}": to.Ptr[int32](2),
// },
// },
// Statuses: []*armcompute.InstanceViewStatus{
// {
// Code: to.Ptr("ProvisioningState/succeeded"),
// Level: to.Ptr(armcompute.StatusLevelTypesInfo),
// DisplayStatus: to.Ptr("Provisioning succeeded"),
// },
// },
// },
// TimeCreated: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "{tagName}": to.Ptr("{tagValue}"),
// },
// SKU: &armcompute.SKU{
// Name: to.Ptr("Standard_DS1_v2"),
// Capacity: to.Ptr[int64](10),
// },
// Zones: []*string{
// to.Ptr("1"),
// },
// Name: to.Ptr("openCapacityReservation"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to the operation that retrieves information about the capacity reservation.
*
* @summary the operation that retrieves information about the capacity reservation.
* x-ms-original-file: 2026-04-01/capacityReservationExamples/OpenCapacityReservation_Get.json
*/
async function getAnOpenCapacityReservationWithInstanceView() {
const credential = new DefaultAzureCredential();
const subscriptionId = "{subscriptionId}";
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.capacityReservations.get(
"myResourceGroup",
"openCapacityReservationGroup",
"openCapacityReservation",
{ expand: "instanceView" },
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Exempelsvar
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/openCapacityReservationGroup/capacityReservations/openCapacityReservation",
"properties": {
"platformFaultDomainCount": 3,
"reservationId": "{GUID}",
"provisioningTime": "2021-06-27T01:02:38.3138469+00:00",
"provisioningState": "Succeeded",
"instanceView": {
"utilizationInfo": {
"currentCapacity": 10,
"usedReservedCountBySubscription": {
"{subscription-id1}": 3,
"{subscription-id2}": 2
}
},
"statuses": [
{
"code": "ProvisioningState/succeeded",
"level": "Info",
"displayStatus": "Provisioning succeeded"
}
]
},
"timeCreated": "2021-06-27T01:02:38.3138469+00:00"
},
"location": "westus",
"tags": {
"{tagName}": "{tagValue}"
},
"sku": {
"name": "Standard_DS1_v2",
"capacity": 10
},
"zones": [
"1"
],
"name": "openCapacityReservation"
}
Definitioner
| Name |
Description |
|
ApiError
|
Api-fel.
|
|
ApiErrorBase
|
Api-felbas.
|
|
CapacityReservation
|
Anger information om kapacitetsreservationen.
|
|
CapacityReservationInstanceView
|
Instansvyn för en kapacitetsreservation som tillhandahåller som ögonblicksbild av körningsegenskaperna för kapacitetsreservationen som hanteras av plattformen och kan ändras utanför kontrollplansåtgärder.
|
|
CapacityReservationInstanceViewTypes
|
|
|
CapacityReservationStateInfo
|
Detaljer relaterade till nuvarande tillstånd för en framtida kapacitetsreservation.
|
|
CapacityReservationUtilization
|
Representerar kapacitetsreservationsanvändningen när det gäller allokerade resurser.
|
|
CloudError
|
Ett felsvar från Compute-tjänsten.
|
|
createdByType
|
Den typ av identitet som skapade resursen.
|
|
InnerError
|
Inre felinformation.
|
|
InstanceViewStatus
|
Status för instansvy.
|
|
ReservationState
|
Det nuvarande läget för en Future kapacitetsreservation.
|
|
ScheduleProfile
|
Definierar schemat för block- och framtida kapacitetsbokningar. Anger det schema under vilket kapacitetsreservationen är aktiv och den virtuella datorn eller VMSS-resursen kan allokeras med hjälp av reservation. För blockkapacitetsreservationer är fälten scheduleProfile, start och slut oföränderliga efter skapandet. Mer information finns i https://aka.ms/blockcapacityreservation. Minsta API-version för blockkapacitetsreservationer: 2025-04-01. Framtida kapacitetsreservationer måste använda denna egenskap med endast en starttid, som kan ändras fram till 'modifiableUntill'-tiden. Mer information finns i https://aka.ms/futurecapacityreservation. Minsta API-version för framtida kapacitetsbokningar: 2026-04-01.
|
|
Sku
|
Beskriver en SKU för vm-skalningsuppsättningar. Obs! Om den nya vm-SKU:n inte stöds på maskinvaran som skalningsuppsättningen för närvarande är på, måste du frigöra de virtuella datorerna i skalningsuppsättningen innan du ändrar SKU-namnet.
|
|
StatusLevelTypes
|
Nivåkoden.
|
|
SubResourceReadOnly
|
|
|
systemData
|
Metadata som rör skapande och senaste ändring av resursen.
|
ApiError
Objekt
Api-fel.
| Name |
Typ |
Description |
|
code
|
string
|
Felkoden.
|
|
details
|
ApiErrorBase[]
|
Api-felinformationen
|
|
innererror
|
InnerError
|
Api:ets inre fel
|
|
message
|
string
|
Felmeddelandet.
|
|
target
|
string
|
Målet för det specifika felet.
|
ApiErrorBase
Objekt
Api-felbas.
| Name |
Typ |
Description |
|
code
|
string
|
Felkoden.
|
|
message
|
string
|
Felmeddelandet.
|
|
target
|
string
|
Målet för det specifika felet.
|
CapacityReservation
Objekt
Anger information om kapacitetsreservationen.
| Name |
Typ |
Description |
|
id
|
string
|
Fullständigt kvalificerat resurs-ID för resursen. Ex – /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
|
location
|
string
|
Den geo-plats där resursen finns
|
|
name
|
string
|
Namnet på resursen
|
|
properties.instanceView
|
CapacityReservationInstanceView
|
Instansvyn för kapacitetsreservation.
|
|
properties.platformFaultDomainCount
|
integer
(int32)
|
Anger värdet för antalet feldomäner som kapacitetsreservation stöder för begärd VM-storlek.
Not: Antalet feldomäner som angetts för en resurs (t.ex. VM-skalningsuppsättning) måste vara mindre än eller lika med det här värdet om den distribueras med kapacitetsreservation. Lägsta API-version: 2022-08-01.
|
|
properties.provisioningState
|
string
|
Etableringstillståndet, som bara visas i svaret.
|
|
properties.provisioningTime
|
string
(date-time)
|
Datum och tid då kapacitetsreservationen senast uppdaterades.
|
|
properties.reservationId
|
string
|
Ett unikt ID som genereras och tilldelas kapacitetsreservationen av plattformen och som inte ändras under resursens livslängd.
|
|
properties.scheduleProfile
|
ScheduleProfile
|
Definierar schemat för block- och framtida kapacitetsbokningar. Anger det schema under vilket kapacitetsreservationen är aktiv och den virtuella datorn eller VMSS-resursen kan allokeras med hjälp av reservation. För blockkapacitetsreservationer är fälten scheduleProfile, start och slut oföränderliga efter skapandet. Mer information finns i https://aka.ms/blockcapacityreservation. Minsta API-version för blockkapacitetsreservationer: 2025-04-01. Framtida kapacitetsreservationer måste använda denna egenskap med endast en starttid, som kan ändras fram till 'modifiableUntill'-tiden. Mer information finns i https://aka.ms/futurecapacityreservation. Minsta API-version för framtida kapacitetsbokningar: 2026-04-01.
|
|
properties.timeCreated
|
string
(date-time)
|
Anger den tidpunkt då resursen för kapacitetsreservation skapades. Lägsta API-version: 2021-11-01.
|
|
properties.virtualMachinesAssociated
|
SubResourceReadOnly[]
|
En lista över alla resurs-ID:n för virtuella datorer som är associerade med kapacitetsreservationen.
|
|
sku
|
Sku
|
SKU för den resurs som kapaciteten behöver reserveras för. SKU-namnet och kapaciteten måste anges. För att blockera kapacitetsreservationer kan sku.capacity endast acceptera värdena 1, 2, 4, 8, 16, 32, 64. För närvarande stöds VM Skus med funktionen "CapacityReservationSupported" inställd på true. När "CapacityReservationSupported" är sant anger SKU-funktionen även "SupportedCapacityReservationTypes", som visar de typer av kapacitetsreservationer (till exempel Targeted eller Block) som SKU:n stöder. Se Lista Microsoft.Compute SKU:er i en region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) för värden som stöds.
|
|
systemData
|
systemData
|
Azure Resource Manager-metadata som innehåller createdBy och modifiedBy information.
|
|
tags
|
object
|
Resursetiketter.
|
|
type
|
string
|
Resurstypen. Till exempel "Microsoft.Compute/virtualMachines" eller "Microsoft.Storage/storageAccounts"
|
|
zones
|
string[]
|
Tillgänglighetszonerna.
|
CapacityReservationInstanceView
Objekt
Instansvyn för en kapacitetsreservation som tillhandahåller som ögonblicksbild av körningsegenskaperna för kapacitetsreservationen som hanteras av plattformen och kan ändras utanför kontrollplansåtgärder.
CapacityReservationInstanceViewTypes
Uppräkning
| Värde |
Description |
|
instanceView
|
|
CapacityReservationStateInfo
Objekt
Detaljer relaterade till nuvarande tillstånd för en framtida kapacitetsreservation.
| Name |
Typ |
Description |
|
reservationState
|
ReservationState
|
Det nuvarande läget för kapacitetsreservationen.
|
CapacityReservationUtilization
Objekt
Representerar kapacitetsreservationsanvändningen när det gäller allokerade resurser.
| Name |
Typ |
Description |
|
currentCapacity
|
integer
(int32)
|
Värdet anger den aktuella kapaciteten för den VM-storlek som har reserverats och som kunden debiteras för. Lägsta API-version: 2022-08-01.
|
|
usedReservedCountBySubscription
|
object
|
För öppna kapacitetsreservationer ger detta en karta över antalet reserverade kapaciteter som används av prenumerations-id (en GUID) som förbrukar kapaciteten, dvs. varje post mappar ett konsumtions-abonnemangs-id till räkningen av reserverad kapacitet som för närvarande används. Denna fylls endast för öppna kapacitetsreservationer och rapporteras inte för riktade och blockkapacitetsbokningar, som istället rapporterar allokering via virtualMachinesAllocated. Minsta API-version: 2026-04-01.
|
|
virtualMachinesAllocated
|
SubResourceReadOnly[]
|
En lista över alla resurs-ID:t för virtuella datorer som allokerats mot kapacitetsreservationen.
|
CloudError
Objekt
Ett felsvar från Compute-tjänsten.
| Name |
Typ |
Description |
|
error
|
ApiError
|
Api-fel.
|
createdByType
Uppräkning
Den typ av identitet som skapade resursen.
| Värde |
Description |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
InnerError
Objekt
Inre felinformation.
| Name |
Typ |
Description |
|
errordetail
|
string
|
Det interna felmeddelandet eller undantagsdumpen.
|
|
exceptiontype
|
string
|
Typen av undantag.
|
InstanceViewStatus
Objekt
Status för instansvy.
| Name |
Typ |
Description |
|
code
|
string
|
Statuskoden.
|
|
displayStatus
|
string
|
Den korta localizable-etiketten för statusen.
|
|
level
|
StatusLevelTypes
|
Nivåkoden.
|
|
message
|
string
|
Det detaljerade statusmeddelandet, inklusive för aviseringar och felmeddelanden.
|
|
time
|
string
(date-time)
|
Tidpunkten för statusen.
|
ReservationState
Uppräkning
Det nuvarande läget för en Future kapacitetsreservation.
| Värde |
Description |
|
Pending
|
Begäran om kapacitetsreservation har skickats in och väntar på utvärdering.
|
|
Declined
|
Begäran om kapacitetsreservation avslogs och kommer inte att ändras igen utan användarens åtgärd.
|
|
Approved
|
Begäran om kapacitetsreservation har godkänts av Azure och väntar på att den ska uppfyllas.
|
|
FulfillmentFailed
|
Ett fel inträffade när jag försökte uppfylla begäran om kapacitetsreservation.
|
|
Committed
|
Kapacitetsbokningen är låst och kan inte uppdateras eller raderas innan den går live.
|
|
Live
|
Kapacitetsreservationen är aktiv och tillgänglig för användning, och kan inte ändras eller tas bort förrän minimiåtagandeperioden har löpt ut.
|
|
PartiallyFulfilled
|
Azure kunde endast leverera en del av den begärda kapaciteten. Kapacitetsreservationen kan inte ändras eller tas bort förrän den minsta åtagandeperioden har löpt ut. Andelen uppfylld kapacitet kan ses genom att inspektera kapacitetsreservationens instansvy, som visas som currentCapacity i utilizationInfo.
|
ScheduleProfile
Objekt
Definierar schemat för block- och framtida kapacitetsbokningar. Anger det schema under vilket kapacitetsreservationen är aktiv och den virtuella datorn eller VMSS-resursen kan allokeras med hjälp av reservation. För blockkapacitetsreservationer är fälten scheduleProfile, start och slut oföränderliga efter skapandet. Mer information finns i https://aka.ms/blockcapacityreservation. Minsta API-version för blockkapacitetsreservationer: 2025-04-01. Framtida kapacitetsreservationer måste använda denna egenskap med endast en starttid, som kan ändras fram till 'modifiableUntill'-tiden. Mer information finns i https://aka.ms/futurecapacityreservation. Minsta API-version för framtida kapacitetsbokningar: 2026-04-01.
| Name |
Typ |
Description |
|
end
|
string
|
Det obligatoriska slutdatumet för bokningar av blockkapacitet. Måste vara efter startdatumet, med en varaktighet på antingen 1–14 hela dagar eller 3–26 hela veckor. Exempel: 2025-06-28.
|
|
minimumCommitmentDays
|
integer
(int32)
|
Det minsta antalet dagar som måste passera efter startdatumet innan en Future capacity-reservation kan uppdateras eller tas bort när den har genomförts. Kommer att fyllas med ett standardvärde om det inte tillhandahålls.
|
|
modifiableUntil
|
string
(date-time)
|
Datum/tid då en Future capacity-reservation kan uppdateras eller raderas. Read-only.
|
|
start
|
string
|
Det obligatoriska startdatumet för Block- eller Future-kapacitetsbokningar. Blocka kapacitetsbokningar: Måste ske idag eller inom 56 dagar i framtiden. För schemaläggning samma dag måste begäranden skickas före 11:30 UTC. Framtida kapacitetsbokningar: Måste vara minst 7 dagar in i framtiden och maximalt 6 månader framåt i tiden. Minsta API-version för framtida kapacitetsbokningar: 2026-04-01. Exempel: 2025-06-27, gäller både block- och framtida kapacitetsreservationer.
|
Sku
Objekt
Beskriver en SKU för vm-skalningsuppsättningar. Obs! Om den nya vm-SKU:n inte stöds på maskinvaran som skalningsuppsättningen för närvarande är på, måste du frigöra de virtuella datorerna i skalningsuppsättningen innan du ändrar SKU-namnet.
| Name |
Typ |
Description |
|
capacity
|
integer
(int64)
|
Anger antalet virtuella datorer i skalningsuppsättningen.
|
|
name
|
string
|
SKU-namnet.
|
|
tier
|
string
|
Anger nivån för virtuella datorer i en skalningsuppsättning.
Möjliga värden:
Standard
Grundläggande
|
StatusLevelTypes
Uppräkning
Nivåkoden.
| Värde |
Description |
|
Info
|
|
|
Warning
|
|
|
Error
|
|
SubResourceReadOnly
Objekt
| Name |
Typ |
Description |
|
id
|
string
|
Resurs-ID
|
systemData
Objekt
Metadata som rör skapande och senaste ändring av resursen.
| Name |
Typ |
Description |
|
createdAt
|
string
(date-time)
|
Tidsstämpeln för resursskapande (UTC).
|
|
createdBy
|
string
|
Identiteten som skapade resursen.
|
|
createdByType
|
createdByType
|
Den typ av identitet som skapade resursen.
|
|
lastModifiedAt
|
string
(date-time)
|
Tidsstämpeln för resursens senaste ändring (UTC)
|
|
lastModifiedBy
|
string
|
Identiteten som senast ändrade resursen.
|
|
lastModifiedByType
|
createdByType
|
Den typ av identitet som senast ändrade resursen.
|