Hetzner Cloud

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

getServers

Example Usage

using Pulumi;
using HCloud = Pulumi.HCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var s3 = Output.Create(HCloud.GetServers.InvokeAsync(new HCloud.GetServersArgs
        {
            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.GetServers(ctx, &GetServersArgs{
			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 s3 = Output.of(HcloudFunctions.getServers(GetServersArgs.builder()
            .withSelector("key=value")
            .build()));

    }
}
import pulumi
import pulumi_hcloud as hcloud

s3 = hcloud.get_servers(with_selector="key=value")
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";

const s3 = pulumi.output(hcloud.getServers({
    withSelector: "key=value",
}));
variables:
  s3:
    Fn::Invoke:
      Function: hcloud:getServers
      Arguments:
        withSelector: key=value

Using getServers

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 getServers(args: GetServersArgs, opts?: InvokeOptions): Promise<GetServersResult>
function getServersOutput(args: GetServersOutputArgs, opts?: InvokeOptions): Output<GetServersResult>
def get_servers(with_selector: Optional[str] = None,
                with_statuses: Optional[Sequence[str]] = None,
                opts: Optional[InvokeOptions] = None) -> GetServersResult
def get_servers_output(with_selector: Optional[pulumi.Input[str]] = None,
                with_statuses: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetServersResult]
func GetServers(ctx *Context, args *GetServersArgs, opts ...InvokeOption) (*GetServersResult, error)
func GetServersOutput(ctx *Context, args *GetServersOutputArgs, opts ...InvokeOption) GetServersResultOutput

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

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

The following arguments are supported:

WithSelector string

Label Selector. For more information about possible values, visit the Hetzner Cloud Documentation.

WithStatuses List<string>

List only servers with the specified status, could contain initializing, starting, running, stopping, off, deleting, rebuilding, migrating, unknown.

WithSelector string

Label Selector. For more information about possible values, visit the Hetzner Cloud Documentation.

WithStatuses []string

List only servers with the specified status, could contain initializing, starting, running, stopping, off, deleting, rebuilding, migrating, unknown.

withSelector String

Label Selector. For more information about possible values, visit the Hetzner Cloud Documentation.

withStatuses List<String>

List only servers with the specified status, could contain initializing, starting, running, stopping, off, deleting, rebuilding, migrating, unknown.

withSelector string

Label Selector. For more information about possible values, visit the Hetzner Cloud Documentation.

withStatuses string[]

List only servers with the specified status, could contain initializing, starting, running, stopping, off, deleting, rebuilding, migrating, unknown.

with_selector str

Label Selector. For more information about possible values, visit the Hetzner Cloud Documentation.

with_statuses Sequence[str]

List only servers with the specified status, could contain initializing, starting, running, stopping, off, deleting, rebuilding, migrating, unknown.

withSelector String

Label Selector. For more information about possible values, visit the Hetzner Cloud Documentation.

withStatuses List<String>

List only servers with the specified status, could contain initializing, starting, running, stopping, off, deleting, rebuilding, migrating, unknown.

getServers Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Servers List<Pulumi.HCloud.Outputs.GetServersServer>

(list) List of all matching servers. See data.hcloud_server for schema.

WithSelector string
WithStatuses List<string>
Id string

The provider-assigned unique ID for this managed resource.

Servers []GetServersServer

(list) List of all matching servers. See data.hcloud_server for schema.

WithSelector string
WithStatuses []string
id String

The provider-assigned unique ID for this managed resource.

servers List<GetServersServer>

(list) List of all matching servers. See data.hcloud_server for schema.

withSelector String
withStatuses List<String>
id string

The provider-assigned unique ID for this managed resource.

servers GetServersServer[]

(list) List of all matching servers. See data.hcloud_server for schema.

withSelector string
withStatuses string[]
id str

The provider-assigned unique ID for this managed resource.

servers Sequence[GetServersServer]

(list) List of all matching servers. See data.hcloud_server for schema.

with_selector str
with_statuses Sequence[str]
id String

The provider-assigned unique ID for this managed resource.

servers List<Property Map>

(list) List of all matching servers. See data.hcloud_server for schema.

withSelector String
withStatuses List<String>

Supporting Types

GetServersServer

BackupWindow string
Backups bool
Datacenter string
DeleteProtection bool
FirewallIds List<int>
Id int
Image string
Ipv4Address string
Ipv6Address string
Ipv6Network string
Iso string
Labels Dictionary<string, object>
Location string
Name string
RebuildProtection bool
Rescue string
ServerType string
Status string
PlacementGroupId int
BackupWindow string
Backups bool
Datacenter string
DeleteProtection bool
FirewallIds []int
Id int
Image string
Ipv4Address string
Ipv6Address string
Ipv6Network string
Iso string
Labels map[string]interface{}
Location string
Name string
RebuildProtection bool
Rescue string
ServerType string
Status string
PlacementGroupId int
backupWindow String
backups Boolean
datacenter String
deleteProtection Boolean
firewallIds List<Integer>
id Integer
image String
ipv4Address String
ipv6Address String
ipv6Network String
iso String
labels Map<String,Object>
location String
name String
rebuildProtection Boolean
rescue String
serverType String
status String
placementGroupId Integer
backupWindow string
backups boolean
datacenter string
deleteProtection boolean
firewallIds number[]
id number
image string
ipv4Address string
ipv6Address string
ipv6Network string
iso string
labels {[key: string]: any}
location string
name string
rebuildProtection boolean
rescue string
serverType string
status string
placementGroupId number
backupWindow String
backups Boolean
datacenter String
deleteProtection Boolean
firewallIds List<Number>
id Number
image String
ipv4Address String
ipv6Address String
ipv6Network String
iso String
labels Map<Any>
location String
name String
rebuildProtection Boolean
rescue String
serverType String
status String
placementGroupId Number

Package Details

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

This Pulumi package is based on the hcloud Terraform Provider.