Hetzner Cloud v1.21.0 published on Tuesday, Nov 12, 2024 by Pulumi
hcloud.getServers
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";
const s3 = hcloud.getServers({
withSelector: "key=value",
});
import pulumi
import pulumi_hcloud as hcloud
s3 = hcloud.get_servers(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.GetServers(ctx, &hcloud.GetServersArgs{
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 s3 = HCloud.GetServers.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.GetServersArgs;
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 s3 = HcloudFunctions.getServers(GetServersArgs.builder()
.withSelector("key=value")
.build());
}
}
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:
- With
Selector string - Label Selector. For more information about possible values, visit the Hetzner Cloud Documentation.
- With
Statuses List<string> - List only servers with the specified status, could contain
initializing
,starting
,running
,stopping
,off
,deleting
,rebuilding
,migrating
,unknown
.
- With
Selector string - Label Selector. For more information about possible values, visit the Hetzner Cloud Documentation.
- With
Statuses []string - List only servers with the specified status, could contain
initializing
,starting
,running
,stopping
,off
,deleting
,rebuilding
,migrating
,unknown
.
- with
Selector String - Label Selector. For more information about possible values, visit the Hetzner Cloud Documentation.
- with
Statuses List<String> - List only servers with the specified status, could contain
initializing
,starting
,running
,stopping
,off
,deleting
,rebuilding
,migrating
,unknown
.
- with
Selector string - Label Selector. For more information about possible values, visit the Hetzner Cloud Documentation.
- with
Statuses 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
.
- with
Selector String - Label Selector. For more information about possible values, visit the Hetzner Cloud Documentation.
- with
Statuses 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. Get Servers Server> - (list) List of all matching servers. See
data.hcloud_server
for schema. - With
Selector string - With
Statuses List<string>
- Id string
- The provider-assigned unique ID for this managed resource.
- Servers
[]Get
Servers Server - (list) List of all matching servers. See
data.hcloud_server
for schema. - With
Selector string - With
Statuses []string
- id String
- The provider-assigned unique ID for this managed resource.
- servers
List<Get
Servers Server> - (list) List of all matching servers. See
data.hcloud_server
for schema. - with
Selector String - with
Statuses List<String>
- id string
- The provider-assigned unique ID for this managed resource.
- servers
Get
Servers Server[] - (list) List of all matching servers. See
data.hcloud_server
for schema. - with
Selector string - with
Statuses string[]
- id str
- The provider-assigned unique ID for this managed resource.
- servers
Sequence[Get
Servers Server] - (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. - with
Selector String - with
Statuses List<String>
Supporting Types
GetServersServer
- Backup
Window string - Backups bool
- Datacenter string
- Delete
Protection bool - Firewall
Ids List<int> - Id int
- Image string
- Ipv4Address string
- Ipv6Address string
- Ipv6Network string
- Iso string
- Labels Dictionary<string, string>
- Location string
- Name string
- Primary
Disk intSize - Rebuild
Protection bool - Rescue string
- Server
Type string - Status string
- Placement
Group intId
- Backup
Window string - Backups bool
- Datacenter string
- Delete
Protection bool - Firewall
Ids []int - Id int
- Image string
- Ipv4Address string
- Ipv6Address string
- Ipv6Network string
- Iso string
- Labels map[string]string
- Location string
- Name string
- Primary
Disk intSize - Rebuild
Protection bool - Rescue string
- Server
Type string - Status string
- Placement
Group intId
- backup
Window String - backups Boolean
- datacenter String
- delete
Protection Boolean - firewall
Ids List<Integer> - id Integer
- image String
- ipv4Address String
- ipv6Address String
- ipv6Network String
- iso String
- labels Map<String,String>
- location String
- name String
- primary
Disk IntegerSize - rebuild
Protection Boolean - rescue String
- server
Type String - status String
- placement
Group IntegerId
- backup
Window string - backups boolean
- datacenter string
- delete
Protection boolean - firewall
Ids number[] - id number
- image string
- ipv4Address string
- ipv6Address string
- ipv6Network string
- iso string
- labels {[key: string]: string}
- location string
- name string
- primary
Disk numberSize - rebuild
Protection boolean - rescue string
- server
Type string - status string
- placement
Group numberId
- backup_
window str - backups bool
- datacenter str
- delete_
protection bool - firewall_
ids Sequence[int] - id int
- image str
- ipv4_
address str - ipv6_
address str - ipv6_
network str - iso str
- labels Mapping[str, str]
- location str
- name str
- primary_
disk_ intsize - rebuild_
protection bool - rescue str
- server_
type str - status str
- placement_
group_ intid
- backup
Window String - backups Boolean
- datacenter String
- delete
Protection Boolean - firewall
Ids List<Number> - id Number
- image String
- ipv4Address String
- ipv6Address String
- ipv6Network String
- iso String
- labels Map<String>
- location String
- name String
- primary
Disk NumberSize - rebuild
Protection Boolean - rescue String
- server
Type String - status String
- placement
Group NumberId
Package Details
- Repository
- Hetzner Cloud pulumi/pulumi-hcloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
hcloud
Terraform Provider.