1. Packages
  2. Equinix Metal (Deprecated)
  3. API Docs
  4. getDevice

This package is deprecated. We recommend using the new Equinix package.

Equinix Metal v3.2.1 published on Thursday, Dec 30, 2021 by DEPRECATED

equinix-metal.getDevice

Explore with Pulumi AI

equinix-metal logo

This package is deprecated. We recommend using the new Equinix package.

Equinix Metal v3.2.1 published on Thursday, Dec 30, 2021 by DEPRECATED

    Provides an Equinix Metal device datasource.

    Note: All arguments including the root_password and user_data will be stored in the raw state as plain-text. Read more about sensitive data in state.

    Example Usage

    using Pulumi;
    using EquinixMetal = Pulumi.EquinixMetal;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var test = Output.Create(EquinixMetal.GetDevice.InvokeAsync(new EquinixMetal.GetDeviceArgs
            {
                ProjectId = local.Project_id,
                Hostname = "mydevice",
            }));
            this.Id = test.Apply(test => test.Id);
        }
    
        [Output("id")]
        public Output<string> Id { get; set; }
    }
    
    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 {
    		opt0 := local.Project_id
    		opt1 := "mydevice"
    		test, err := equinix - metal.LookupDevice(ctx, &GetDeviceArgs{
    			ProjectId: &opt0,
    			Hostname:  &opt1,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("id", test.Id)
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_equinix_metal as equinix_metal
    
    test = equinix_metal.get_device(project_id=local["project_id"],
        hostname="mydevice")
    pulumi.export("id", test.id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as equinix_metal from "@pulumi/equinix-metal";
    
    const test = equinix_metal.getDevice({
        projectId: local.project_id,
        hostname: "mydevice",
    });
    export const id = test.then(test => test.id);
    

    Coming soon!

    using Pulumi;
    using EquinixMetal = Pulumi.EquinixMetal;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var test = Output.Create(EquinixMetal.GetDevice.InvokeAsync());
            this.Ipv4 = test.Apply(test => test.AccessPublicIpv4);
        }
    
        [Output("ipv4")]
        public Output<string> Ipv4 { get; set; }
    }
    
    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 {
    		test, err := equinix - metal.LookupDevice(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("ipv4", test.AccessPublicIpv4)
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_equinix_metal as equinix_metal
    
    test = equinix_metal.get_device()
    pulumi.export("ipv4", test.access_public_ipv4)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as equinix_metal from "@pulumi/equinix-metal";
    
    const test = equinix_metal.getDevice({});
    export const ipv4 = test.then(test => test.accessPublicIpv4);
    

    Coming soon!

    Using getDevice

    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 getDevice(args: GetDeviceArgs, opts?: InvokeOptions): Promise<GetDeviceResult>
    function getDeviceOutput(args: GetDeviceOutputArgs, opts?: InvokeOptions): Output<GetDeviceResult>
    def get_device(device_id: Optional[str] = None,
                   hostname: Optional[str] = None,
                   project_id: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetDeviceResult
    def get_device_output(device_id: Optional[pulumi.Input[str]] = None,
                   hostname: Optional[pulumi.Input[str]] = None,
                   project_id: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetDeviceResult]
    func LookupDevice(ctx *Context, args *LookupDeviceArgs, opts ...InvokeOption) (*LookupDeviceResult, error)
    func LookupDeviceOutput(ctx *Context, args *LookupDeviceOutputArgs, opts ...InvokeOption) LookupDeviceResultOutput

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

    public static class GetDevice 
    {
        public static Task<GetDeviceResult> InvokeAsync(GetDeviceArgs args, InvokeOptions? opts = null)
        public static Output<GetDeviceResult> Invoke(GetDeviceInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDeviceResult> getDevice(GetDeviceArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: equinix-metal:index/getDevice:getDevice
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DeviceId string
    Device ID
    Hostname string
    The device name
    ProjectId string
    The id of the project in which the devices exists
    DeviceId string
    Device ID
    Hostname string
    The device name
    ProjectId string
    The id of the project in which the devices exists
    deviceId String
    Device ID
    hostname String
    The device name
    projectId String
    The id of the project in which the devices exists
    deviceId string
    Device ID
    hostname string
    The device name
    projectId string
    The id of the project in which the devices exists
    device_id str
    Device ID
    hostname str
    The device name
    project_id str
    The id of the project in which the devices exists
    deviceId String
    Device ID
    hostname String
    The device name
    projectId String
    The id of the project in which the devices exists

    getDevice Result

    The following output properties are available:

    AccessPrivateIpv4 string
    The ipv4 private IP assigned to the device
    AccessPublicIpv4 string
    The ipv4 management IP assigned to the device
    AccessPublicIpv6 string
    The ipv6 management IP assigned to the device
    AlwaysPxe bool
    BillingCycle string
    The billing cycle of the device (monthly or hourly)
    Description string
    Description string for the device
    DeviceId string
    Facility string
    The facility where the device is deployed.
    HardwareReservationId string
    The id of hardware reservation which this device occupies
    Hostname string
    Id string
    The provider-assigned unique ID for this managed resource.
    IpxeScriptUrl string
    Metro string
    The metro where the device is deployed
    NetworkType string
    L2 network type of the device, one of "layer3", "layer2-bonded", "layer2-individual", "hybrid"
    Networks List<Pulumi.EquinixMetal.Outputs.GetDeviceNetwork>
    The device's private and public IP (v4 and v6) network details. When a device is run without any special network configuration, it will have 3 networks:

    • Public IPv4 at metal_device.name.network.0
    • IPv6 at metal_device.name.network.1
    • Private IPv4 at metal_device.name.network.2 Elastic addresses then stack by type - an assigned public IPv4 will go after the management public IPv4 (to index 1), and will then shift the indices of the IPv6 and private IPv4. Assigned private IPv4 will go after the management private IPv4 (to the end of the network list). The fields of the network attributes are:
    OperatingSystem string
    The operating system running on the device
    Plan string
    The hardware config of the device
    Ports List<Pulumi.EquinixMetal.Outputs.GetDevicePort>
    Ports assigned to the device
    ProjectId string
    RootPassword string
    Root password to the server (if still available)
    SshKeyIds List<string>
    List of IDs of SSH keys deployed in the device, can be both user or project SSH keys
    State string
    The state of the device
    Storage string
    Tags List<string>
    Tags attached to the device
    AccessPrivateIpv4 string
    The ipv4 private IP assigned to the device
    AccessPublicIpv4 string
    The ipv4 management IP assigned to the device
    AccessPublicIpv6 string
    The ipv6 management IP assigned to the device
    AlwaysPxe bool
    BillingCycle string
    The billing cycle of the device (monthly or hourly)
    Description string
    Description string for the device
    DeviceId string
    Facility string
    The facility where the device is deployed.
    HardwareReservationId string
    The id of hardware reservation which this device occupies
    Hostname string
    Id string
    The provider-assigned unique ID for this managed resource.
    IpxeScriptUrl string
    Metro string
    The metro where the device is deployed
    NetworkType string
    L2 network type of the device, one of "layer3", "layer2-bonded", "layer2-individual", "hybrid"
    Networks []GetDeviceNetwork
    The device's private and public IP (v4 and v6) network details. When a device is run without any special network configuration, it will have 3 networks:

    • Public IPv4 at metal_device.name.network.0
    • IPv6 at metal_device.name.network.1
    • Private IPv4 at metal_device.name.network.2 Elastic addresses then stack by type - an assigned public IPv4 will go after the management public IPv4 (to index 1), and will then shift the indices of the IPv6 and private IPv4. Assigned private IPv4 will go after the management private IPv4 (to the end of the network list). The fields of the network attributes are:
    OperatingSystem string
    The operating system running on the device
    Plan string
    The hardware config of the device
    Ports []GetDevicePort
    Ports assigned to the device
    ProjectId string
    RootPassword string
    Root password to the server (if still available)
    SshKeyIds []string
    List of IDs of SSH keys deployed in the device, can be both user or project SSH keys
    State string
    The state of the device
    Storage string
    Tags []string
    Tags attached to the device
    accessPrivateIpv4 String
    The ipv4 private IP assigned to the device
    accessPublicIpv4 String
    The ipv4 management IP assigned to the device
    accessPublicIpv6 String
    The ipv6 management IP assigned to the device
    alwaysPxe Boolean
    billingCycle String
    The billing cycle of the device (monthly or hourly)
    description String
    Description string for the device
    deviceId String
    facility String
    The facility where the device is deployed.
    hardwareReservationId String
    The id of hardware reservation which this device occupies
    hostname String
    id String
    The provider-assigned unique ID for this managed resource.
    ipxeScriptUrl String
    metro String
    The metro where the device is deployed
    networkType String
    L2 network type of the device, one of "layer3", "layer2-bonded", "layer2-individual", "hybrid"
    networks List<GetDeviceNetwork>
    The device's private and public IP (v4 and v6) network details. When a device is run without any special network configuration, it will have 3 networks:

    • Public IPv4 at metal_device.name.network.0
    • IPv6 at metal_device.name.network.1
    • Private IPv4 at metal_device.name.network.2 Elastic addresses then stack by type - an assigned public IPv4 will go after the management public IPv4 (to index 1), and will then shift the indices of the IPv6 and private IPv4. Assigned private IPv4 will go after the management private IPv4 (to the end of the network list). The fields of the network attributes are:
    operatingSystem String
    The operating system running on the device
    plan String
    The hardware config of the device
    ports List<GetDevicePort>
    Ports assigned to the device
    projectId String
    rootPassword String
    Root password to the server (if still available)
    sshKeyIds List<String>
    List of IDs of SSH keys deployed in the device, can be both user or project SSH keys
    state String
    The state of the device
    storage String
    tags List<String>
    Tags attached to the device
    accessPrivateIpv4 string
    The ipv4 private IP assigned to the device
    accessPublicIpv4 string
    The ipv4 management IP assigned to the device
    accessPublicIpv6 string
    The ipv6 management IP assigned to the device
    alwaysPxe boolean
    billingCycle string
    The billing cycle of the device (monthly or hourly)
    description string
    Description string for the device
    deviceId string
    facility string
    The facility where the device is deployed.
    hardwareReservationId string
    The id of hardware reservation which this device occupies
    hostname string
    id string
    The provider-assigned unique ID for this managed resource.
    ipxeScriptUrl string
    metro string
    The metro where the device is deployed
    networkType string
    L2 network type of the device, one of "layer3", "layer2-bonded", "layer2-individual", "hybrid"
    networks GetDeviceNetwork[]
    The device's private and public IP (v4 and v6) network details. When a device is run without any special network configuration, it will have 3 networks:

    • Public IPv4 at metal_device.name.network.0
    • IPv6 at metal_device.name.network.1
    • Private IPv4 at metal_device.name.network.2 Elastic addresses then stack by type - an assigned public IPv4 will go after the management public IPv4 (to index 1), and will then shift the indices of the IPv6 and private IPv4. Assigned private IPv4 will go after the management private IPv4 (to the end of the network list). The fields of the network attributes are:
    operatingSystem string
    The operating system running on the device
    plan string
    The hardware config of the device
    ports GetDevicePort[]
    Ports assigned to the device
    projectId string
    rootPassword string
    Root password to the server (if still available)
    sshKeyIds string[]
    List of IDs of SSH keys deployed in the device, can be both user or project SSH keys
    state string
    The state of the device
    storage string
    tags string[]
    Tags attached to the device
    access_private_ipv4 str
    The ipv4 private IP assigned to the device
    access_public_ipv4 str
    The ipv4 management IP assigned to the device
    access_public_ipv6 str
    The ipv6 management IP assigned to the device
    always_pxe bool
    billing_cycle str
    The billing cycle of the device (monthly or hourly)
    description str
    Description string for the device
    device_id str
    facility str
    The facility where the device is deployed.
    hardware_reservation_id str
    The id of hardware reservation which this device occupies
    hostname str
    id str
    The provider-assigned unique ID for this managed resource.
    ipxe_script_url str
    metro str
    The metro where the device is deployed
    network_type str
    L2 network type of the device, one of "layer3", "layer2-bonded", "layer2-individual", "hybrid"
    networks Sequence[GetDeviceNetwork]
    The device's private and public IP (v4 and v6) network details. When a device is run without any special network configuration, it will have 3 networks:

    • Public IPv4 at metal_device.name.network.0
    • IPv6 at metal_device.name.network.1
    • Private IPv4 at metal_device.name.network.2 Elastic addresses then stack by type - an assigned public IPv4 will go after the management public IPv4 (to index 1), and will then shift the indices of the IPv6 and private IPv4. Assigned private IPv4 will go after the management private IPv4 (to the end of the network list). The fields of the network attributes are:
    operating_system str
    The operating system running on the device
    plan str
    The hardware config of the device
    ports Sequence[GetDevicePort]
    Ports assigned to the device
    project_id str
    root_password str
    Root password to the server (if still available)
    ssh_key_ids Sequence[str]
    List of IDs of SSH keys deployed in the device, can be both user or project SSH keys
    state str
    The state of the device
    storage str
    tags Sequence[str]
    Tags attached to the device
    accessPrivateIpv4 String
    The ipv4 private IP assigned to the device
    accessPublicIpv4 String
    The ipv4 management IP assigned to the device
    accessPublicIpv6 String
    The ipv6 management IP assigned to the device
    alwaysPxe Boolean
    billingCycle String
    The billing cycle of the device (monthly or hourly)
    description String
    Description string for the device
    deviceId String
    facility String
    The facility where the device is deployed.
    hardwareReservationId String
    The id of hardware reservation which this device occupies
    hostname String
    id String
    The provider-assigned unique ID for this managed resource.
    ipxeScriptUrl String
    metro String
    The metro where the device is deployed
    networkType String
    L2 network type of the device, one of "layer3", "layer2-bonded", "layer2-individual", "hybrid"
    networks List<Property Map>
    The device's private and public IP (v4 and v6) network details. When a device is run without any special network configuration, it will have 3 networks:

    • Public IPv4 at metal_device.name.network.0
    • IPv6 at metal_device.name.network.1
    • Private IPv4 at metal_device.name.network.2 Elastic addresses then stack by type - an assigned public IPv4 will go after the management public IPv4 (to index 1), and will then shift the indices of the IPv6 and private IPv4. Assigned private IPv4 will go after the management private IPv4 (to the end of the network list). The fields of the network attributes are:
    operatingSystem String
    The operating system running on the device
    plan String
    The hardware config of the device
    ports List<Property Map>
    Ports assigned to the device
    projectId String
    rootPassword String
    Root password to the server (if still available)
    sshKeyIds List<String>
    List of IDs of SSH keys deployed in the device, can be both user or project SSH keys
    state String
    The state of the device
    storage String
    tags List<String>
    Tags attached to the device

    Supporting Types

    GetDeviceNetwork

    Address string
    IPv4 or IPv6 address string
    Cidr int
    Bit length of the network mask of the address
    Family int
    IP version - "4" or "6"
    Gateway string
    Address of router
    Public bool
    Whether the address is routable from the Internet
    Address string
    IPv4 or IPv6 address string
    Cidr int
    Bit length of the network mask of the address
    Family int
    IP version - "4" or "6"
    Gateway string
    Address of router
    Public bool
    Whether the address is routable from the Internet
    address String
    IPv4 or IPv6 address string
    cidr Integer
    Bit length of the network mask of the address
    family Integer
    IP version - "4" or "6"
    gateway String
    Address of router
    public_ Boolean
    Whether the address is routable from the Internet
    address string
    IPv4 or IPv6 address string
    cidr number
    Bit length of the network mask of the address
    family number
    IP version - "4" or "6"
    gateway string
    Address of router
    public boolean
    Whether the address is routable from the Internet
    address str
    IPv4 or IPv6 address string
    cidr int
    Bit length of the network mask of the address
    family int
    IP version - "4" or "6"
    gateway str
    Address of router
    public bool
    Whether the address is routable from the Internet
    address String
    IPv4 or IPv6 address string
    cidr Number
    Bit length of the network mask of the address
    family Number
    IP version - "4" or "6"
    gateway String
    Address of router
    public Boolean
    Whether the address is routable from the Internet

    GetDevicePort

    Bonded bool
    Whether this port is part of a bond in bonded network setup
    Id string
    ID of the port
    Mac string
    MAC address assigned to the port
    Name string
    Name of the port (e.g. eth0, or bond0)
    Type string
    Type of the port (e.g. NetworkPort or NetworkBondPort)
    Bonded bool
    Whether this port is part of a bond in bonded network setup
    Id string
    ID of the port
    Mac string
    MAC address assigned to the port
    Name string
    Name of the port (e.g. eth0, or bond0)
    Type string
    Type of the port (e.g. NetworkPort or NetworkBondPort)
    bonded Boolean
    Whether this port is part of a bond in bonded network setup
    id String
    ID of the port
    mac String
    MAC address assigned to the port
    name String
    Name of the port (e.g. eth0, or bond0)
    type String
    Type of the port (e.g. NetworkPort or NetworkBondPort)
    bonded boolean
    Whether this port is part of a bond in bonded network setup
    id string
    ID of the port
    mac string
    MAC address assigned to the port
    name string
    Name of the port (e.g. eth0, or bond0)
    type string
    Type of the port (e.g. NetworkPort or NetworkBondPort)
    bonded bool
    Whether this port is part of a bond in bonded network setup
    id str
    ID of the port
    mac str
    MAC address assigned to the port
    name str
    Name of the port (e.g. eth0, or bond0)
    type str
    Type of the port (e.g. NetworkPort or NetworkBondPort)
    bonded Boolean
    Whether this port is part of a bond in bonded network setup
    id String
    ID of the port
    mac String
    MAC address assigned to the port
    name String
    Name of the port (e.g. eth0, or bond0)
    type String
    Type of the port (e.g. NetworkPort or NetworkBondPort)

    Package Details

    Repository
    Equinix Metal pulumi/pulumi-equinix-metal
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the metal Terraform Provider.
    equinix-metal logo

    This package is deprecated. We recommend using the new Equinix package.

    Equinix Metal v3.2.1 published on Thursday, Dec 30, 2021 by DEPRECATED