Hetzner Cloud

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

getNetworks

Provides details about multiple Hetzner Cloud Networks.

Example Usage

using Pulumi;
using HCloud = Pulumi.HCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var network2 = Output.Create(HCloud.GetNetwork.InvokeAsync());
        var network3 = Output.Create(HCloud.GetNetwork.InvokeAsync(new HCloud.GetNetworkArgs
        {
            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.LookupNetwork(ctx, nil, nil)
		if err != nil {
			return err
		}
		_, err = hcloud.LookupNetwork(ctx, &GetNetworkArgs{
			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 network2 = Output.of(HcloudFunctions.getNetwork());

        final var network3 = Output.of(HcloudFunctions.getNetwork(GetNetworkArgs.builder()
            .withSelector("key=value")
            .build()));

    }
}
import pulumi
import pulumi_hcloud as hcloud

network2 = hcloud.get_network()
network3 = hcloud.get_network(with_selector="key=value")
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";

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

Using getNetworks

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 getNetworks(args: GetNetworksArgs, opts?: InvokeOptions): Promise<GetNetworksResult>
function getNetworksOutput(args: GetNetworksOutputArgs, opts?: InvokeOptions): Output<GetNetworksResult>
def get_networks(with_selector: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetNetworksResult
def get_networks_output(with_selector: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetNetworksResult]
func GetNetworks(ctx *Context, args *GetNetworksArgs, opts ...InvokeOption) (*GetNetworksResult, error)
func GetNetworksOutput(ctx *Context, args *GetNetworksOutputArgs, opts ...InvokeOption) GetNetworksResultOutput

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

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

The following arguments are supported:

getNetworks Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Networks List<Pulumi.HCloud.Outputs.GetNetworksNetwork>

(list) List of all matching networks. See data.hcloud_network for schema.

WithSelector string
Id string

The provider-assigned unique ID for this managed resource.

Networks []GetNetworksNetwork

(list) List of all matching networks. See data.hcloud_network for schema.

WithSelector string
id String

The provider-assigned unique ID for this managed resource.

networks List<GetNetworksNetwork>

(list) List of all matching networks. See data.hcloud_network for schema.

withSelector String
id string

The provider-assigned unique ID for this managed resource.

networks GetNetworksNetwork[]

(list) List of all matching networks. See data.hcloud_network for schema.

withSelector string
id str

The provider-assigned unique ID for this managed resource.

networks Sequence[GetNetworksNetwork]

(list) List of all matching networks. See data.hcloud_network for schema.

with_selector str
id String

The provider-assigned unique ID for this managed resource.

networks List<Property Map>

(list) List of all matching networks. See data.hcloud_network for schema.

withSelector String

Supporting Types

GetNetworksNetwork

DeleteProtection bool
Id int
IpRange string
Labels Dictionary<string, object>
Name string
DeleteProtection bool
Id int
IpRange string
Labels map[string]interface{}
Name string
deleteProtection Boolean
id Integer
ipRange String
labels Map<String,Object>
name String
deleteProtection boolean
id number
ipRange string
labels {[key: string]: any}
name string
delete_protection bool
id int
ip_range str
labels Mapping[str, Any]
name str
deleteProtection Boolean
id Number
ipRange String
labels Map<Any>
name 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.