1. Packages
  2. Docker
  3. API Docs
  4. getNetwork
Docker v4.4.1 published on Tuesday, Sep 12, 2023 by Pulumi

docker.getNetwork

Explore with Pulumi AI

docker logo
Docker v4.4.1 published on Tuesday, Sep 12, 2023 by Pulumi

    docker.Network provides details about a specific Docker Network.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Docker = Pulumi.Docker;
    
    return await Deployment.RunAsync(() => 
    {
        var main = Docker.GetNetwork.Invoke(new()
        {
            Name = "main",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-docker/sdk/v4/go/docker"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := docker.LookupNetwork(ctx, &docker.LookupNetworkArgs{
    			Name: "main",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.docker.DockerFunctions;
    import com.pulumi.docker.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 main = DockerFunctions.getNetwork(GetNetworkArgs.builder()
                .name("main")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_docker as docker
    
    main = docker.get_network(name="main")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as docker from "@pulumi/docker";
    
    const main = docker.getNetwork({
        name: "main",
    });
    
    variables:
      main:
        fn::invoke:
          Function: docker:getNetwork
          Arguments:
            name: main
    

    Using getNetwork

    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 getNetwork(args: GetNetworkArgs, opts?: InvokeOptions): Promise<GetNetworkResult>
    function getNetworkOutput(args: GetNetworkOutputArgs, opts?: InvokeOptions): Output<GetNetworkResult>
    def get_network(name: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetNetworkResult
    def get_network_output(name: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetNetworkResult]
    func LookupNetwork(ctx *Context, args *LookupNetworkArgs, opts ...InvokeOption) (*LookupNetworkResult, error)
    func LookupNetworkOutput(ctx *Context, args *LookupNetworkOutputArgs, opts ...InvokeOption) LookupNetworkResultOutput

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

    public static class GetNetwork 
    {
        public static Task<GetNetworkResult> InvokeAsync(GetNetworkArgs args, InvokeOptions? opts = null)
        public static Output<GetNetworkResult> Invoke(GetNetworkInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNetworkResult> getNetwork(GetNetworkArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: docker:index/getNetwork:getNetwork
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string

    The name of the Docker network.

    Name string

    The name of the Docker network.

    name String

    The name of the Docker network.

    name string

    The name of the Docker network.

    name str

    The name of the Docker network.

    name String

    The name of the Docker network.

    getNetwork Result

    The following output properties are available:

    Driver string

    The driver of the Docker network. Possible values are bridge, host, overlay, macvlan. See network docs for more details.

    Id string

    The ID of this resource.

    Internal bool

    If true, the network is internal.

    IpamConfigs List<GetNetworkIpamConfig>

    The IPAM configuration options

    Name string

    The name of the Docker network.

    Options Dictionary<string, object>

    Only available with bridge networks. See bridge options docs for more details.

    Scope string

    Scope of the network. One of swarm, global, or local.

    Driver string

    The driver of the Docker network. Possible values are bridge, host, overlay, macvlan. See network docs for more details.

    Id string

    The ID of this resource.

    Internal bool

    If true, the network is internal.

    IpamConfigs []GetNetworkIpamConfig

    The IPAM configuration options

    Name string

    The name of the Docker network.

    Options map[string]interface{}

    Only available with bridge networks. See bridge options docs for more details.

    Scope string

    Scope of the network. One of swarm, global, or local.

    driver String

    The driver of the Docker network. Possible values are bridge, host, overlay, macvlan. See network docs for more details.

    id String

    The ID of this resource.

    internal Boolean

    If true, the network is internal.

    ipamConfigs List<GetNetworkIpamConfig>

    The IPAM configuration options

    name String

    The name of the Docker network.

    options Map<String,Object>

    Only available with bridge networks. See bridge options docs for more details.

    scope String

    Scope of the network. One of swarm, global, or local.

    driver string

    The driver of the Docker network. Possible values are bridge, host, overlay, macvlan. See network docs for more details.

    id string

    The ID of this resource.

    internal boolean

    If true, the network is internal.

    ipamConfigs GetNetworkIpamConfig[]

    The IPAM configuration options

    name string

    The name of the Docker network.

    options {[key: string]: any}

    Only available with bridge networks. See bridge options docs for more details.

    scope string

    Scope of the network. One of swarm, global, or local.

    driver str

    The driver of the Docker network. Possible values are bridge, host, overlay, macvlan. See network docs for more details.

    id str

    The ID of this resource.

    internal bool

    If true, the network is internal.

    ipam_configs Sequence[GetNetworkIpamConfig]

    The IPAM configuration options

    name str

    The name of the Docker network.

    options Mapping[str, Any]

    Only available with bridge networks. See bridge options docs for more details.

    scope str

    Scope of the network. One of swarm, global, or local.

    driver String

    The driver of the Docker network. Possible values are bridge, host, overlay, macvlan. See network docs for more details.

    id String

    The ID of this resource.

    internal Boolean

    If true, the network is internal.

    ipamConfigs List<Property Map>

    The IPAM configuration options

    name String

    The name of the Docker network.

    options Map<Any>

    Only available with bridge networks. See bridge options docs for more details.

    scope String

    Scope of the network. One of swarm, global, or local.

    Supporting Types

    GetNetworkIpamConfig

    AuxAddress Dictionary<string, object>
    Gateway string
    IpRange string
    Subnet string
    AuxAddress map[string]interface{}
    Gateway string
    IpRange string
    Subnet string
    auxAddress Map<String,Object>
    gateway String
    ipRange String
    subnet String
    auxAddress {[key: string]: any}
    gateway string
    ipRange string
    subnet string
    aux_address Mapping[str, Any]
    gateway str
    ip_range str
    subnet str
    auxAddress Map<Any>
    gateway String
    ipRange String
    subnet String

    Package Details

    Repository
    Docker pulumi/pulumi-docker
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the docker Terraform Provider.

    docker logo
    Docker v4.4.1 published on Tuesday, Sep 12, 2023 by Pulumi