Hetzner Cloud

v1.10.1 published on Wednesday, Aug 3, 2022 by Pulumi

getPlacementGroups

Provides details about multiple Hetzner Cloud Placement Groups.

Example Usage

using Pulumi;
using HCloud = Pulumi.HCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var samplePlacementGroup1 = Output.Create(HCloud.GetPlacementGroups.InvokeAsync());
        var samplePlacementGroup2 = Output.Create(HCloud.GetPlacementGroups.InvokeAsync(new HCloud.GetPlacementGroupsArgs
        {
            WithSelector = "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, nil, nil)
		if err != nil {
			return err
		}
		_, err = hcloud.GetPlacementGroups(ctx, &GetPlacementGroupsArgs{
			WithSelector: pulumi.StringRef("key=value"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var samplePlacementGroup1 = Output.of(HcloudFunctions.getPlacementGroups());

        final var samplePlacementGroup2 = Output.of(HcloudFunctions.getPlacementGroups(GetPlacementGroupsArgs.builder()
            .withSelector("key=value")
            .build()));

    }
}
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")
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";

const samplePlacementGroup1 = pulumi.output(hcloud.getPlacementGroups());
const samplePlacementGroup2 = pulumi.output(hcloud.getPlacementGroups({
    withSelector: "key=value",
}));
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

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

Package Details

Repository
https://github.com/pulumi/pulumi-hcloud
License
Apache-2.0
Notes

This Pulumi package is based on the hcloud Terraform Provider.