# coding=utf-8
# *** 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! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities
from . import outputs
from ._inputs import *

__all__ = [
    'GetVlansResult',
    'AwaitableGetVlansResult',
    'get_vlans',
]

@pulumi.output_type
class GetVlansResult:
    """
    A collection of values returned by getVlans.
    """
    def __init__(__self__, filters=None, id=None, vlans=None):
        if filters and not isinstance(filters, list):
            raise TypeError("Expected argument 'filters' to be a list")
        pulumi.set(__self__, "filters", filters)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if vlans and not isinstance(vlans, list):
            raise TypeError("Expected argument 'vlans' to be a list")
        pulumi.set(__self__, "vlans", vlans)

    @property
    @pulumi.getter
    def filters(self) -> Optional[Sequence['outputs.GetVlansFilterResult']]:
        return pulumi.get(self, "filters")

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

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


class AwaitableGetVlansResult(GetVlansResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetVlansResult(
            filters=self.filters,
            id=self.id,
            vlans=self.vlans)


def get_vlans(filters: Optional[Sequence[pulumi.InputType['GetVlansFilterArgs']]] = None,
              opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetVlansResult:
    """
    Provides details about Linode VLANs.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_linode as linode

    my_instance = linode.Instance("myInstance",
        image="linode/ubuntu18.04",
        interfaces=[linode.InstanceInterfaceArgs(
            label="my-vlan",
            purpose="vlan",
        )],
        label="my_instance",
        region="us-southeast",
        root_pass="bogusPassword$",
        type="g6-standard-1")
    my_vlans = linode.get_vlans(filters=[linode.GetVlansFilterArgs(
        name="label",
        values=["my-vlan"],
    )])
    ```
    ## Attributes

    Each Linode VLAN will be stored in the `vlans` attribute and will export the following attributes:

    * `label` - The unique label of the VLAN.

    * `linodes` - The running Linodes currently attached to the VLAN.

    * `region` - The region the VLAN is located in. See all regions [here](https://api.linode.com/v4/regions).

    * `created` - When the VLAN was created.

    ## Filterable Fields

    * `label`

    * `region`
    """
    __args__ = dict()
    __args__['filters'] = filters
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = _utilities.get_version()
    __ret__ = pulumi.runtime.invoke('linode:index/getVlans:getVlans', __args__, opts=opts, typ=GetVlansResult).value

    return AwaitableGetVlansResult(
        filters=__ret__.filters,
        id=__ret__.id,
        vlans=__ret__.vlans)
