1. Packages
  2. UpCloud
  3. API Docs
  4. getHosts
UpCloud v0.1.0 published on Friday, Mar 14, 2025 by UpCloudLtd

upcloud.getHosts

Explore with Pulumi AI

UpCloud v0.1.0 published on Friday, Mar 14, 2025 by UpCloudLtd

Returns a list of available UpCloud hosts. A host identifies the host server that virtual machines are run on. Only hosts on private cloud to which the calling account has access to are available through this resource.

Example Usage

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

const allHosts = upcloud.getHosts({});
Copy
import pulumi
import pulumi_upcloud as upcloud

all_hosts = upcloud.get_hosts()
Copy
package main

import (
	"github.com/UpCloudLtd/pulumi-upcloud/sdk/go/upcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := upcloud.GetHosts(ctx, &upcloud.GetHostsArgs{}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using UpCloud = Pulumi.UpCloud;

return await Deployment.RunAsync(() => 
{
    var allHosts = UpCloud.GetHosts.Invoke();

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.upcloud.UpcloudFunctions;
import com.pulumi.upcloud.inputs.GetHostsArgs;
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 allHosts = UpcloudFunctions.getHosts();

    }
}
Copy
variables:
  allHosts:
    fn::invoke:
      function: upcloud:getHosts
      arguments: {}
Copy

Using getHosts

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 getHosts(args: GetHostsArgs, opts?: InvokeOptions): Promise<GetHostsResult>
function getHostsOutput(args: GetHostsOutputArgs, opts?: InvokeOptions): Output<GetHostsResult>
Copy
def get_hosts(hosts: Optional[Sequence[GetHostsHost]] = None,
              opts: Optional[InvokeOptions] = None) -> GetHostsResult
def get_hosts_output(hosts: Optional[pulumi.Input[Sequence[pulumi.Input[GetHostsHostArgs]]]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetHostsResult]
Copy
func GetHosts(ctx *Context, args *GetHostsArgs, opts ...InvokeOption) (*GetHostsResult, error)
func GetHostsOutput(ctx *Context, args *GetHostsOutputArgs, opts ...InvokeOption) GetHostsResultOutput
Copy

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

public static class GetHosts 
{
    public static Task<GetHostsResult> InvokeAsync(GetHostsArgs args, InvokeOptions? opts = null)
    public static Output<GetHostsResult> Invoke(GetHostsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetHostsResult> getHosts(GetHostsArgs args, InvokeOptions options)
public static Output<GetHostsResult> getHosts(GetHostsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: upcloud:index/getHosts:getHosts
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

getHosts Result

The following output properties are available:

Id string
The ID of this resource.
Hosts []GetHostsHost
id String
The ID of this resource.
hosts List<GetHostsHost>
id string
The ID of this resource.
hosts GetHostsHost[]
id str
The ID of this resource.
hosts Sequence[GetHostsHost]
id String
The ID of this resource.
hosts List<Property Map>

Supporting Types

GetHostsHost

Description This property is required. string
Free form text describing the host
HostId This property is required. int
The unique id of the host
WindowsEnabled This property is required. bool
If true, this node can be used as a host for Windows servers.
Zone This property is required. string
The zone the host is in, e.g. de-fra1. You can list available zones with upctl zone list.
Statistics List<UpCloud.Pulumi.UpCloud.Inputs.GetHostsHostStatistic>
Description This property is required. string
Free form text describing the host
HostId This property is required. int
The unique id of the host
WindowsEnabled This property is required. bool
If true, this node can be used as a host for Windows servers.
Zone This property is required. string
The zone the host is in, e.g. de-fra1. You can list available zones with upctl zone list.
Statistics []GetHostsHostStatistic
description This property is required. String
Free form text describing the host
hostId This property is required. Integer
The unique id of the host
windowsEnabled This property is required. Boolean
If true, this node can be used as a host for Windows servers.
zone This property is required. String
The zone the host is in, e.g. de-fra1. You can list available zones with upctl zone list.
statistics List<GetHostsHostStatistic>
description This property is required. string
Free form text describing the host
hostId This property is required. number
The unique id of the host
windowsEnabled This property is required. boolean
If true, this node can be used as a host for Windows servers.
zone This property is required. string
The zone the host is in, e.g. de-fra1. You can list available zones with upctl zone list.
statistics GetHostsHostStatistic[]
description This property is required. str
Free form text describing the host
host_id This property is required. int
The unique id of the host
windows_enabled This property is required. bool
If true, this node can be used as a host for Windows servers.
zone This property is required. str
The zone the host is in, e.g. de-fra1. You can list available zones with upctl zone list.
statistics Sequence[GetHostsHostStatistic]
description This property is required. String
Free form text describing the host
hostId This property is required. Number
The unique id of the host
windowsEnabled This property is required. Boolean
If true, this node can be used as a host for Windows servers.
zone This property is required. String
The zone the host is in, e.g. de-fra1. You can list available zones with upctl zone list.
statistics List<Property Map>

GetHostsHostStatistic

Name This property is required. string
The name of the statistic
Timestamp This property is required. string
The timestamp of the statistic
Value This property is required. double
The value of the statistic
Name This property is required. string
The name of the statistic
Timestamp This property is required. string
The timestamp of the statistic
Value This property is required. float64
The value of the statistic
name This property is required. String
The name of the statistic
timestamp This property is required. String
The timestamp of the statistic
value This property is required. Double
The value of the statistic
name This property is required. string
The name of the statistic
timestamp This property is required. string
The timestamp of the statistic
value This property is required. number
The value of the statistic
name This property is required. str
The name of the statistic
timestamp This property is required. str
The timestamp of the statistic
value This property is required. float
The value of the statistic
name This property is required. String
The name of the statistic
timestamp This property is required. String
The timestamp of the statistic
value This property is required. Number
The value of the statistic

Package Details

Repository
upcloud UpCloudLtd/pulumi-upcloud
License
Apache-2.0
Notes
This Pulumi package is based on the upcloud Terraform Provider.
UpCloud v0.1.0 published on Friday, Mar 14, 2025 by UpCloudLtd