Hetzner Cloud

Pulumi Official
Package maintained by Pulumi
v1.8.0 published on Wednesday, Mar 9, 2022 by Pulumi

getPlacementGroup

Provides details about a specific Hetzner Cloud Placement Group.

import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";

const samplePlacementGroup1 = pulumi.output(hcloud.getPlacementGroup({
    name: "sample-placement-group-1",
}));
const samplePlacementGroup2 = pulumi.output(hcloud.getPlacementGroup({
    id: 4711,
}));
import pulumi
import pulumi_hcloud as hcloud

sample_placement_group1 = hcloud.get_placement_group(name="sample-placement-group-1")
sample_placement_group2 = hcloud.get_placement_group(id=4711)
using Pulumi;
using HCloud = Pulumi.HCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var samplePlacementGroup1 = Output.Create(HCloud.GetPlacementGroup.InvokeAsync(new HCloud.GetPlacementGroupArgs
        {
            Name = "sample-placement-group-1",
        }));
        var samplePlacementGroup2 = Output.Create(HCloud.GetPlacementGroup.InvokeAsync(new HCloud.GetPlacementGroupArgs
        {
            Id = 4711,
        }));
    }

}
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 {
		opt0 := "sample-placement-group-1"
		_, err := hcloud.LookupPlacementGroup(ctx, &GetPlacementGroupArgs{
			Name: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		opt1 := 4711
		_, err = hcloud.LookupPlacementGroup(ctx, &GetPlacementGroupArgs{
			Id: &opt1,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

Using getPlacementGroup

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 getPlacementGroup(args: GetPlacementGroupArgs, opts?: InvokeOptions): Promise<GetPlacementGroupResult>
function getPlacementGroupOutput(args: GetPlacementGroupOutputArgs, opts?: InvokeOptions): Output<GetPlacementGroupResult>
def get_placement_group(id: Optional[int] = None,
                        labels: Optional[Mapping[str, Any]] = None,
                        most_recent: Optional[bool] = None,
                        name: Optional[str] = None,
                        type: Optional[str] = None,
                        with_selector: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetPlacementGroupResult
def get_placement_group_output(id: Optional[pulumi.Input[int]] = None,
                        labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                        most_recent: Optional[pulumi.Input[bool]] = None,
                        name: Optional[pulumi.Input[str]] = None,
                        type: Optional[pulumi.Input[str]] = None,
                        with_selector: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetPlacementGroupResult]
func LookupPlacementGroup(ctx *Context, args *LookupPlacementGroupArgs, opts ...InvokeOption) (*LookupPlacementGroupResult, error)
func LookupPlacementGroupOutput(ctx *Context, args *LookupPlacementGroupOutputArgs, opts ...InvokeOption) LookupPlacementGroupResultOutput

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

public static class GetPlacementGroup 
{
    public static Task<GetPlacementGroupResult> InvokeAsync(GetPlacementGroupArgs args, InvokeOptions? opts = null)
    public static Output<GetPlacementGroupResult> Invoke(GetPlacementGroupInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetPlacementGroupResult> getPlacementGroup(GetPlacementGroupArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: hcloud:index/getPlacementGroup:getPlacementGroup
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Id int

ID of the placement group.

Labels Dictionary<string, object>

(map) User-defined labels (key-value pairs)

MostRecent bool

Return most recent placement group if multiple are found.

Name string

Name of the placement group.

Type string

(string) Type of the Placement Group.

WithSelector string

Label selector

Id int

ID of the placement group.

Labels map[string]interface{}

(map) User-defined labels (key-value pairs)

MostRecent bool

Return most recent placement group if multiple are found.

Name string

Name of the placement group.

Type string

(string) Type of the Placement Group.

WithSelector string

Label selector

id Integer

ID of the placement group.

labels Map<String,Object>

(map) User-defined labels (key-value pairs)

mostRecent Boolean

Return most recent placement group if multiple are found.

name String

Name of the placement group.

type String

(string) Type of the Placement Group.

withSelector String

Label selector

id number

ID of the placement group.

labels {[key: string]: any}

(map) User-defined labels (key-value pairs)

mostRecent boolean

Return most recent placement group if multiple are found.

name string

Name of the placement group.

type string

(string) Type of the Placement Group.

withSelector string

Label selector

id int

ID of the placement group.

labels Mapping[str, Any]

(map) User-defined labels (key-value pairs)

most_recent bool

Return most recent placement group if multiple are found.

name str

Name of the placement group.

type str

(string) Type of the Placement Group.

with_selector str

Label selector

id Number

ID of the placement group.

labels Map<Any>

(map) User-defined labels (key-value pairs)

mostRecent Boolean

Return most recent placement group if multiple are found.

name String

Name of the placement group.

type String

(string) Type of the Placement Group.

withSelector String

Label selector

getPlacementGroup Result

The following output properties are available:

Name string

(string) Name of the Placement Group.

Servers List<int>
Id int

(int) Unique ID of the Placement Group.

Labels Dictionary<string, object>

(map) User-defined labels (key-value pairs)

MostRecent bool
Type string

(string) Type of the Placement Group.

WithSelector string
Name string

(string) Name of the Placement Group.

Servers []int
Id int

(int) Unique ID of the Placement Group.

Labels map[string]interface{}

(map) User-defined labels (key-value pairs)

MostRecent bool
Type string

(string) Type of the Placement Group.

WithSelector string
name String

(string) Name of the Placement Group.

servers List<Integer>
id Integer

(int) Unique ID of the Placement Group.

labels Map<String,Object>

(map) User-defined labels (key-value pairs)

mostRecent Boolean
type String

(string) Type of the Placement Group.

withSelector String
name string

(string) Name of the Placement Group.

servers number[]
id number

(int) Unique ID of the Placement Group.

labels {[key: string]: any}

(map) User-defined labels (key-value pairs)

mostRecent boolean
type string

(string) Type of the Placement Group.

withSelector string
name str

(string) Name of the Placement Group.

servers Sequence[int]
id int

(int) Unique ID of the Placement Group.

labels Mapping[str, Any]

(map) User-defined labels (key-value pairs)

most_recent bool
type str

(string) Type of the Placement Group.

with_selector str
name String

(string) Name of the Placement Group.

servers List<Number>
id Number

(int) Unique ID of the Placement Group.

labels Map<Any>

(map) User-defined labels (key-value pairs)

mostRecent Boolean
type String

(string) Type of the Placement Group.

withSelector 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.