1. Packages
  2. Hcloud Provider
  3. API Docs
  4. getPlacementGroups
Hetzner Cloud v1.21.0 published on Tuesday, Nov 12, 2024 by Pulumi

hcloud.getPlacementGroups

Explore with Pulumi AI

hcloud logo
Hetzner Cloud v1.21.0 published on Tuesday, Nov 12, 2024 by Pulumi

    Provides details about multiple Hetzner Cloud Placement Groups.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as hcloud from "@pulumi/hcloud";
    
    const samplePlacementGroup1 = hcloud.getPlacementGroups({});
    const samplePlacementGroup2 = hcloud.getPlacementGroups({
        withSelector: "key=value",
    });
    
    import pulumi
    import pulumi_hcloud as hcloud
    
    sample_placement_group1 = hcloud.get_placement_groups()
    sample_placement_group2 = hcloud.get_placement_groups(with_selector="key=value")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-hcloud/sdk/go/hcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := hcloud.GetPlacementGroups(ctx, &hcloud.GetPlacementGroupsArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = hcloud.GetPlacementGroups(ctx, &hcloud.GetPlacementGroupsArgs{
    			WithSelector: pulumi.StringRef("key=value"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using HCloud = Pulumi.HCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var samplePlacementGroup1 = HCloud.GetPlacementGroups.Invoke();
    
        var samplePlacementGroup2 = HCloud.GetPlacementGroups.Invoke(new()
        {
            WithSelector = "key=value",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.hcloud.HcloudFunctions;
    import com.pulumi.hcloud.inputs.GetPlacementGroupsArgs;
    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 samplePlacementGroup1 = HcloudFunctions.getPlacementGroups();
    
            final var samplePlacementGroup2 = HcloudFunctions.getPlacementGroups(GetPlacementGroupsArgs.builder()
                .withSelector("key=value")
                .build());
    
        }
    }
    
    variables:
      samplePlacementGroup1:
        fn::invoke:
          Function: hcloud:getPlacementGroups
          Arguments: {}
      samplePlacementGroup2:
        fn::invoke:
          Function: hcloud:getPlacementGroups
          Arguments:
            withSelector: key=value
    

    Using getPlacementGroups

    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 getPlacementGroups(args: GetPlacementGroupsArgs, opts?: InvokeOptions): Promise<GetPlacementGroupsResult>
    function getPlacementGroupsOutput(args: GetPlacementGroupsOutputArgs, opts?: InvokeOptions): Output<GetPlacementGroupsResult>
    def get_placement_groups(most_recent: Optional[bool] = None,
                             with_selector: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetPlacementGroupsResult
    def get_placement_groups_output(most_recent: Optional[pulumi.Input[bool]] = None,
                             with_selector: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetPlacementGroupsResult]
    func GetPlacementGroups(ctx *Context, args *GetPlacementGroupsArgs, opts ...InvokeOption) (*GetPlacementGroupsResult, error)
    func GetPlacementGroupsOutput(ctx *Context, args *GetPlacementGroupsOutputArgs, opts ...InvokeOption) GetPlacementGroupsResultOutput

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

    public static class GetPlacementGroups 
    {
        public static Task<GetPlacementGroupsResult> InvokeAsync(GetPlacementGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetPlacementGroupsResult> Invoke(GetPlacementGroupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPlacementGroupsResult> getPlacementGroups(GetPlacementGroupsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: hcloud:index/getPlacementGroups:getPlacementGroups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    MostRecent bool
    Sorts list by date.
    WithSelector string
    Label selector
    MostRecent bool
    Sorts list by date.
    WithSelector string
    Label selector
    mostRecent Boolean
    Sorts list by date.
    withSelector String
    Label selector
    mostRecent boolean
    Sorts list by date.
    withSelector string
    Label selector
    most_recent bool
    Sorts list by date.
    with_selector str
    Label selector
    mostRecent Boolean
    Sorts list by date.
    withSelector String
    Label selector

    getPlacementGroups Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    PlacementGroups List<Pulumi.HCloud.Outputs.GetPlacementGroupsPlacementGroup>
    (list) List of all matching placement groups. See data.hcloud_placement_group for schema.
    MostRecent bool
    WithSelector string
    Id string
    The provider-assigned unique ID for this managed resource.
    PlacementGroups []GetPlacementGroupsPlacementGroup
    (list) List of all matching placement groups. See data.hcloud_placement_group for schema.
    MostRecent bool
    WithSelector string
    id String
    The provider-assigned unique ID for this managed resource.
    placementGroups List<GetPlacementGroupsPlacementGroup>
    (list) List of all matching placement groups. See data.hcloud_placement_group for schema.
    mostRecent Boolean
    withSelector String
    id string
    The provider-assigned unique ID for this managed resource.
    placementGroups GetPlacementGroupsPlacementGroup[]
    (list) List of all matching placement groups. See data.hcloud_placement_group for schema.
    mostRecent boolean
    withSelector string
    id str
    The provider-assigned unique ID for this managed resource.
    placement_groups Sequence[GetPlacementGroupsPlacementGroup]
    (list) List of all matching placement groups. See data.hcloud_placement_group for schema.
    most_recent bool
    with_selector str
    id String
    The provider-assigned unique ID for this managed resource.
    placementGroups List<Property Map>
    (list) List of all matching placement groups. See data.hcloud_placement_group for schema.
    mostRecent Boolean
    withSelector String

    Supporting Types

    GetPlacementGroupsPlacementGroup

    Id int
    Labels Dictionary<string, string>
    Name string
    Servers List<int>
    Type string
    Id int
    Labels map[string]string
    Name string
    Servers []int
    Type string
    id Integer
    labels Map<String,String>
    name String
    servers List<Integer>
    type String
    id number
    labels {[key: string]: string}
    name string
    servers number[]
    type string
    id int
    labels Mapping[str, str]
    name str
    servers Sequence[int]
    type str
    id Number
    labels Map<String>
    name String
    servers List<Number>
    type String

    Package Details

    Repository
    Hetzner Cloud pulumi/pulumi-hcloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the hcloud Terraform Provider.
    hcloud logo
    Hetzner Cloud v1.21.0 published on Tuesday, Nov 12, 2024 by Pulumi