<filename>sdk/dotnet/GetMetalPort.cs<gh_stars>0// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Cuemby.Equinix
{
    public static class GetMetalPort
    {
        /// <summary>
        /// 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.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Create a device and read it's eth0 port to the datasource.
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Equinix = Cuemby.Equinix;
        /// using Equinix = Pulumi.Equinix;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var projectId = "&lt;UUID_of_your_project&gt;";
        ///         var testMetalDevice = new Equinix.MetalDevice("testMetalDevice", new Equinix.MetalDeviceArgs
        ///         {
        ///             Hostname = "tfacc-test-device-port",
        ///             Plan = "c3.medium.x86",
        ///             Facilities = 
        ///             {
        ///                 "sv15",
        ///             },
        ///             OperatingSystem = "ubuntu_20_04",
        ///             BillingCycle = "hourly",
        ///             ProjectId = projectId,
        ///         });
        ///         var testGetMetalPort = Equinix.GetMetalPort.Invoke(new Equinix.GetMetalPortInvokeArgs
        ///         {
        ///             DeviceId = testMetalDevice.Id,
        ///             Name = "eth0",
        ///         });
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetMetalPortResult> InvokeAsync(GetMetalPortArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetMetalPortResult>("equinix:index/getMetalPort:GetMetalPort", args ?? new GetMetalPortArgs(), options.WithDefaults());

        /// <summary>
        /// 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.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Create a device and read it's eth0 port to the datasource.
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Equinix = Cuemby.Equinix;
        /// using Equinix = Pulumi.Equinix;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var projectId = "&lt;UUID_of_your_project&gt;";
        ///         var testMetalDevice = new Equinix.MetalDevice("testMetalDevice", new Equinix.MetalDeviceArgs
        ///         {
        ///             Hostname = "tfacc-test-device-port",
        ///             Plan = "c3.medium.x86",
        ///             Facilities = 
        ///             {
        ///                 "sv15",
        ///             },
        ///             OperatingSystem = "ubuntu_20_04",
        ///             BillingCycle = "hourly",
        ///             ProjectId = projectId,
        ///         });
        ///         var testGetMetalPort = Equinix.GetMetalPort.Invoke(new Equinix.GetMetalPortInvokeArgs
        ///         {
        ///             DeviceId = testMetalDevice.Id,
        ///             Name = "eth0",
        ///         });
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetMetalPortResult> Invoke(GetMetalPortInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetMetalPortResult>("equinix:index/getMetalPort:GetMetalPort", args ?? new GetMetalPortInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetMetalPortArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// Device UUID where to lookup the port.
        /// </summary>
        [Input("deviceId")]
        public string? DeviceId { get; set; }

        /// <summary>
        /// Name of the port to look up, i.e. `bond0`, `eth1`.
        /// </summary>
        [Input("name")]
        public string? Name { get; set; }

        /// <summary>
        /// ID of the port to read, conflicts with `device_id`.
        /// </summary>
        [Input("portId")]
        public string? PortId { get; set; }

        public GetMetalPortArgs()
        {
        }
    }

    public sealed class GetMetalPortInvokeArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// Device UUID where to lookup the port.
        /// </summary>
        [Input("deviceId")]
        public Input<string>? DeviceId { get; set; }

        /// <summary>
        /// Name of the port to look up, i.e. `bond0`, `eth1`.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// ID of the port to read, conflicts with `device_id`.
        /// </summary>
        [Input("portId")]
        public Input<string>? PortId { get; set; }

        public GetMetalPortInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetMetalPortResult
    {
        /// <summary>
        /// UUID of the bond port.
        /// </summary>
        public readonly string BondId;
        /// <summary>
        /// Name of the bond port.
        /// </summary>
        public readonly string BondName;
        /// <summary>
        /// Flag indicating whether the port is bonded.
        /// </summary>
        public readonly bool Bonded;
        public readonly string? DeviceId;
        /// <summary>
        /// Flag indicating whether the port can be removed from a bond.
        /// </summary>
        public readonly bool DisbondSupported;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly bool Layer2;
        /// <summary>
        /// MAC address of the port.
        /// </summary>
        public readonly string Mac;
        public readonly string Name;
        /// <summary>
        /// UUID of native VLAN of the port.
        /// </summary>
        public readonly string NativeVlanId;
        /// <summary>
        /// One of `layer2-bonded`, `layer2-individual`, `layer3`, `hybrid`, `hybrid-bonded`.
        /// </summary>
        public readonly string NetworkType;
        public readonly string? PortId;
        /// <summary>
        /// Type is either `NetworkBondPort` for bond ports or `NetworkPort` for bondable ethernet ports.
        /// </summary>
        public readonly string Type;
        /// <summary>
        /// UUIDs of attached VLANs.
        /// </summary>
        public readonly ImmutableArray<string> VlanIds;
        /// <summary>
        /// VXLAN ids of attached VLANs.
        /// </summary>
        public readonly ImmutableArray<int> VxlanIds;

        [OutputConstructor]
        private GetMetalPortResult(
            string bondId,

            string bondName,

            bool bonded,

            string? deviceId,

            bool disbondSupported,

            string id,

            bool layer2,

            string mac,

            string name,

            string nativeVlanId,

            string networkType,

            string? portId,

            string type,

            ImmutableArray<string> vlanIds,

            ImmutableArray<int> vxlanIds)
        {
            BondId = bondId;
            BondName = bondName;
            Bonded = bonded;
            DeviceId = deviceId;
            DisbondSupported = disbondSupported;
            Id = id;
            Layer2 = layer2;
            Mac = mac;
            Name = name;
            NativeVlanId = nativeVlanId;
            NetworkType = networkType;
            PortId = portId;
            Type = type;
            VlanIds = vlanIds;
            VxlanIds = vxlanIds;
        }
    }
}
