1. Packages
  2. Azure Native
  3. API Docs
  4. compute
  5. getCapacityReservation
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.7.1 published on Wednesday, Aug 13, 2025 by Pulumi

azure-native.compute.getCapacityReservation

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.7.1 published on Wednesday, Aug 13, 2025 by Pulumi

    The operation that retrieves information about the capacity reservation.

    Uses Azure REST API version 2024-11-01.

    Other available API versions: 2022-08-01, 2022-11-01, 2023-03-01, 2023-07-01, 2023-09-01, 2024-03-01, 2024-07-01. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native compute [ApiVersion]. See the version guide for details.

    Using getCapacityReservation

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getCapacityReservation(args: GetCapacityReservationArgs, opts?: InvokeOptions): Promise<GetCapacityReservationResult>
    function getCapacityReservationOutput(args: GetCapacityReservationOutputArgs, opts?: InvokeOptions): Output<GetCapacityReservationResult>
    def get_capacity_reservation(capacity_reservation_group_name: Optional[str] = None,
                                 capacity_reservation_name: Optional[str] = None,
                                 expand: Optional[str] = None,
                                 resource_group_name: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetCapacityReservationResult
    def get_capacity_reservation_output(capacity_reservation_group_name: Optional[pulumi.Input[str]] = None,
                                 capacity_reservation_name: Optional[pulumi.Input[str]] = None,
                                 expand: Optional[pulumi.Input[str]] = None,
                                 resource_group_name: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetCapacityReservationResult]
    func LookupCapacityReservation(ctx *Context, args *LookupCapacityReservationArgs, opts ...InvokeOption) (*LookupCapacityReservationResult, error)
    func LookupCapacityReservationOutput(ctx *Context, args *LookupCapacityReservationOutputArgs, opts ...InvokeOption) LookupCapacityReservationResultOutput

    > Note: This function is named LookupCapacityReservation in the Go SDK.

    public static class GetCapacityReservation 
    {
        public static Task<GetCapacityReservationResult> InvokeAsync(GetCapacityReservationArgs args, InvokeOptions? opts = null)
        public static Output<GetCapacityReservationResult> Invoke(GetCapacityReservationInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCapacityReservationResult> getCapacityReservation(GetCapacityReservationArgs args, InvokeOptions options)
    public static Output<GetCapacityReservationResult> getCapacityReservation(GetCapacityReservationArgs args, InvokeOptions options)
    
    fn::invoke:
      function: azure-native:compute:getCapacityReservation
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CapacityReservationGroupName string
    The name of the capacity reservation group.
    CapacityReservationName string
    The name of the capacity reservation.
    ResourceGroupName string
    The name of the resource group. The name is case insensitive.
    Expand string
    The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations.
    CapacityReservationGroupName string
    The name of the capacity reservation group.
    CapacityReservationName string
    The name of the capacity reservation.
    ResourceGroupName string
    The name of the resource group. The name is case insensitive.
    Expand string
    The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations.
    capacityReservationGroupName String
    The name of the capacity reservation group.
    capacityReservationName String
    The name of the capacity reservation.
    resourceGroupName String
    The name of the resource group. The name is case insensitive.
    expand String
    The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations.
    capacityReservationGroupName string
    The name of the capacity reservation group.
    capacityReservationName string
    The name of the capacity reservation.
    resourceGroupName string
    The name of the resource group. The name is case insensitive.
    expand string
    The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations.
    capacity_reservation_group_name str
    The name of the capacity reservation group.
    capacity_reservation_name str
    The name of the capacity reservation.
    resource_group_name str
    The name of the resource group. The name is case insensitive.
    expand str
    The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations.
    capacityReservationGroupName String
    The name of the capacity reservation group.
    capacityReservationName String
    The name of the capacity reservation.
    resourceGroupName String
    The name of the resource group. The name is case insensitive.
    expand String
    The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations.

    getCapacityReservation Result

    The following output properties are available:

    AzureApiVersion string
    The Azure API version of the resource.
    Id string
    Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
    InstanceView Pulumi.AzureNative.Compute.Outputs.CapacityReservationInstanceViewResponse
    The Capacity reservation instance view.
    Location string
    The geo-location where the resource lives
    Name string
    The name of the resource
    PlatformFaultDomainCount int
    Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. Note: The fault domain count specified for a resource (like virtual machines scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01.
    ProvisioningState string
    The provisioning state, which only appears in the response.
    ProvisioningTime string
    The date time when the capacity reservation was last updated.
    ReservationId string
    A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource.
    Sku Pulumi.AzureNative.Compute.Outputs.SkuResponse
    SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values.
    SystemData Pulumi.AzureNative.Compute.Outputs.SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    TimeCreated string
    Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01.
    Type string
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    VirtualMachinesAssociated List<Pulumi.AzureNative.Compute.Outputs.SubResourceReadOnlyResponse>
    A list of all virtual machine resource ids that are associated with the capacity reservation.
    Tags Dictionary<string, string>
    Resource tags.
    Zones List<string>
    The availability zones.
    AzureApiVersion string
    The Azure API version of the resource.
    Id string
    Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
    InstanceView CapacityReservationInstanceViewResponse
    The Capacity reservation instance view.
    Location string
    The geo-location where the resource lives
    Name string
    The name of the resource
    PlatformFaultDomainCount int
    Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. Note: The fault domain count specified for a resource (like virtual machines scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01.
    ProvisioningState string
    The provisioning state, which only appears in the response.
    ProvisioningTime string
    The date time when the capacity reservation was last updated.
    ReservationId string
    A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource.
    Sku SkuResponse
    SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values.
    SystemData SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    TimeCreated string
    Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01.
    Type string
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    VirtualMachinesAssociated []SubResourceReadOnlyResponse
    A list of all virtual machine resource ids that are associated with the capacity reservation.
    Tags map[string]string
    Resource tags.
    Zones []string
    The availability zones.
    azureApiVersion String
    The Azure API version of the resource.
    id String
    Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
    instanceView CapacityReservationInstanceViewResponse
    The Capacity reservation instance view.
    location String
    The geo-location where the resource lives
    name String
    The name of the resource
    platformFaultDomainCount Integer
    Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. Note: The fault domain count specified for a resource (like virtual machines scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01.
    provisioningState String
    The provisioning state, which only appears in the response.
    provisioningTime String
    The date time when the capacity reservation was last updated.
    reservationId String
    A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource.
    sku SkuResponse
    SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values.
    systemData SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    timeCreated String
    Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01.
    type String
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    virtualMachinesAssociated List<SubResourceReadOnlyResponse>
    A list of all virtual machine resource ids that are associated with the capacity reservation.
    tags Map<String,String>
    Resource tags.
    zones List<String>
    The availability zones.
    azureApiVersion string
    The Azure API version of the resource.
    id string
    Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
    instanceView CapacityReservationInstanceViewResponse
    The Capacity reservation instance view.
    location string
    The geo-location where the resource lives
    name string
    The name of the resource
    platformFaultDomainCount number
    Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. Note: The fault domain count specified for a resource (like virtual machines scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01.
    provisioningState string
    The provisioning state, which only appears in the response.
    provisioningTime string
    The date time when the capacity reservation was last updated.
    reservationId string
    A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource.
    sku SkuResponse
    SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values.
    systemData SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    timeCreated string
    Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01.
    type string
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    virtualMachinesAssociated SubResourceReadOnlyResponse[]
    A list of all virtual machine resource ids that are associated with the capacity reservation.
    tags {[key: string]: string}
    Resource tags.
    zones string[]
    The availability zones.
    azure_api_version str
    The Azure API version of the resource.
    id str
    Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
    instance_view CapacityReservationInstanceViewResponse
    The Capacity reservation instance view.
    location str
    The geo-location where the resource lives
    name str
    The name of the resource
    platform_fault_domain_count int
    Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. Note: The fault domain count specified for a resource (like virtual machines scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01.
    provisioning_state str
    The provisioning state, which only appears in the response.
    provisioning_time str
    The date time when the capacity reservation was last updated.
    reservation_id str
    A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource.
    sku SkuResponse
    SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values.
    system_data SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    time_created str
    Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01.
    type str
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    virtual_machines_associated Sequence[SubResourceReadOnlyResponse]
    A list of all virtual machine resource ids that are associated with the capacity reservation.
    tags Mapping[str, str]
    Resource tags.
    zones Sequence[str]
    The availability zones.
    azureApiVersion String
    The Azure API version of the resource.
    id String
    Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
    instanceView Property Map
    The Capacity reservation instance view.
    location String
    The geo-location where the resource lives
    name String
    The name of the resource
    platformFaultDomainCount Number
    Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. Note: The fault domain count specified for a resource (like virtual machines scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01.
    provisioningState String
    The provisioning state, which only appears in the response.
    provisioningTime String
    The date time when the capacity reservation was last updated.
    reservationId String
    A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource.
    sku Property Map
    SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values.
    systemData Property Map
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    timeCreated String
    Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01.
    type String
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    virtualMachinesAssociated List<Property Map>
    A list of all virtual machine resource ids that are associated with the capacity reservation.
    tags Map<String>
    Resource tags.
    zones List<String>
    The availability zones.

    Supporting Types

    CapacityReservationInstanceViewResponse

    Statuses []InstanceViewStatusResponse
    The resource status information.
    UtilizationInfo CapacityReservationUtilizationResponse
    Unutilized capacity of the capacity reservation.
    statuses List<InstanceViewStatusResponse>
    The resource status information.
    utilizationInfo CapacityReservationUtilizationResponse
    Unutilized capacity of the capacity reservation.
    statuses InstanceViewStatusResponse[]
    The resource status information.
    utilizationInfo CapacityReservationUtilizationResponse
    Unutilized capacity of the capacity reservation.
    statuses Sequence[InstanceViewStatusResponse]
    The resource status information.
    utilization_info CapacityReservationUtilizationResponse
    Unutilized capacity of the capacity reservation.
    statuses List<Property Map>
    The resource status information.
    utilizationInfo Property Map
    Unutilized capacity of the capacity reservation.

    CapacityReservationUtilizationResponse

    CurrentCapacity int
    The value provides the current capacity of the VM size which was reserved successfully and for which the customer is getting billed. Minimum api-version: 2022-08-01.
    VirtualMachinesAllocated List<Pulumi.AzureNative.Compute.Inputs.SubResourceReadOnlyResponse>
    A list of all virtual machines resource ids allocated against the capacity reservation.
    CurrentCapacity int
    The value provides the current capacity of the VM size which was reserved successfully and for which the customer is getting billed. Minimum api-version: 2022-08-01.
    VirtualMachinesAllocated []SubResourceReadOnlyResponse
    A list of all virtual machines resource ids allocated against the capacity reservation.
    currentCapacity Integer
    The value provides the current capacity of the VM size which was reserved successfully and for which the customer is getting billed. Minimum api-version: 2022-08-01.
    virtualMachinesAllocated List<SubResourceReadOnlyResponse>
    A list of all virtual machines resource ids allocated against the capacity reservation.
    currentCapacity number
    The value provides the current capacity of the VM size which was reserved successfully and for which the customer is getting billed. Minimum api-version: 2022-08-01.
    virtualMachinesAllocated SubResourceReadOnlyResponse[]
    A list of all virtual machines resource ids allocated against the capacity reservation.
    current_capacity int
    The value provides the current capacity of the VM size which was reserved successfully and for which the customer is getting billed. Minimum api-version: 2022-08-01.
    virtual_machines_allocated Sequence[SubResourceReadOnlyResponse]
    A list of all virtual machines resource ids allocated against the capacity reservation.
    currentCapacity Number
    The value provides the current capacity of the VM size which was reserved successfully and for which the customer is getting billed. Minimum api-version: 2022-08-01.
    virtualMachinesAllocated List<Property Map>
    A list of all virtual machines resource ids allocated against the capacity reservation.

    InstanceViewStatusResponse

    Code string
    The status code.
    DisplayStatus string
    The short localizable label for the status.
    Level string
    The level code.
    Message string
    The detailed status message, including for alerts and error messages.
    Time string
    The time of the status.
    Code string
    The status code.
    DisplayStatus string
    The short localizable label for the status.
    Level string
    The level code.
    Message string
    The detailed status message, including for alerts and error messages.
    Time string
    The time of the status.
    code String
    The status code.
    displayStatus String
    The short localizable label for the status.
    level String
    The level code.
    message String
    The detailed status message, including for alerts and error messages.
    time String
    The time of the status.
    code string
    The status code.
    displayStatus string
    The short localizable label for the status.
    level string
    The level code.
    message string
    The detailed status message, including for alerts and error messages.
    time string
    The time of the status.
    code str
    The status code.
    display_status str
    The short localizable label for the status.
    level str
    The level code.
    message str
    The detailed status message, including for alerts and error messages.
    time str
    The time of the status.
    code String
    The status code.
    displayStatus String
    The short localizable label for the status.
    level String
    The level code.
    message String
    The detailed status message, including for alerts and error messages.
    time String
    The time of the status.

    SkuResponse

    Capacity double
    Specifies the number of virtual machines in the scale set.
    Name string
    The sku name.
    Tier string
    Specifies the tier of virtual machines in a scale set. Possible Values: Standard Basic
    Capacity float64
    Specifies the number of virtual machines in the scale set.
    Name string
    The sku name.
    Tier string
    Specifies the tier of virtual machines in a scale set. Possible Values: Standard Basic
    capacity Double
    Specifies the number of virtual machines in the scale set.
    name String
    The sku name.
    tier String
    Specifies the tier of virtual machines in a scale set. Possible Values: Standard Basic
    capacity number
    Specifies the number of virtual machines in the scale set.
    name string
    The sku name.
    tier string
    Specifies the tier of virtual machines in a scale set. Possible Values: Standard Basic
    capacity float
    Specifies the number of virtual machines in the scale set.
    name str
    The sku name.
    tier str
    Specifies the tier of virtual machines in a scale set. Possible Values: Standard Basic
    capacity Number
    Specifies the number of virtual machines in the scale set.
    name String
    The sku name.
    tier String
    Specifies the tier of virtual machines in a scale set. Possible Values: Standard Basic

    SubResourceReadOnlyResponse

    Id string
    Resource Id
    Id string
    Resource Id
    id String
    Resource Id
    id string
    Resource Id
    id str
    Resource Id
    id String
    Resource Id

    SystemDataResponse

    CreatedAt string
    The timestamp of resource creation (UTC).
    CreatedBy string
    The identity that created the resource.
    CreatedByType string
    The type of identity that created the resource.
    LastModifiedAt string
    The timestamp of resource last modification (UTC)
    LastModifiedBy string
    The identity that last modified the resource.
    LastModifiedByType string
    The type of identity that last modified the resource.
    CreatedAt string
    The timestamp of resource creation (UTC).
    CreatedBy string
    The identity that created the resource.
    CreatedByType string
    The type of identity that created the resource.
    LastModifiedAt string
    The timestamp of resource last modification (UTC)
    LastModifiedBy string
    The identity that last modified the resource.
    LastModifiedByType string
    The type of identity that last modified the resource.
    createdAt String
    The timestamp of resource creation (UTC).
    createdBy String
    The identity that created the resource.
    createdByType String
    The type of identity that created the resource.
    lastModifiedAt String
    The timestamp of resource last modification (UTC)
    lastModifiedBy String
    The identity that last modified the resource.
    lastModifiedByType String
    The type of identity that last modified the resource.
    createdAt string
    The timestamp of resource creation (UTC).
    createdBy string
    The identity that created the resource.
    createdByType string
    The type of identity that created the resource.
    lastModifiedAt string
    The timestamp of resource last modification (UTC)
    lastModifiedBy string
    The identity that last modified the resource.
    lastModifiedByType string
    The type of identity that last modified the resource.
    created_at str
    The timestamp of resource creation (UTC).
    created_by str
    The identity that created the resource.
    created_by_type str
    The type of identity that created the resource.
    last_modified_at str
    The timestamp of resource last modification (UTC)
    last_modified_by str
    The identity that last modified the resource.
    last_modified_by_type str
    The type of identity that last modified the resource.
    createdAt String
    The timestamp of resource creation (UTC).
    createdBy String
    The identity that created the resource.
    createdByType String
    The type of identity that created the resource.
    lastModifiedAt String
    The timestamp of resource last modification (UTC)
    lastModifiedBy String
    The identity that last modified the resource.
    lastModifiedByType String
    The type of identity that last modified the resource.

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
    Azure Native v3.7.1 published on Wednesday, Aug 13, 2025 by Pulumi