Equinix Metal v3.2.1, Dec 30 21
Equinix Metal v3.2.1, Dec 30 21
equinix-metal.getPort
Explore with Pulumi AI
Use this data source to read ports of existing devices. You can read port by either its UUID, or by a device UUID and port name.
Example Usage
Create a device and read it's eth0 port to the datasource.
using Pulumi;
using EquinixMetal = Pulumi.EquinixMetal;
class MyStack : Stack
{
public MyStack()
{
var projectId = "<UUID_of_your_project>";
var testDevice = new EquinixMetal.Device("testDevice", new EquinixMetal.DeviceArgs
{
Hostname = "tfacc-test-device-port",
Plan = "c3.medium.x86",
Facilities =
{
"sv15",
},
OperatingSystem = "ubuntu_20_04",
BillingCycle = "hourly",
ProjectId = projectId,
});
var testPort = testDevice.Id.Apply(id => EquinixMetal.GetPort.InvokeAsync(new EquinixMetal.GetPortArgs
{
DeviceId = id,
Name = "eth0",
}));
}
}
package main
import (
"github.com/pulumi/pulumi-equinix-metal/sdk/v3/go/equinix-metal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
projectId := "<UUID_of_your_project>"
testDevice, err := equinix - metal.NewDevice(ctx, "testDevice", &equinix-metal.DeviceArgs{
Hostname: pulumi.String("tfacc-test-device-port"),
Plan: pulumi.String("c3.medium.x86"),
Facilities: pulumi.StringArray{
pulumi.String("sv15"),
},
OperatingSystem: pulumi.String("ubuntu_20_04"),
BillingCycle: pulumi.String("hourly"),
ProjectId: pulumi.String(projectId),
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_equinix_metal as equinix_metal
project_id = "<UUID_of_your_project>"
test_device = equinix_metal.Device("testDevice",
hostname="tfacc-test-device-port",
plan="c3.medium.x86",
facilities=["sv15"],
operating_system="ubuntu_20_04",
billing_cycle="hourly",
project_id=project_id)
test_port = test_device.id.apply(lambda id: equinix_metal.get_port(device_id=id,
name="eth0"))
import * as pulumi from "@pulumi/pulumi";
import * as equinix_metal from "@pulumi/equinix-metal";
const projectId = "<UUID_of_your_project>";
const testDevice = new equinix_metal.Device("testDevice", {
hostname: "tfacc-test-device-port",
plan: "c3.medium.x86",
facilities: ["sv15"],
operatingSystem: "ubuntu_20_04",
billingCycle: "hourly",
projectId: projectId,
});
const testPort = testDevice.id.apply(id => equinix_metal.getPort({
deviceId: id,
name: "eth0",
}));
Coming soon!
Using getPort
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 getPort(args: GetPortArgs, opts?: InvokeOptions): Promise<GetPortResult>
function getPortOutput(args: GetPortOutputArgs, opts?: InvokeOptions): Output<GetPortResult>
def get_port(device_id: Optional[str] = None,
name: Optional[str] = None,
port_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetPortResult
def get_port_output(device_id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
port_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetPortResult]
func LookupPort(ctx *Context, args *LookupPortArgs, opts ...InvokeOption) (*LookupPortResult, error)
func LookupPortOutput(ctx *Context, args *LookupPortOutputArgs, opts ...InvokeOption) LookupPortResultOutput
> Note: This function is named LookupPort
in the Go SDK.
public static class GetPort
{
public static Task<GetPortResult> InvokeAsync(GetPortArgs args, InvokeOptions? opts = null)
public static Output<GetPortResult> Invoke(GetPortInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetPortResult> getPort(GetPortArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: equinix-metal:index/getPort:getPort
arguments:
# arguments dictionary
The following arguments are supported:
getPort Result
The following output properties are available:
- Bond
Id string UUID of the bond port"
- Bond
Name string Name of the bond port
- Bonded bool
Flag indicating whether the port is bonded
- Disbond
Supported bool Flag indicating whether the port can be removed from a bond
- Id string
The provider-assigned unique ID for this managed resource.
- Layer2 bool
- Mac string
MAC address of the port
- Name string
- Native
Vlan stringId UUID of native VLAN of the port
- Network
Type string One of layer2-bonded, layer2-individual, layer3, hybrid, hybrid-bonded
- Type string
Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports
- Vlan
Ids List<string> UUIDs of attached VLANs
- Vxlan
Ids List<int> VXLAN ids of attached VLANs
- Device
Id string - Port
Id string
- Bond
Id string UUID of the bond port"
- Bond
Name string Name of the bond port
- Bonded bool
Flag indicating whether the port is bonded
- Disbond
Supported bool Flag indicating whether the port can be removed from a bond
- Id string
The provider-assigned unique ID for this managed resource.
- Layer2 bool
- Mac string
MAC address of the port
- Name string
- Native
Vlan stringId UUID of native VLAN of the port
- Network
Type string One of layer2-bonded, layer2-individual, layer3, hybrid, hybrid-bonded
- Type string
Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports
- Vlan
Ids []string UUIDs of attached VLANs
- Vxlan
Ids []int VXLAN ids of attached VLANs
- Device
Id string - Port
Id string
- bond
Id String UUID of the bond port"
- bond
Name String Name of the bond port
- bonded Boolean
Flag indicating whether the port is bonded
- disbond
Supported Boolean Flag indicating whether the port can be removed from a bond
- id String
The provider-assigned unique ID for this managed resource.
- layer2 Boolean
- mac String
MAC address of the port
- name String
- native
Vlan StringId UUID of native VLAN of the port
- network
Type String One of layer2-bonded, layer2-individual, layer3, hybrid, hybrid-bonded
- type String
Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports
- vlan
Ids List<String> UUIDs of attached VLANs
- vxlan
Ids List<Integer> VXLAN ids of attached VLANs
- device
Id String - port
Id String
- bond
Id string UUID of the bond port"
- bond
Name string Name of the bond port
- bonded boolean
Flag indicating whether the port is bonded
- disbond
Supported boolean Flag indicating whether the port can be removed from a bond
- id string
The provider-assigned unique ID for this managed resource.
- layer2 boolean
- mac string
MAC address of the port
- name string
- native
Vlan stringId UUID of native VLAN of the port
- network
Type string One of layer2-bonded, layer2-individual, layer3, hybrid, hybrid-bonded
- type string
Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports
- vlan
Ids string[] UUIDs of attached VLANs
- vxlan
Ids number[] VXLAN ids of attached VLANs
- device
Id string - port
Id string
- bond_
id str UUID of the bond port"
- bond_
name str Name of the bond port
- bonded bool
Flag indicating whether the port is bonded
- disbond_
supported bool Flag indicating whether the port can be removed from a bond
- id str
The provider-assigned unique ID for this managed resource.
- layer2 bool
- mac str
MAC address of the port
- name str
- native_
vlan_ strid UUID of native VLAN of the port
- network_
type str One of layer2-bonded, layer2-individual, layer3, hybrid, hybrid-bonded
- type str
Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports
- vlan_
ids Sequence[str] UUIDs of attached VLANs
- vxlan_
ids Sequence[int] VXLAN ids of attached VLANs
- device_
id str - port_
id str
- bond
Id String UUID of the bond port"
- bond
Name String Name of the bond port
- bonded Boolean
Flag indicating whether the port is bonded
- disbond
Supported Boolean Flag indicating whether the port can be removed from a bond
- id String
The provider-assigned unique ID for this managed resource.
- layer2 Boolean
- mac String
MAC address of the port
- name String
- native
Vlan StringId UUID of native VLAN of the port
- network
Type String One of layer2-bonded, layer2-individual, layer3, hybrid, hybrid-bonded
- type String
Type is either "NetworkBondPort" for bond ports or "NetworkPort" for bondable ethernet ports
- vlan
Ids List<String> UUIDs of attached VLANs
- vxlan
Ids List<Number> VXLAN ids of attached VLANs
- device
Id String - port
Id String
Package Details
- Repository
- Equinix Metal pulumi/pulumi-equinix-metal
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
metal
Terraform Provider.