<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 GetMetalDevice
    {
        /// <summary>
        /// Provides an Equinix Metal device datasource.
        /// 
        /// &gt; **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](https://www.terraform.io/docs/state/sensitive-data.html).
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Equinix = Pulumi.Equinix;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var test = Output.Create(Equinix.GetMetalDevice.InvokeAsync(new Equinix.GetMetalDeviceArgs
        ///         {
        ///             ProjectId = local.Project_id,
        ///             Hostname = "mydevice",
        ///         }));
        ///         this.Id = test.Apply(test =&gt; test.Id);
        ///     }
        /// 
        ///     [Output("id")]
        ///     public Output&lt;string&gt; Id { get; set; }
        /// }
        /// ```
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Equinix = Pulumi.Equinix;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var test = Output.Create(Equinix.GetMetalDevice.InvokeAsync(new Equinix.GetMetalDeviceArgs
        ///         {
        ///             DeviceId = "4c641195-25e5-4c3c-b2b7-4cd7a42c7b40",
        ///         }));
        ///         this.Ipv4 = test.Apply(test =&gt; test.AccessPublicIpv4);
        ///     }
        /// 
        ///     [Output("ipv4")]
        ///     public Output&lt;string&gt; Ipv4 { get; set; }
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetMetalDeviceResult> InvokeAsync(GetMetalDeviceArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetMetalDeviceResult>("equinix:index/getMetalDevice:GetMetalDevice", args ?? new GetMetalDeviceArgs(), options.WithDefaults());

        /// <summary>
        /// Provides an Equinix Metal device datasource.
        /// 
        /// &gt; **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](https://www.terraform.io/docs/state/sensitive-data.html).
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Equinix = Pulumi.Equinix;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var test = Output.Create(Equinix.GetMetalDevice.InvokeAsync(new Equinix.GetMetalDeviceArgs
        ///         {
        ///             ProjectId = local.Project_id,
        ///             Hostname = "mydevice",
        ///         }));
        ///         this.Id = test.Apply(test =&gt; test.Id);
        ///     }
        /// 
        ///     [Output("id")]
        ///     public Output&lt;string&gt; Id { get; set; }
        /// }
        /// ```
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Equinix = Pulumi.Equinix;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var test = Output.Create(Equinix.GetMetalDevice.InvokeAsync(new Equinix.GetMetalDeviceArgs
        ///         {
        ///             DeviceId = "4c641195-25e5-4c3c-b2b7-4cd7a42c7b40",
        ///         }));
        ///         this.Ipv4 = test.Apply(test =&gt; test.AccessPublicIpv4);
        ///     }
        /// 
        ///     [Output("ipv4")]
        ///     public Output&lt;string&gt; Ipv4 { get; set; }
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetMetalDeviceResult> Invoke(GetMetalDeviceInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetMetalDeviceResult>("equinix:index/getMetalDevice:GetMetalDevice", args ?? new GetMetalDeviceInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetMetalDeviceArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// Device ID.
        /// </summary>
        [Input("deviceId")]
        public string? DeviceId { get; set; }

        /// <summary>
        /// The device name.
        /// </summary>
        [Input("hostname")]
        public string? Hostname { get; set; }

        /// <summary>
        /// The id of the project in which the devices exists.
        /// </summary>
        [Input("projectId")]
        public string? ProjectId { get; set; }

        public GetMetalDeviceArgs()
        {
        }
    }

    public sealed class GetMetalDeviceInvokeArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// Device ID.
        /// </summary>
        [Input("deviceId")]
        public Input<string>? DeviceId { get; set; }

        /// <summary>
        /// The device name.
        /// </summary>
        [Input("hostname")]
        public Input<string>? Hostname { get; set; }

        /// <summary>
        /// The id of the project in which the devices exists.
        /// </summary>
        [Input("projectId")]
        public Input<string>? ProjectId { get; set; }

        public GetMetalDeviceInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetMetalDeviceResult
    {
        /// <summary>
        /// The ipv4 private IP assigned to the device.
        /// </summary>
        public readonly string AccessPrivateIpv4;
        /// <summary>
        /// The ipv4 management IP assigned to the device.
        /// </summary>
        public readonly string AccessPublicIpv4;
        /// <summary>
        /// The ipv6 management IP assigned to the device.
        /// </summary>
        public readonly string AccessPublicIpv6;
        public readonly bool AlwaysPxe;
        /// <summary>
        /// The billing cycle of the device (monthly or hourly).
        /// </summary>
        public readonly string BillingCycle;
        /// <summary>
        /// Description string for the device.
        /// </summary>
        public readonly string Description;
        public readonly string DeviceId;
        /// <summary>
        /// The facility where the device is deployed.
        /// </summary>
        public readonly string Facility;
        /// <summary>
        /// The id of hardware reservation which this device occupies.
        /// </summary>
        public readonly string HardwareReservationId;
        public readonly string Hostname;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly string IpxeScriptUrl;
        /// <summary>
        /// The metro where the device is deployed
        /// </summary>
        public readonly string Metro;
        /// <summary>
        /// L2 network type of the device, one of `layer3`, `layer2-bonded`,
        /// `layer2-individual`, `hybrid`.
        /// </summary>
        public readonly string NetworkType;
        /// <summary>
        /// The device's private and public IP (v4 and v6) network details. See
        /// Network Attribute below for more details.
        /// </summary>
        public readonly ImmutableArray<Outputs.GetMetalDeviceNetworkResult> Networks;
        /// <summary>
        /// The operating system running on the device.
        /// </summary>
        public readonly string OperatingSystem;
        /// <summary>
        /// The hardware config of the device.
        /// </summary>
        public readonly string Plan;
        /// <summary>
        /// List of ports assigned to the device. See Ports Attribute below for
        /// more details.
        /// </summary>
        public readonly ImmutableArray<Outputs.GetMetalDevicePortResult> Ports;
        public readonly string ProjectId;
        /// <summary>
        /// Root password to the server (if still available).
        /// </summary>
        public readonly string RootPassword;
        /// <summary>
        /// List of IDs of SSH keys deployed in the device, can be both user or project SSH keys.
        /// </summary>
        public readonly ImmutableArray<string> SshKeyIds;
        /// <summary>
        /// The state of the device.
        /// </summary>
        public readonly string State;
        public readonly string Storage;
        /// <summary>
        /// Tags attached to the device.
        /// </summary>
        public readonly ImmutableArray<string> Tags;

        [OutputConstructor]
        private GetMetalDeviceResult(
            string accessPrivateIpv4,

            string accessPublicIpv4,

            string accessPublicIpv6,

            bool alwaysPxe,

            string billingCycle,

            string description,

            string deviceId,

            string facility,

            string hardwareReservationId,

            string hostname,

            string id,

            string ipxeScriptUrl,

            string metro,

            string networkType,

            ImmutableArray<Outputs.GetMetalDeviceNetworkResult> networks,

            string operatingSystem,

            string plan,

            ImmutableArray<Outputs.GetMetalDevicePortResult> ports,

            string projectId,

            string rootPassword,

            ImmutableArray<string> sshKeyIds,

            string state,

            string storage,

            ImmutableArray<string> tags)
        {
            AccessPrivateIpv4 = accessPrivateIpv4;
            AccessPublicIpv4 = accessPublicIpv4;
            AccessPublicIpv6 = accessPublicIpv6;
            AlwaysPxe = alwaysPxe;
            BillingCycle = billingCycle;
            Description = description;
            DeviceId = deviceId;
            Facility = facility;
            HardwareReservationId = hardwareReservationId;
            Hostname = hostname;
            Id = id;
            IpxeScriptUrl = ipxeScriptUrl;
            Metro = metro;
            NetworkType = networkType;
            Networks = networks;
            OperatingSystem = operatingSystem;
            Plan = plan;
            Ports = ports;
            ProjectId = projectId;
            RootPassword = rootPassword;
            SshKeyIds = sshKeyIds;
            State = state;
            Storage = storage;
            Tags = tags;
        }
    }
}
