1. Packages
  2. Hcloud Provider
  3. API Docs
  4. getNetworks
Hetzner Cloud v1.21.0 published on Tuesday, Nov 12, 2024 by Pulumi

hcloud.getNetworks

Explore with Pulumi AI

hcloud logo
Hetzner Cloud v1.21.0 published on Tuesday, Nov 12, 2024 by Pulumi

    Provides details about multiple Hetzner Cloud Networks.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as hcloud from "@pulumi/hcloud";
    
    const network2 = hcloud.getNetwork({});
    const network3 = hcloud.getNetwork({
        withSelector: "key=value",
    });
    
    import pulumi
    import pulumi_hcloud as hcloud
    
    network2 = hcloud.get_network()
    network3 = hcloud.get_network(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.LookupNetwork(ctx, &hcloud.LookupNetworkArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = hcloud.LookupNetwork(ctx, &hcloud.LookupNetworkArgs{
    			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 network2 = HCloud.GetNetwork.Invoke();
    
        var network3 = HCloud.GetNetwork.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.GetNetworkArgs;
    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 network2 = HcloudFunctions.getNetwork();
    
            final var network3 = HcloudFunctions.getNetwork(GetNetworkArgs.builder()
                .withSelector("key=value")
                .build());
    
        }
    }
    
    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
    ExposeRoutesToVswitch bool
    Indicates if the routes from this network should be exposed to the vSwitch connection. The exposing only takes effect if a vSwitch connection is active.
    Id int
    IpRange string
    Labels Dictionary<string, string>
    Name string
    DeleteProtection bool
    ExposeRoutesToVswitch bool
    Indicates if the routes from this network should be exposed to the vSwitch connection. The exposing only takes effect if a vSwitch connection is active.
    Id int
    IpRange string
    Labels map[string]string
    Name string
    deleteProtection Boolean
    exposeRoutesToVswitch Boolean
    Indicates if the routes from this network should be exposed to the vSwitch connection. The exposing only takes effect if a vSwitch connection is active.
    id Integer
    ipRange String
    labels Map<String,String>
    name String
    deleteProtection boolean
    exposeRoutesToVswitch boolean
    Indicates if the routes from this network should be exposed to the vSwitch connection. The exposing only takes effect if a vSwitch connection is active.
    id number
    ipRange string
    labels {[key: string]: string}
    name string
    delete_protection bool
    expose_routes_to_vswitch bool
    Indicates if the routes from this network should be exposed to the vSwitch connection. The exposing only takes effect if a vSwitch connection is active.
    id int
    ip_range str
    labels Mapping[str, str]
    name str
    deleteProtection Boolean
    exposeRoutesToVswitch Boolean
    Indicates if the routes from this network should be exposed to the vSwitch connection. The exposing only takes effect if a vSwitch connection is active.
    id Number
    ipRange String
    labels Map<String>
    name String

    Package Details

    Repository
    Hetzner Cloud pulumi/pulumi-hcloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the hcloud Terraform Provider.
    hcloud logo
    Hetzner Cloud v1.21.0 published on Tuesday, Nov 12, 2024 by Pulumi