# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities
from . import outputs

__all__ = [
    'GetServerResult',
    'AwaitableGetServerResult',
    'get_server',
    'get_server_output',
]

@pulumi.output_type
class GetServerResult:
    """
    A collection of values returned by getServer.
    """
    def __init__(__self__, cloud_init=None, description=None, domain=None, hostname=None, id=None, install_config_afterward=None, ips=None, ipv4s=None, ipv6s=None, name=None, offer=None, offer_id=None, offer_name=None, options=None, organization_id=None, os=None, os_name=None, partitioning=None, password=None, password_wo=None, password_wo_version=None, private_ips=None, private_networks=None, project_id=None, protected=None, reinstall_on_config_changes=None, server_id=None, service_password=None, service_password_wo=None, service_password_wo_version=None, service_user=None, ssh_key_ids=None, tags=None, user=None, zone=None):
        if cloud_init and not isinstance(cloud_init, str):
            raise TypeError("Expected argument 'cloud_init' to be a str")
        pulumi.set(__self__, "cloud_init", cloud_init)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if domain and not isinstance(domain, str):
            raise TypeError("Expected argument 'domain' to be a str")
        pulumi.set(__self__, "domain", domain)
        if hostname and not isinstance(hostname, str):
            raise TypeError("Expected argument 'hostname' to be a str")
        pulumi.set(__self__, "hostname", hostname)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if install_config_afterward and not isinstance(install_config_afterward, bool):
            raise TypeError("Expected argument 'install_config_afterward' to be a bool")
        pulumi.set(__self__, "install_config_afterward", install_config_afterward)
        if ips and not isinstance(ips, list):
            raise TypeError("Expected argument 'ips' to be a list")
        pulumi.set(__self__, "ips", ips)
        if ipv4s and not isinstance(ipv4s, list):
            raise TypeError("Expected argument 'ipv4s' to be a list")
        pulumi.set(__self__, "ipv4s", ipv4s)
        if ipv6s and not isinstance(ipv6s, list):
            raise TypeError("Expected argument 'ipv6s' to be a list")
        pulumi.set(__self__, "ipv6s", ipv6s)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if offer and not isinstance(offer, str):
            raise TypeError("Expected argument 'offer' to be a str")
        pulumi.set(__self__, "offer", offer)
        if offer_id and not isinstance(offer_id, str):
            raise TypeError("Expected argument 'offer_id' to be a str")
        pulumi.set(__self__, "offer_id", offer_id)
        if offer_name and not isinstance(offer_name, str):
            raise TypeError("Expected argument 'offer_name' to be a str")
        pulumi.set(__self__, "offer_name", offer_name)
        if options and not isinstance(options, list):
            raise TypeError("Expected argument 'options' to be a list")
        pulumi.set(__self__, "options", options)
        if organization_id and not isinstance(organization_id, str):
            raise TypeError("Expected argument 'organization_id' to be a str")
        pulumi.set(__self__, "organization_id", organization_id)
        if os and not isinstance(os, str):
            raise TypeError("Expected argument 'os' to be a str")
        pulumi.set(__self__, "os", os)
        if os_name and not isinstance(os_name, str):
            raise TypeError("Expected argument 'os_name' to be a str")
        pulumi.set(__self__, "os_name", os_name)
        if partitioning and not isinstance(partitioning, str):
            raise TypeError("Expected argument 'partitioning' to be a str")
        pulumi.set(__self__, "partitioning", partitioning)
        if password and not isinstance(password, str):
            raise TypeError("Expected argument 'password' to be a str")
        pulumi.set(__self__, "password", password)
        if password_wo and not isinstance(password_wo, str):
            raise TypeError("Expected argument 'password_wo' to be a str")
        pulumi.set(__self__, "password_wo", password_wo)
        if password_wo_version and not isinstance(password_wo_version, int):
            raise TypeError("Expected argument 'password_wo_version' to be a int")
        pulumi.set(__self__, "password_wo_version", password_wo_version)
        if private_ips and not isinstance(private_ips, list):
            raise TypeError("Expected argument 'private_ips' to be a list")
        pulumi.set(__self__, "private_ips", private_ips)
        if private_networks and not isinstance(private_networks, list):
            raise TypeError("Expected argument 'private_networks' to be a list")
        pulumi.set(__self__, "private_networks", private_networks)
        if project_id and not isinstance(project_id, str):
            raise TypeError("Expected argument 'project_id' to be a str")
        pulumi.set(__self__, "project_id", project_id)
        if protected and not isinstance(protected, bool):
            raise TypeError("Expected argument 'protected' to be a bool")
        pulumi.set(__self__, "protected", protected)
        if reinstall_on_config_changes and not isinstance(reinstall_on_config_changes, bool):
            raise TypeError("Expected argument 'reinstall_on_config_changes' to be a bool")
        pulumi.set(__self__, "reinstall_on_config_changes", reinstall_on_config_changes)
        if server_id and not isinstance(server_id, str):
            raise TypeError("Expected argument 'server_id' to be a str")
        pulumi.set(__self__, "server_id", server_id)
        if service_password and not isinstance(service_password, str):
            raise TypeError("Expected argument 'service_password' to be a str")
        pulumi.set(__self__, "service_password", service_password)
        if service_password_wo and not isinstance(service_password_wo, str):
            raise TypeError("Expected argument 'service_password_wo' to be a str")
        pulumi.set(__self__, "service_password_wo", service_password_wo)
        if service_password_wo_version and not isinstance(service_password_wo_version, int):
            raise TypeError("Expected argument 'service_password_wo_version' to be a int")
        pulumi.set(__self__, "service_password_wo_version", service_password_wo_version)
        if service_user and not isinstance(service_user, str):
            raise TypeError("Expected argument 'service_user' to be a str")
        pulumi.set(__self__, "service_user", service_user)
        if ssh_key_ids and not isinstance(ssh_key_ids, list):
            raise TypeError("Expected argument 'ssh_key_ids' to be a list")
        pulumi.set(__self__, "ssh_key_ids", ssh_key_ids)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        if user and not isinstance(user, str):
            raise TypeError("Expected argument 'user' to be a str")
        pulumi.set(__self__, "user", user)
        if zone and not isinstance(zone, str):
            raise TypeError("Expected argument 'zone' to be a str")
        pulumi.set(__self__, "zone", zone)

    @_builtins.property
    @pulumi.getter(name="cloudInit")
    def cloud_init(self) -> _builtins.str:
        return pulumi.get(self, "cloud_init")

    @_builtins.property
    @pulumi.getter
    def description(self) -> _builtins.str:
        return pulumi.get(self, "description")

    @_builtins.property
    @pulumi.getter
    def domain(self) -> _builtins.str:
        return pulumi.get(self, "domain")

    @_builtins.property
    @pulumi.getter
    def hostname(self) -> _builtins.str:
        return pulumi.get(self, "hostname")

    @_builtins.property
    @pulumi.getter
    def id(self) -> _builtins.str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @_builtins.property
    @pulumi.getter(name="installConfigAfterward")
    def install_config_afterward(self) -> _builtins.bool:
        return pulumi.get(self, "install_config_afterward")

    @_builtins.property
    @pulumi.getter
    def ips(self) -> Sequence['outputs.GetServerIpResult']:
        return pulumi.get(self, "ips")

    @_builtins.property
    @pulumi.getter
    def ipv4s(self) -> Sequence['outputs.GetServerIpv4Result']:
        return pulumi.get(self, "ipv4s")

    @_builtins.property
    @pulumi.getter
    def ipv6s(self) -> Sequence['outputs.GetServerIpv6Result']:
        return pulumi.get(self, "ipv6s")

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[_builtins.str]:
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter
    def offer(self) -> _builtins.str:
        return pulumi.get(self, "offer")

    @_builtins.property
    @pulumi.getter(name="offerId")
    def offer_id(self) -> _builtins.str:
        return pulumi.get(self, "offer_id")

    @_builtins.property
    @pulumi.getter(name="offerName")
    def offer_name(self) -> _builtins.str:
        return pulumi.get(self, "offer_name")

    @_builtins.property
    @pulumi.getter
    def options(self) -> Sequence['outputs.GetServerOptionResult']:
        return pulumi.get(self, "options")

    @_builtins.property
    @pulumi.getter(name="organizationId")
    def organization_id(self) -> _builtins.str:
        return pulumi.get(self, "organization_id")

    @_builtins.property
    @pulumi.getter
    def os(self) -> _builtins.str:
        return pulumi.get(self, "os")

    @_builtins.property
    @pulumi.getter(name="osName")
    def os_name(self) -> _builtins.str:
        return pulumi.get(self, "os_name")

    @_builtins.property
    @pulumi.getter
    def partitioning(self) -> _builtins.str:
        return pulumi.get(self, "partitioning")

    @_builtins.property
    @pulumi.getter
    def password(self) -> _builtins.str:
        return pulumi.get(self, "password")

    @_builtins.property
    @pulumi.getter(name="passwordWo")
    def password_wo(self) -> _builtins.str:
        return pulumi.get(self, "password_wo")

    @_builtins.property
    @pulumi.getter(name="passwordWoVersion")
    def password_wo_version(self) -> _builtins.int:
        return pulumi.get(self, "password_wo_version")

    @_builtins.property
    @pulumi.getter(name="privateIps")
    def private_ips(self) -> Sequence['outputs.GetServerPrivateIpResult']:
        return pulumi.get(self, "private_ips")

    @_builtins.property
    @pulumi.getter(name="privateNetworks")
    def private_networks(self) -> Sequence['outputs.GetServerPrivateNetworkResult']:
        return pulumi.get(self, "private_networks")

    @_builtins.property
    @pulumi.getter(name="projectId")
    def project_id(self) -> Optional[_builtins.str]:
        return pulumi.get(self, "project_id")

    @_builtins.property
    @pulumi.getter
    def protected(self) -> _builtins.bool:
        return pulumi.get(self, "protected")

    @_builtins.property
    @pulumi.getter(name="reinstallOnConfigChanges")
    def reinstall_on_config_changes(self) -> _builtins.bool:
        return pulumi.get(self, "reinstall_on_config_changes")

    @_builtins.property
    @pulumi.getter(name="serverId")
    def server_id(self) -> Optional[_builtins.str]:
        return pulumi.get(self, "server_id")

    @_builtins.property
    @pulumi.getter(name="servicePassword")
    def service_password(self) -> _builtins.str:
        return pulumi.get(self, "service_password")

    @_builtins.property
    @pulumi.getter(name="servicePasswordWo")
    def service_password_wo(self) -> _builtins.str:
        return pulumi.get(self, "service_password_wo")

    @_builtins.property
    @pulumi.getter(name="servicePasswordWoVersion")
    def service_password_wo_version(self) -> _builtins.int:
        return pulumi.get(self, "service_password_wo_version")

    @_builtins.property
    @pulumi.getter(name="serviceUser")
    def service_user(self) -> _builtins.str:
        return pulumi.get(self, "service_user")

    @_builtins.property
    @pulumi.getter(name="sshKeyIds")
    def ssh_key_ids(self) -> Sequence[_builtins.str]:
        return pulumi.get(self, "ssh_key_ids")

    @_builtins.property
    @pulumi.getter
    def tags(self) -> Sequence[_builtins.str]:
        return pulumi.get(self, "tags")

    @_builtins.property
    @pulumi.getter
    def user(self) -> _builtins.str:
        return pulumi.get(self, "user")

    @_builtins.property
    @pulumi.getter
    def zone(self) -> Optional[_builtins.str]:
        return pulumi.get(self, "zone")


class AwaitableGetServerResult(GetServerResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetServerResult(
            cloud_init=self.cloud_init,
            description=self.description,
            domain=self.domain,
            hostname=self.hostname,
            id=self.id,
            install_config_afterward=self.install_config_afterward,
            ips=self.ips,
            ipv4s=self.ipv4s,
            ipv6s=self.ipv6s,
            name=self.name,
            offer=self.offer,
            offer_id=self.offer_id,
            offer_name=self.offer_name,
            options=self.options,
            organization_id=self.organization_id,
            os=self.os,
            os_name=self.os_name,
            partitioning=self.partitioning,
            password=self.password,
            password_wo=self.password_wo,
            password_wo_version=self.password_wo_version,
            private_ips=self.private_ips,
            private_networks=self.private_networks,
            project_id=self.project_id,
            protected=self.protected,
            reinstall_on_config_changes=self.reinstall_on_config_changes,
            server_id=self.server_id,
            service_password=self.service_password,
            service_password_wo=self.service_password_wo,
            service_password_wo_version=self.service_password_wo_version,
            service_user=self.service_user,
            ssh_key_ids=self.ssh_key_ids,
            tags=self.tags,
            user=self.user,
            zone=self.zone)


def get_server(name: Optional[_builtins.str] = None,
               project_id: Optional[_builtins.str] = None,
               server_id: Optional[_builtins.str] = None,
               zone: Optional[_builtins.str] = None,
               opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetServerResult:
    """
    Gets information about a baremetal server.
    For more information, see the [API documentation](https://developers.scaleway.com/en/products/baremetal/api).

    ## Example Usage

    ```python
    import pulumi
    import pulumi_scaleway as scaleway

    # Get info by server name
    by_name = scaleway.elasticmetal.get_server(name="foobar",
        zone="fr-par-2")
    # Get info by server id
    by_id = scaleway.elasticmetal.get_server(server_id="11111111-1111-1111-1111-111111111111")
    ```


    :param _builtins.str name: The server name. Only one of `name` and `server_id` should be specified.
    :param _builtins.str project_id: The ID of the project the baremetal server is associated with.
    :param _builtins.str zone: `zone`) The zone in which the server exists.
    """
    __args__ = dict()
    __args__['name'] = name
    __args__['projectId'] = project_id
    __args__['serverId'] = server_id
    __args__['zone'] = zone
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('scaleway:elasticmetal/getServer:getServer', __args__, opts=opts, typ=GetServerResult).value

    return AwaitableGetServerResult(
        cloud_init=pulumi.get(__ret__, 'cloud_init'),
        description=pulumi.get(__ret__, 'description'),
        domain=pulumi.get(__ret__, 'domain'),
        hostname=pulumi.get(__ret__, 'hostname'),
        id=pulumi.get(__ret__, 'id'),
        install_config_afterward=pulumi.get(__ret__, 'install_config_afterward'),
        ips=pulumi.get(__ret__, 'ips'),
        ipv4s=pulumi.get(__ret__, 'ipv4s'),
        ipv6s=pulumi.get(__ret__, 'ipv6s'),
        name=pulumi.get(__ret__, 'name'),
        offer=pulumi.get(__ret__, 'offer'),
        offer_id=pulumi.get(__ret__, 'offer_id'),
        offer_name=pulumi.get(__ret__, 'offer_name'),
        options=pulumi.get(__ret__, 'options'),
        organization_id=pulumi.get(__ret__, 'organization_id'),
        os=pulumi.get(__ret__, 'os'),
        os_name=pulumi.get(__ret__, 'os_name'),
        partitioning=pulumi.get(__ret__, 'partitioning'),
        password=pulumi.get(__ret__, 'password'),
        password_wo=pulumi.get(__ret__, 'password_wo'),
        password_wo_version=pulumi.get(__ret__, 'password_wo_version'),
        private_ips=pulumi.get(__ret__, 'private_ips'),
        private_networks=pulumi.get(__ret__, 'private_networks'),
        project_id=pulumi.get(__ret__, 'project_id'),
        protected=pulumi.get(__ret__, 'protected'),
        reinstall_on_config_changes=pulumi.get(__ret__, 'reinstall_on_config_changes'),
        server_id=pulumi.get(__ret__, 'server_id'),
        service_password=pulumi.get(__ret__, 'service_password'),
        service_password_wo=pulumi.get(__ret__, 'service_password_wo'),
        service_password_wo_version=pulumi.get(__ret__, 'service_password_wo_version'),
        service_user=pulumi.get(__ret__, 'service_user'),
        ssh_key_ids=pulumi.get(__ret__, 'ssh_key_ids'),
        tags=pulumi.get(__ret__, 'tags'),
        user=pulumi.get(__ret__, 'user'),
        zone=pulumi.get(__ret__, 'zone'))
def get_server_output(name: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                      project_id: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                      server_id: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                      zone: Optional[pulumi.Input[Optional[_builtins.str]]] = None,
                      opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetServerResult]:
    """
    Gets information about a baremetal server.
    For more information, see the [API documentation](https://developers.scaleway.com/en/products/baremetal/api).

    ## Example Usage

    ```python
    import pulumi
    import pulumi_scaleway as scaleway

    # Get info by server name
    by_name = scaleway.elasticmetal.get_server(name="foobar",
        zone="fr-par-2")
    # Get info by server id
    by_id = scaleway.elasticmetal.get_server(server_id="11111111-1111-1111-1111-111111111111")
    ```


    :param _builtins.str name: The server name. Only one of `name` and `server_id` should be specified.
    :param _builtins.str project_id: The ID of the project the baremetal server is associated with.
    :param _builtins.str zone: `zone`) The zone in which the server exists.
    """
    __args__ = dict()
    __args__['name'] = name
    __args__['projectId'] = project_id
    __args__['serverId'] = server_id
    __args__['zone'] = zone
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('scaleway:elasticmetal/getServer:getServer', __args__, opts=opts, typ=GetServerResult)
    return __ret__.apply(lambda __response__: GetServerResult(
        cloud_init=pulumi.get(__response__, 'cloud_init'),
        description=pulumi.get(__response__, 'description'),
        domain=pulumi.get(__response__, 'domain'),
        hostname=pulumi.get(__response__, 'hostname'),
        id=pulumi.get(__response__, 'id'),
        install_config_afterward=pulumi.get(__response__, 'install_config_afterward'),
        ips=pulumi.get(__response__, 'ips'),
        ipv4s=pulumi.get(__response__, 'ipv4s'),
        ipv6s=pulumi.get(__response__, 'ipv6s'),
        name=pulumi.get(__response__, 'name'),
        offer=pulumi.get(__response__, 'offer'),
        offer_id=pulumi.get(__response__, 'offer_id'),
        offer_name=pulumi.get(__response__, 'offer_name'),
        options=pulumi.get(__response__, 'options'),
        organization_id=pulumi.get(__response__, 'organization_id'),
        os=pulumi.get(__response__, 'os'),
        os_name=pulumi.get(__response__, 'os_name'),
        partitioning=pulumi.get(__response__, 'partitioning'),
        password=pulumi.get(__response__, 'password'),
        password_wo=pulumi.get(__response__, 'password_wo'),
        password_wo_version=pulumi.get(__response__, 'password_wo_version'),
        private_ips=pulumi.get(__response__, 'private_ips'),
        private_networks=pulumi.get(__response__, 'private_networks'),
        project_id=pulumi.get(__response__, 'project_id'),
        protected=pulumi.get(__response__, 'protected'),
        reinstall_on_config_changes=pulumi.get(__response__, 'reinstall_on_config_changes'),
        server_id=pulumi.get(__response__, 'server_id'),
        service_password=pulumi.get(__response__, 'service_password'),
        service_password_wo=pulumi.get(__response__, 'service_password_wo'),
        service_password_wo_version=pulumi.get(__response__, 'service_password_wo_version'),
        service_user=pulumi.get(__response__, 'service_user'),
        ssh_key_ids=pulumi.get(__response__, 'ssh_key_ids'),
        tags=pulumi.get(__response__, 'tags'),
        user=pulumi.get(__response__, 'user'),
        zone=pulumi.get(__response__, 'zone')))
