# 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 pulumi
import pulumi.runtime

class Network(pulumi.CustomResource):
    """
    Manages a V2 Neutron network resource within OpenStack.
    """
    def __init__(__self__, __name__, __opts__=None, admin_state_up=None, availability_zone_hints=None, external=None, name=None, region=None, segments=None, shared=None, tenant_id=None, value_specs=None):
        """Create a Network resource with the given unique name, props, and options."""
        if not __name__:
            raise TypeError('Missing resource name argument (for URN creation)')
        if not isinstance(__name__, basestring):
            raise TypeError('Expected resource name to be a string')
        if __opts__ and not isinstance(__opts__, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')

        __props__ = dict()

        if admin_state_up and not isinstance(admin_state_up, basestring):
            raise TypeError('Expected property admin_state_up to be a basestring')
        __self__.admin_state_up = admin_state_up
        """
        The administrative state of the network.
        Acceptable values are "true" and "false". Changing this value updates the
        state of the existing network.
        """
        __props__['adminStateUp'] = admin_state_up

        if availability_zone_hints and not isinstance(availability_zone_hints, list):
            raise TypeError('Expected property availability_zone_hints to be a list')
        __self__.availability_zone_hints = availability_zone_hints
        """
        An availability zone is used to make
        network resources highly available. Used for resources with high availability
        so that they are scheduled on different availability zones. Changing this
        creates a new network.
        """
        __props__['availabilityZoneHints'] = availability_zone_hints

        if external and not isinstance(external, bool):
            raise TypeError('Expected property external to be a bool')
        __self__.external = external
        """
        Specifies whether the network resource has the
        external routing facility. Valid values are true and false. Defaults to
        false. Changing this updates the external attribute of the existing network.
        """
        __props__['external'] = external

        if name and not isinstance(name, basestring):
            raise TypeError('Expected property name to be a basestring')
        __self__.name = name
        """
        The name of the network. Changing this updates the name of
        the existing network.
        """
        __props__['name'] = name

        if region and not isinstance(region, basestring):
            raise TypeError('Expected property region to be a basestring')
        __self__.region = region
        """
        The region in which to obtain the V2 Networking client.
        A Networking client is needed to create a Neutron network. If omitted, the
        `region` argument of the provider is used. Changing this creates a new
        network.
        """
        __props__['region'] = region

        if segments and not isinstance(segments, list):
            raise TypeError('Expected property segments to be a list')
        __self__.segments = segments
        """
        An array of one or more provider segment objects.
        """
        __props__['segments'] = segments

        if shared and not isinstance(shared, basestring):
            raise TypeError('Expected property shared to be a basestring')
        __self__.shared = shared
        """
        Specifies whether the network resource can be accessed
        by any tenant or not. Changing this updates the sharing capabalities of the
        existing network.
        """
        __props__['shared'] = shared

        if tenant_id and not isinstance(tenant_id, basestring):
            raise TypeError('Expected property tenant_id to be a basestring')
        __self__.tenant_id = tenant_id
        """
        The owner of the network. Required if admin wants to
        create a network for another tenant. Changing this creates a new network.
        """
        __props__['tenantId'] = tenant_id

        if value_specs and not isinstance(value_specs, dict):
            raise TypeError('Expected property value_specs to be a dict')
        __self__.value_specs = value_specs
        """
        Map of additional options.
        """
        __props__['valueSpecs'] = value_specs

        super(Network, __self__).__init__(
            'openstack:networking/network:Network',
            __name__,
            __props__,
            __opts__)

    def set_outputs(self, outs):
        if 'adminStateUp' in outs:
            self.admin_state_up = outs['adminStateUp']
        if 'availabilityZoneHints' in outs:
            self.availability_zone_hints = outs['availabilityZoneHints']
        if 'external' in outs:
            self.external = outs['external']
        if 'name' in outs:
            self.name = outs['name']
        if 'region' in outs:
            self.region = outs['region']
        if 'segments' in outs:
            self.segments = outs['segments']
        if 'shared' in outs:
            self.shared = outs['shared']
        if 'tenantId' in outs:
            self.tenant_id = outs['tenantId']
        if 'valueSpecs' in outs:
            self.value_specs = outs['valueSpecs']
