1. Packages
  2. Openwrt Provider
  3. API Docs
  4. getNetworkInterface
openwrt 0.0.20 published on Friday, Mar 7, 2025 by joneshf

openwrt.getNetworkInterface

Explore with Pulumi AI

A logic network.

Example Usage

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

const brTesting = openwrt.getNetworkInterface({
    id: "testing",
});
Copy
import pulumi
import pulumi_openwrt as openwrt

br_testing = openwrt.get_network_interface(id="testing")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/openwrt/openwrt"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := openwrt.LookupNetworkInterface(ctx, &openwrt.LookupNetworkInterfaceArgs{
			Id: "testing",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Openwrt = Pulumi.Openwrt;

return await Deployment.RunAsync(() => 
{
    var brTesting = Openwrt.GetNetworkInterface.Invoke(new()
    {
        Id = "testing",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.openwrt.OpenwrtFunctions;
import com.pulumi.openwrt.inputs.GetNetworkInterfaceArgs;
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 brTesting = OpenwrtFunctions.getNetworkInterface(GetNetworkInterfaceArgs.builder()
            .id("testing")
            .build());

    }
}
Copy
variables:
  brTesting:
    fn::invoke:
      function: openwrt:getNetworkInterface
      arguments:
        id: testing
Copy

Using getNetworkInterface

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 getNetworkInterface(args: GetNetworkInterfaceArgs, opts?: InvokeOptions): Promise<GetNetworkInterfaceResult>
function getNetworkInterfaceOutput(args: GetNetworkInterfaceOutputArgs, opts?: InvokeOptions): Output<GetNetworkInterfaceResult>
Copy
def get_network_interface(id: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetNetworkInterfaceResult
def get_network_interface_output(id: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetNetworkInterfaceResult]
Copy
func LookupNetworkInterface(ctx *Context, args *LookupNetworkInterfaceArgs, opts ...InvokeOption) (*LookupNetworkInterfaceResult, error)
func LookupNetworkInterfaceOutput(ctx *Context, args *LookupNetworkInterfaceOutputArgs, opts ...InvokeOption) LookupNetworkInterfaceResultOutput
Copy

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

public static class GetNetworkInterface 
{
    public static Task<GetNetworkInterfaceResult> InvokeAsync(GetNetworkInterfaceArgs args, InvokeOptions? opts = null)
    public static Output<GetNetworkInterfaceResult> Invoke(GetNetworkInterfaceInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetNetworkInterfaceResult> getNetworkInterface(GetNetworkInterfaceArgs args, InvokeOptions options)
public static Output<GetNetworkInterfaceResult> getNetworkInterface(GetNetworkInterfaceArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: openwrt:index/getNetworkInterface:getNetworkInterface
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Id This property is required. string
Name of the section. This name is only used when interacting with UCI directly.
Id This property is required. string
Name of the section. This name is only used when interacting with UCI directly.
id This property is required. String
Name of the section. This name is only used when interacting with UCI directly.
id This property is required. string
Name of the section. This name is only used when interacting with UCI directly.
id This property is required. str
Name of the section. This name is only used when interacting with UCI directly.
id This property is required. String
Name of the section. This name is only used when interacting with UCI directly.

getNetworkInterface Result

The following output properties are available:

Auto bool
Specifies whether to bring up this interface on boot.
Device string
Disabled bool
Disables this interface.
Dns List<string>
DNS servers
Gateway string
Gateway of the interface
Id string
Name of the section. This name is only used when interacting with UCI directly.
Ip6assign double
Delegate a prefix of given length to this interface
Ipaddr string
IP address of the interface
Macaddr string
Override the MAC Address of this interface.
Mtu double
Override the default MTU on this interface.
Netmask string
Netmask of the interface
Peerdns bool
Use DHCP-provided DNS servers.
Proto string
The protocol type of the interface. Currently, only "dhcp, and "static" are supported.
Reqaddress string
Behavior for requesting address. Can only be one of "force", "try", or "none".
Reqprefix string
Behavior for requesting prefixes. Currently, only "auto" is supported.
Auto bool
Specifies whether to bring up this interface on boot.
Device string
Disabled bool
Disables this interface.
Dns []string
DNS servers
Gateway string
Gateway of the interface
Id string
Name of the section. This name is only used when interacting with UCI directly.
Ip6assign float64
Delegate a prefix of given length to this interface
Ipaddr string
IP address of the interface
Macaddr string
Override the MAC Address of this interface.
Mtu float64
Override the default MTU on this interface.
Netmask string
Netmask of the interface
Peerdns bool
Use DHCP-provided DNS servers.
Proto string
The protocol type of the interface. Currently, only "dhcp, and "static" are supported.
Reqaddress string
Behavior for requesting address. Can only be one of "force", "try", or "none".
Reqprefix string
Behavior for requesting prefixes. Currently, only "auto" is supported.
auto Boolean
Specifies whether to bring up this interface on boot.
device String
disabled Boolean
Disables this interface.
dns List<String>
DNS servers
gateway String
Gateway of the interface
id String
Name of the section. This name is only used when interacting with UCI directly.
ip6assign Double
Delegate a prefix of given length to this interface
ipaddr String
IP address of the interface
macaddr String
Override the MAC Address of this interface.
mtu Double
Override the default MTU on this interface.
netmask String
Netmask of the interface
peerdns Boolean
Use DHCP-provided DNS servers.
proto String
The protocol type of the interface. Currently, only "dhcp, and "static" are supported.
reqaddress String
Behavior for requesting address. Can only be one of "force", "try", or "none".
reqprefix String
Behavior for requesting prefixes. Currently, only "auto" is supported.
auto boolean
Specifies whether to bring up this interface on boot.
device string
disabled boolean
Disables this interface.
dns string[]
DNS servers
gateway string
Gateway of the interface
id string
Name of the section. This name is only used when interacting with UCI directly.
ip6assign number
Delegate a prefix of given length to this interface
ipaddr string
IP address of the interface
macaddr string
Override the MAC Address of this interface.
mtu number
Override the default MTU on this interface.
netmask string
Netmask of the interface
peerdns boolean
Use DHCP-provided DNS servers.
proto string
The protocol type of the interface. Currently, only "dhcp, and "static" are supported.
reqaddress string
Behavior for requesting address. Can only be one of "force", "try", or "none".
reqprefix string
Behavior for requesting prefixes. Currently, only "auto" is supported.
auto bool
Specifies whether to bring up this interface on boot.
device str
disabled bool
Disables this interface.
dns Sequence[str]
DNS servers
gateway str
Gateway of the interface
id str
Name of the section. This name is only used when interacting with UCI directly.
ip6assign float
Delegate a prefix of given length to this interface
ipaddr str
IP address of the interface
macaddr str
Override the MAC Address of this interface.
mtu float
Override the default MTU on this interface.
netmask str
Netmask of the interface
peerdns bool
Use DHCP-provided DNS servers.
proto str
The protocol type of the interface. Currently, only "dhcp, and "static" are supported.
reqaddress str
Behavior for requesting address. Can only be one of "force", "try", or "none".
reqprefix str
Behavior for requesting prefixes. Currently, only "auto" is supported.
auto Boolean
Specifies whether to bring up this interface on boot.
device String
disabled Boolean
Disables this interface.
dns List<String>
DNS servers
gateway String
Gateway of the interface
id String
Name of the section. This name is only used when interacting with UCI directly.
ip6assign Number
Delegate a prefix of given length to this interface
ipaddr String
IP address of the interface
macaddr String
Override the MAC Address of this interface.
mtu Number
Override the default MTU on this interface.
netmask String
Netmask of the interface
peerdns Boolean
Use DHCP-provided DNS servers.
proto String
The protocol type of the interface. Currently, only "dhcp, and "static" are supported.
reqaddress String
Behavior for requesting address. Can only be one of "force", "try", or "none".
reqprefix String
Behavior for requesting prefixes. Currently, only "auto" is supported.

Package Details

Repository
openwrt joneshf/terraform-provider-openwrt
License
Notes
This Pulumi package is based on the openwrt Terraform Provider.