Get information about a Google Compute Engine Reservation Block. Reservation blocks are automatically created by Google Cloud within reservations and represent a physical grouping of resources.
For more information see the official documentation and the API.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const block = gcp.compute.getReservationBlock({
name: "my-reservation-block",
reservation: "my-reservation",
zone: "us-central1-a",
});
export const blockStatus = block.then(block => block.status);
export const blockInUseCount = block.then(block => block.inUseCount);
import pulumi
import pulumi_gcp as gcp
block = gcp.compute.get_reservation_block(name="my-reservation-block",
reservation="my-reservation",
zone="us-central1-a")
pulumi.export("blockStatus", block.status)
pulumi.export("blockInUseCount", block.in_use_count)
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
block, err := compute.GetReservationBlock(ctx, &compute.GetReservationBlockArgs{
Name: "my-reservation-block",
Reservation: "my-reservation",
Zone: pulumi.StringRef("us-central1-a"),
}, nil)
if err != nil {
return err
}
ctx.Export("blockStatus", block.Status)
ctx.Export("blockInUseCount", block.InUseCount)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var block = Gcp.Compute.GetReservationBlock.Invoke(new()
{
Name = "my-reservation-block",
Reservation = "my-reservation",
Zone = "us-central1-a",
});
return new Dictionary<string, object?>
{
["blockStatus"] = block.Apply(getReservationBlockResult => getReservationBlockResult.Status),
["blockInUseCount"] = block.Apply(getReservationBlockResult => getReservationBlockResult.InUseCount),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetReservationBlockArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var block = ComputeFunctions.getReservationBlock(GetReservationBlockArgs.builder()
.name("my-reservation-block")
.reservation("my-reservation")
.zone("us-central1-a")
.build());
ctx.export("blockStatus", block.status());
ctx.export("blockInUseCount", block.inUseCount());
}
}
variables:
block:
fn::invoke:
function: gcp:compute:getReservationBlock
arguments:
name: my-reservation-block
reservation: my-reservation
zone: us-central1-a
outputs:
blockStatus: ${block.status}
blockInUseCount: ${block.inUseCount}
Using getReservationBlock
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 getReservationBlock(args: GetReservationBlockArgs, opts?: InvokeOptions): Promise<GetReservationBlockResult>
function getReservationBlockOutput(args: GetReservationBlockOutputArgs, opts?: InvokeOptions): Output<GetReservationBlockResult>def get_reservation_block(name: Optional[str] = None,
project: Optional[str] = None,
reservation: Optional[str] = None,
zone: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetReservationBlockResult
def get_reservation_block_output(name: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
reservation: Optional[pulumi.Input[str]] = None,
zone: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetReservationBlockResult]func GetReservationBlock(ctx *Context, args *GetReservationBlockArgs, opts ...InvokeOption) (*GetReservationBlockResult, error)
func GetReservationBlockOutput(ctx *Context, args *GetReservationBlockOutputArgs, opts ...InvokeOption) GetReservationBlockResultOutput> Note: This function is named GetReservationBlock in the Go SDK.
public static class GetReservationBlock
{
public static Task<GetReservationBlockResult> InvokeAsync(GetReservationBlockArgs args, InvokeOptions? opts = null)
public static Output<GetReservationBlockResult> Invoke(GetReservationBlockInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetReservationBlockResult> getReservationBlock(GetReservationBlockArgs args, InvokeOptions options)
public static Output<GetReservationBlockResult> getReservationBlock(GetReservationBlockArgs args, InvokeOptions options)
fn::invoke:
function: gcp:compute/getReservationBlock:getReservationBlock
arguments:
# arguments dictionaryThe following arguments are supported:
- Name string
- The name of the reservation block.
- Reservation string
- The name of the parent reservation.
- Project string
- The project in which the resource belongs. If it is not provided, the provider project is used.
- Zone string
- The zone where the reservation block resides.
- Name string
- The name of the reservation block.
- Reservation string
- The name of the parent reservation.
- Project string
- The project in which the resource belongs. If it is not provided, the provider project is used.
- Zone string
- The zone where the reservation block resides.
- name String
- The name of the reservation block.
- reservation String
- The name of the parent reservation.
- project String
- The project in which the resource belongs. If it is not provided, the provider project is used.
- zone String
- The zone where the reservation block resides.
- name string
- The name of the reservation block.
- reservation string
- The name of the parent reservation.
- project string
- The project in which the resource belongs. If it is not provided, the provider project is used.
- zone string
- The zone where the reservation block resides.
- name str
- The name of the reservation block.
- reservation str
- The name of the parent reservation.
- project str
- The project in which the resource belongs. If it is not provided, the provider project is used.
- zone str
- The zone where the reservation block resides.
- name String
- The name of the reservation block.
- reservation String
- The name of the parent reservation.
- project String
- The project in which the resource belongs. If it is not provided, the provider project is used.
- zone String
- The zone where the reservation block resides.
getReservationBlock Result
The following output properties are available:
- Block
Count int - The number of resources that are allocated in this reservation block.
- Creation
Timestamp string - Creation timestamp in RFC3339 text format.
- Health
Infos List<GetReservation Block Health Info> - Health information for the reservation block. Structure is documented below.
- Id string
- The provider-assigned unique ID for this managed resource.
- In
Use intCount - The number of instances that are currently in use on this reservation block.
- Kind string
- Type of the resource. Always
compute#reservationBlockfor reservation blocks. - Name string
- Physical
Topologies List<GetReservation Block Physical Topology> - The physical topology of the reservation block. Structure is documented below.
- Project string
- Reservation string
- Reservation
Maintenances List<GetReservation Block Reservation Maintenance> - Maintenance information for this reservation block. Structure is documented below.
- Reservation
Sub intBlock Count - The number of reservation sub-blocks associated with this reservation block.
- Reservation
Sub intBlock In Use Count - The number of in-use reservation sub-blocks associated with this reservation block.
- Resource
Id string - The unique identifier for the resource.
- Self
Link string - Server-defined fully-qualified URL for this resource.
- Self
Link stringWith Id - Server-defined URL for this resource with the resource id.
- Status string
- Status of the reservation block.
- Sub
Block List<string>Names - A List of all block sub-block names in the parent block.
- Zone string
- Block
Count int - The number of resources that are allocated in this reservation block.
- Creation
Timestamp string - Creation timestamp in RFC3339 text format.
- Health
Infos []GetReservation Block Health Info - Health information for the reservation block. Structure is documented below.
- Id string
- The provider-assigned unique ID for this managed resource.
- In
Use intCount - The number of instances that are currently in use on this reservation block.
- Kind string
- Type of the resource. Always
compute#reservationBlockfor reservation blocks. - Name string
- Physical
Topologies []GetReservation Block Physical Topology - The physical topology of the reservation block. Structure is documented below.
- Project string
- Reservation string
- Reservation
Maintenances []GetReservation Block Reservation Maintenance - Maintenance information for this reservation block. Structure is documented below.
- Reservation
Sub intBlock Count - The number of reservation sub-blocks associated with this reservation block.
- Reservation
Sub intBlock In Use Count - The number of in-use reservation sub-blocks associated with this reservation block.
- Resource
Id string - The unique identifier for the resource.
- Self
Link string - Server-defined fully-qualified URL for this resource.
- Self
Link stringWith Id - Server-defined URL for this resource with the resource id.
- Status string
- Status of the reservation block.
- Sub
Block []stringNames - A List of all block sub-block names in the parent block.
- Zone string
- block
Count Integer - The number of resources that are allocated in this reservation block.
- creation
Timestamp String - Creation timestamp in RFC3339 text format.
- health
Infos List<GetReservation Block Health Info> - Health information for the reservation block. Structure is documented below.
- id String
- The provider-assigned unique ID for this managed resource.
- in
Use IntegerCount - The number of instances that are currently in use on this reservation block.
- kind String
- Type of the resource. Always
compute#reservationBlockfor reservation blocks. - name String
- physical
Topologies List<GetReservation Block Physical Topology> - The physical topology of the reservation block. Structure is documented below.
- project String
- reservation String
- reservation
Maintenances List<GetReservation Block Reservation Maintenance> - Maintenance information for this reservation block. Structure is documented below.
- reservation
Sub IntegerBlock Count - The number of reservation sub-blocks associated with this reservation block.
- reservation
Sub IntegerBlock In Use Count - The number of in-use reservation sub-blocks associated with this reservation block.
- resource
Id String - The unique identifier for the resource.
- self
Link String - Server-defined fully-qualified URL for this resource.
- self
Link StringWith Id - Server-defined URL for this resource with the resource id.
- status String
- Status of the reservation block.
- sub
Block List<String>Names - A List of all block sub-block names in the parent block.
- zone String
- block
Count number - The number of resources that are allocated in this reservation block.
- creation
Timestamp string - Creation timestamp in RFC3339 text format.
- health
Infos GetReservation Block Health Info[] - Health information for the reservation block. Structure is documented below.
- id string
- The provider-assigned unique ID for this managed resource.
- in
Use numberCount - The number of instances that are currently in use on this reservation block.
- kind string
- Type of the resource. Always
compute#reservationBlockfor reservation blocks. - name string
- physical
Topologies GetReservation Block Physical Topology[] - The physical topology of the reservation block. Structure is documented below.
- project string
- reservation string
- reservation
Maintenances GetReservation Block Reservation Maintenance[] - Maintenance information for this reservation block. Structure is documented below.
- reservation
Sub numberBlock Count - The number of reservation sub-blocks associated with this reservation block.
- reservation
Sub numberBlock In Use Count - The number of in-use reservation sub-blocks associated with this reservation block.
- resource
Id string - The unique identifier for the resource.
- self
Link string - Server-defined fully-qualified URL for this resource.
- self
Link stringWith Id - Server-defined URL for this resource with the resource id.
- status string
- Status of the reservation block.
- sub
Block string[]Names - A List of all block sub-block names in the parent block.
- zone string
- block_
count int - The number of resources that are allocated in this reservation block.
- creation_
timestamp str - Creation timestamp in RFC3339 text format.
- health_
infos Sequence[GetReservation Block Health Info] - Health information for the reservation block. Structure is documented below.
- id str
- The provider-assigned unique ID for this managed resource.
- in_
use_ intcount - The number of instances that are currently in use on this reservation block.
- kind str
- Type of the resource. Always
compute#reservationBlockfor reservation blocks. - name str
- physical_
topologies Sequence[GetReservation Block Physical Topology] - The physical topology of the reservation block. Structure is documented below.
- project str
- reservation str
- reservation_
maintenances Sequence[GetReservation Block Reservation Maintenance] - Maintenance information for this reservation block. Structure is documented below.
- reservation_
sub_ intblock_ count - The number of reservation sub-blocks associated with this reservation block.
- reservation_
sub_ intblock_ in_ use_ count - The number of in-use reservation sub-blocks associated with this reservation block.
- resource_
id str - The unique identifier for the resource.
- self_
link str - Server-defined fully-qualified URL for this resource.
- self_
link_ strwith_ id - Server-defined URL for this resource with the resource id.
- status str
- Status of the reservation block.
- sub_
block_ Sequence[str]names - A List of all block sub-block names in the parent block.
- zone str
- block
Count Number - The number of resources that are allocated in this reservation block.
- creation
Timestamp String - Creation timestamp in RFC3339 text format.
- health
Infos List<Property Map> - Health information for the reservation block. Structure is documented below.
- id String
- The provider-assigned unique ID for this managed resource.
- in
Use NumberCount - The number of instances that are currently in use on this reservation block.
- kind String
- Type of the resource. Always
compute#reservationBlockfor reservation blocks. - name String
- physical
Topologies List<Property Map> - The physical topology of the reservation block. Structure is documented below.
- project String
- reservation String
- reservation
Maintenances List<Property Map> - Maintenance information for this reservation block. Structure is documented below.
- reservation
Sub NumberBlock Count - The number of reservation sub-blocks associated with this reservation block.
- reservation
Sub NumberBlock In Use Count - The number of in-use reservation sub-blocks associated with this reservation block.
- resource
Id String - The unique identifier for the resource.
- self
Link String - Server-defined fully-qualified URL for this resource.
- self
Link StringWith Id - Server-defined URL for this resource with the resource id.
- status String
- Status of the reservation block.
- sub
Block List<String>Names - A List of all block sub-block names in the parent block.
- zone String
Supporting Types
GetReservationBlockHealthInfo
- Degraded
Sub intBlock Count - The number of sub-blocks that are degraded.
- Health
Status string - The health status of the reservation block.
- Healthy
Sub intBlock Count - The number of sub-blocks that are healthy.
- Degraded
Sub intBlock Count - The number of sub-blocks that are degraded.
- Health
Status string - The health status of the reservation block.
- Healthy
Sub intBlock Count - The number of sub-blocks that are healthy.
- degraded
Sub IntegerBlock Count - The number of sub-blocks that are degraded.
- health
Status String - The health status of the reservation block.
- healthy
Sub IntegerBlock Count - The number of sub-blocks that are healthy.
- degraded
Sub numberBlock Count - The number of sub-blocks that are degraded.
- health
Status string - The health status of the reservation block.
- healthy
Sub numberBlock Count - The number of sub-blocks that are healthy.
- degraded_
sub_ intblock_ count - The number of sub-blocks that are degraded.
- health_
status str - The health status of the reservation block.
- healthy_
sub_ intblock_ count - The number of sub-blocks that are healthy.
- degraded
Sub NumberBlock Count - The number of sub-blocks that are degraded.
- health
Status String - The health status of the reservation block.
- healthy
Sub NumberBlock Count - The number of sub-blocks that are healthy.
GetReservationBlockPhysicalTopology
GetReservationBlockReservationMaintenance
- Instance
Maintenance intOngoing Count - Number of instances that have ongoing maintenance.
- Instance
Maintenance intPending Count - Number of instances that have pending maintenance.
- Maintenance
Ongoing intCount - Number of hosts in the block that have ongoing maintenance.
- Maintenance
Pending intCount - Number of hosts in the block that have pending maintenance.
- Scheduling
Type string - The type of maintenance for the reservation.
- Subblock
Infra intMaintenance Ongoing Count - Number of sub-block infrastructure that has ongoing maintenance.
- Subblock
Infra intMaintenance Pending Count - Number of sub-block infrastructure that has pending maintenance.
- Instance
Maintenance intOngoing Count - Number of instances that have ongoing maintenance.
- Instance
Maintenance intPending Count - Number of instances that have pending maintenance.
- Maintenance
Ongoing intCount - Number of hosts in the block that have ongoing maintenance.
- Maintenance
Pending intCount - Number of hosts in the block that have pending maintenance.
- Scheduling
Type string - The type of maintenance for the reservation.
- Subblock
Infra intMaintenance Ongoing Count - Number of sub-block infrastructure that has ongoing maintenance.
- Subblock
Infra intMaintenance Pending Count - Number of sub-block infrastructure that has pending maintenance.
- instance
Maintenance IntegerOngoing Count - Number of instances that have ongoing maintenance.
- instance
Maintenance IntegerPending Count - Number of instances that have pending maintenance.
- maintenance
Ongoing IntegerCount - Number of hosts in the block that have ongoing maintenance.
- maintenance
Pending IntegerCount - Number of hosts in the block that have pending maintenance.
- scheduling
Type String - The type of maintenance for the reservation.
- subblock
Infra IntegerMaintenance Ongoing Count - Number of sub-block infrastructure that has ongoing maintenance.
- subblock
Infra IntegerMaintenance Pending Count - Number of sub-block infrastructure that has pending maintenance.
- instance
Maintenance numberOngoing Count - Number of instances that have ongoing maintenance.
- instance
Maintenance numberPending Count - Number of instances that have pending maintenance.
- maintenance
Ongoing numberCount - Number of hosts in the block that have ongoing maintenance.
- maintenance
Pending numberCount - Number of hosts in the block that have pending maintenance.
- scheduling
Type string - The type of maintenance for the reservation.
- subblock
Infra numberMaintenance Ongoing Count - Number of sub-block infrastructure that has ongoing maintenance.
- subblock
Infra numberMaintenance Pending Count - Number of sub-block infrastructure that has pending maintenance.
- instance_
maintenance_ intongoing_ count - Number of instances that have ongoing maintenance.
- instance_
maintenance_ intpending_ count - Number of instances that have pending maintenance.
- maintenance_
ongoing_ intcount - Number of hosts in the block that have ongoing maintenance.
- maintenance_
pending_ intcount - Number of hosts in the block that have pending maintenance.
- scheduling_
type str - The type of maintenance for the reservation.
- subblock_
infra_ intmaintenance_ ongoing_ count - Number of sub-block infrastructure that has ongoing maintenance.
- subblock_
infra_ intmaintenance_ pending_ count - Number of sub-block infrastructure that has pending maintenance.
- instance
Maintenance NumberOngoing Count - Number of instances that have ongoing maintenance.
- instance
Maintenance NumberPending Count - Number of instances that have pending maintenance.
- maintenance
Ongoing NumberCount - Number of hosts in the block that have ongoing maintenance.
- maintenance
Pending NumberCount - Number of hosts in the block that have pending maintenance.
- scheduling
Type String - The type of maintenance for the reservation.
- subblock
Infra NumberMaintenance Ongoing Count - Number of sub-block infrastructure that has ongoing maintenance.
- subblock
Infra NumberMaintenance Pending Count - Number of sub-block infrastructure that has pending maintenance.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.
