Class Network


  • public class Network
    extends com.pulumi.resources.CustomResource
    Manages a V2 Neutron network resource within OpenStack. ## Example Usage ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.openstack.networking.Network; import com.pulumi.openstack.networking.NetworkArgs; import com.pulumi.openstack.networking.Subnet; import com.pulumi.openstack.networking.SubnetArgs; import com.pulumi.openstack.compute.SecGroup; import com.pulumi.openstack.compute.SecGroupArgs; import com.pulumi.openstack.compute.inputs.SecGroupRuleArgs; import com.pulumi.openstack.networking.Port; import com.pulumi.openstack.networking.PortArgs; import com.pulumi.openstack.networking.inputs.PortFixedIpArgs; import com.pulumi.openstack.compute.Instance; import com.pulumi.openstack.compute.InstanceArgs; import com.pulumi.openstack.compute.inputs.InstanceNetworkArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var network1 = new Network("network1", NetworkArgs.builder() .adminStateUp("true") .build()); var subnet1 = new Subnet("subnet1", SubnetArgs.builder() .networkId(network1.id()) .cidr("192.168.199.0/24") .ipVersion(4) .build()); var secgroup1 = new SecGroup("secgroup1", SecGroupArgs.builder() .description("a security group") .rules(SecGroupRuleArgs.builder() .fromPort(22) .toPort(22) .ipProtocol("tcp") .cidr("0.0.0.0/0") .build()) .build()); var port1 = new Port("port1", PortArgs.builder() .networkId(network1.id()) .adminStateUp("true") .securityGroupIds(secgroup1.id()) .fixedIps(PortFixedIpArgs.builder() .subnetId(subnet1.id()) .ipAddress("192.168.199.10") .build()) .build()); var instance1 = new Instance("instance1", InstanceArgs.builder() .securityGroups(secgroup1.name()) .networks(InstanceNetworkArgs.builder() .port(port1.id()) .build()) .build()); } } ``` ## Import Networks can be imported using the `id`, e.g. ```sh $ pulumi import openstack:networking/network:Network network_1 d90ce693-5ccf-4136-a0ed-152ce412b6b9 ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Network​(java.lang.String name)  
      Network​(java.lang.String name, NetworkArgs args)  
      Network​(java.lang.String name, NetworkArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.Boolean> adminStateUp()  
      com.pulumi.core.Output<java.util.List<java.lang.String>> allTags()  
      com.pulumi.core.Output<java.util.List<java.lang.String>> availabilityZoneHints()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()  
      com.pulumi.core.Output<java.lang.String> dnsDomain()  
      com.pulumi.core.Output<java.lang.Boolean> external()  
      static Network get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, NetworkState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.Integer> mtu()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.lang.Boolean> portSecurityEnabled()  
      com.pulumi.core.Output<java.lang.String> qosPolicyId()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.List<NetworkSegment>> segments()  
      com.pulumi.core.Output<java.lang.Boolean> shared()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> tags()  
      com.pulumi.core.Output<java.lang.String> tenantId()  
      com.pulumi.core.Output<java.lang.Boolean> transparentVlan()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.Object>>> valueSpecs()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Network

        public Network​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Network

        public Network​(java.lang.String name,
                       @Nullable
                       NetworkArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Network

        public Network​(java.lang.String name,
                       @Nullable
                       NetworkArgs args,
                       @Nullable
                       com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • adminStateUp

        public com.pulumi.core.Output<java.lang.Boolean> adminStateUp()
        Returns:
        The administrative state of the network. Acceptable values are "true" and "false". Changing this value updates the state of the existing network.
      • allTags

        public com.pulumi.core.Output<java.util.List<java.lang.String>> allTags()
        Returns:
        The collection of tags assigned on the network, which have been explicitly and implicitly added.
      • availabilityZoneHints

        public com.pulumi.core.Output<java.util.List<java.lang.String>> availabilityZoneHints()
        Returns:
        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.
      • description

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
        Returns:
        Human-readable description of the network. Changing this updates the name of the existing network.
      • dnsDomain

        public com.pulumi.core.Output<java.lang.String> dnsDomain()
        Returns:
        The network DNS domain. Available, when Neutron DNS extension is enabled. The `dns_domain` of a network in conjunction with the `dns_name` attribute of its ports will be published in an external DNS service when Neutron is configured to integrate with such a service.
      • external

        public com.pulumi.core.Output<java.lang.Boolean> external()
        Returns:
        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.
      • mtu

        public com.pulumi.core.Output<java.lang.Integer> mtu()
        Returns:
        The network MTU. Available for read-only, when Neutron `net-mtu` extension is enabled. Available for the modification, when Neutron `net-mtu-writable` extension is enabled.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        The name of the network. Changing this updates the name of the existing network.
      • portSecurityEnabled

        public com.pulumi.core.Output<java.lang.Boolean> portSecurityEnabled()
        Returns:
        Whether to explicitly enable or disable port security on the network. Port Security is usually enabled by default, so omitting this argument will usually result in a value of "true". Setting this explicitly to `false` will disable port security. Valid values are `true` and `false`.
      • qosPolicyId

        public com.pulumi.core.Output<java.lang.String> qosPolicyId()
        Returns:
        Reference to the associated QoS policy.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        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.
      • segments

        public com.pulumi.core.Output<java.util.List<NetworkSegment>> segments()
        Returns:
        An array of one or more provider segment objects. Note: most Networking plug-ins (e.g. ML2 Plugin) and drivers do not support updating any provider related segments attributes. Check your plug-in whether it supports updating.
      • shared

        public com.pulumi.core.Output<java.lang.Boolean> shared()
        Returns:
        Specifies whether the network resource can be accessed by any tenant or not. Changing this updates the sharing capabilities of the existing network.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> tags()
        Returns:
        A set of string tags for the network.
      • tenantId

        public com.pulumi.core.Output<java.lang.String> tenantId()
        Returns:
        The owner of the network. Required if admin wants to create a network for another tenant. Changing this creates a new network.
      • transparentVlan

        public com.pulumi.core.Output<java.lang.Boolean> transparentVlan()
        Returns:
        Specifies whether the network resource has the VLAN transparent attribute set. Valid values are true and false. Defaults to false. Changing this updates the `transparent_vlan` attribute of the existing network.
      • valueSpecs

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.Object>>> valueSpecs()
        Returns:
        Map of additional options.
      • get

        public static Network get​(java.lang.String name,
                                  com.pulumi.core.Output<java.lang.String> id,
                                  @Nullable
                                  NetworkState state,
                                  @Nullable
                                  com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.