Class Port


  • public class Port
    extends com.pulumi.resources.CustomResource
    Manages a V2 port resource within OpenStack. ## Example Usage ### Simple port ```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.Port; import com.pulumi.openstack.networking.PortArgs; 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 port1 = new Port("port1", PortArgs.builder() .networkId(network1.id()) .adminStateUp("true") .build()); } } ``` ### Port with physical binding information ```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.Port; import com.pulumi.openstack.networking.PortArgs; import com.pulumi.openstack.networking.inputs.PortBindingArgs; 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 port1 = new Port("port1", PortArgs.builder() .networkId(network1.id()) .deviceId("cdf70fcf-c161-4f24-9c70-96b3f5a54b71") .deviceOwner("baremetal:none") .adminStateUp("true") .binding(PortBindingArgs.builder() .hostId("b080b9cf-46e0-4ce8-ad47-0fd4accc872b") .vnicType("baremetal") .profile(""" { "local_link_information": [ { "switch_info": "info1", "port_id": "Ethernet3/4", "switch_id": "12:34:56:78:9A:BC" }, { "switch_info": "info2", "port_id": "Ethernet3/4", "switch_id": "12:34:56:78:9A:BD" } ], "vlan_type": "allowed" } """) .build()) .build()); } } ``` ## Notes ### Ports and Instances There are some notes to consider when connecting Instances to networks using Ports. Please see the `openstack.compute.Instance` documentation for further documentation. ## Import Ports can be imported using the `id`, e.g. ```sh $ pulumi import openstack:networking/port:Port port_1 eae26a3e-1c33-4cc1-9c31-0cd729c438a1 ```
    • 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
      Port​(java.lang.String name)  
      Port​(java.lang.String name, PortArgs args)  
      Port​(java.lang.String name, PortArgs 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>> allFixedIps()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<PortAllowedAddressPair>>> allowedAddressPairs()  
      com.pulumi.core.Output<java.util.List<java.lang.String>> allSecurityGroupIds()  
      com.pulumi.core.Output<java.util.List<java.lang.String>> allTags()  
      com.pulumi.core.Output<PortBinding> binding()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()  
      com.pulumi.core.Output<java.lang.String> deviceId()  
      com.pulumi.core.Output<java.lang.String> deviceOwner()  
      com.pulumi.core.Output<java.util.List<java.util.Map<java.lang.String,​java.lang.Object>>> dnsAssignments()  
      com.pulumi.core.Output<java.lang.String> dnsName()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<PortExtraDhcpOption>>> extraDhcpOptions()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<PortFixedIp>>> fixedIps()  
      static Port get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, PortState 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.String> macAddress()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.lang.String> networkId()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> noFixedIp()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> noSecurityGroups()  
      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.Optional<java.util.List<java.lang.String>>> securityGroupIds()  
      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.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

      • Port

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

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

        public Port​(java.lang.String name,
                    PortArgs 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:
        Administrative up/down status for the port (must be `true` or `false` if provided). Changing this updates the `admin_state_up` of an existing port.
      • allFixedIps

        public com.pulumi.core.Output<java.util.List<java.lang.String>> allFixedIps()
        Returns:
        The collection of Fixed IP addresses on the port in the order returned by the Network v2 API.
      • allSecurityGroupIds

        public com.pulumi.core.Output<java.util.List<java.lang.String>> allSecurityGroupIds()
        Returns:
        The collection of Security Group IDs on the port which have been explicitly and implicitly added.
      • allTags

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

        public com.pulumi.core.Output<java.util.Optional<java.util.List<PortAllowedAddressPair>>> allowedAddressPairs()
        Returns:
        An IP/MAC Address pair of additional IP addresses that can be active on this port. The structure is described below.
      • binding

        public com.pulumi.core.Output<PortBinding> binding()
        Returns:
        The port binding allows to specify binding information for the port. The structure is described below.
      • description

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

        public com.pulumi.core.Output<java.lang.String> deviceId()
        Returns:
        The ID of the device attached to the port. Changing this creates a new port.
      • deviceOwner

        public com.pulumi.core.Output<java.lang.String> deviceOwner()
        Returns:
        The device owner of the port. Changing this creates a new port.
      • dnsAssignments

        public com.pulumi.core.Output<java.util.List<java.util.Map<java.lang.String,​java.lang.Object>>> dnsAssignments()
        Returns:
        The list of maps representing port DNS assignments.
      • dnsName

        public com.pulumi.core.Output<java.lang.String> dnsName()
        Returns:
        The port DNS name. Available, when Neutron DNS extension is enabled.
      • extraDhcpOptions

        public com.pulumi.core.Output<java.util.Optional<java.util.List<PortExtraDhcpOption>>> extraDhcpOptions()
        Returns:
        An extra DHCP option that needs to be configured on the port. The structure is described below. Can be specified multiple times.
      • fixedIps

        public com.pulumi.core.Output<java.util.Optional<java.util.List<PortFixedIp>>> fixedIps()
        Returns:
        An array of desired IPs for this port. The structure is described below.
      • macAddress

        public com.pulumi.core.Output<java.lang.String> macAddress()
        Returns:
        Specify a specific MAC address for the port. Changing this creates a new port.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        A unique name for the port. Changing this updates the `name` of an existing port.
      • networkId

        public com.pulumi.core.Output<java.lang.String> networkId()
        Returns:
        The ID of the network to attach the port to. Changing this creates a new port.
      • noFixedIp

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> noFixedIp()
        Returns:
        Create a port with no fixed IP address. This will also remove any fixed IPs previously set on a port. `true` is the only valid value for this argument.
      • noSecurityGroups

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> noSecurityGroups()
        Returns:
        If set to `true`, then no security groups are applied to the port. If set to `false` and no `security_group_ids` are specified, then the port will yield to the default behavior of the Networking service, which is to usually apply the "default" security group.
      • portSecurityEnabled

        public com.pulumi.core.Output<java.lang.Boolean> portSecurityEnabled()
        Returns:
        Whether to explicitly enable or disable port security on the port. Port Security is usually enabled by default, so omitting argument will usually result in a value of `true`. Setting this explicitly to `false` will disable port security. In order to disable port security, the port must not have any security groups. 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 port. If omitted, the `region` argument of the provider is used. Changing this creates a new port.
      • securityGroupIds

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> securityGroupIds()
        Returns:
        A list of security group IDs to apply to the port. The security groups must be specified by ID and not name (as opposed to how they are configured with the Compute Instance).
      • tags

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

        public com.pulumi.core.Output<java.lang.String> tenantId()
        Returns:
        The owner of the port. Required if admin wants to create a port for another tenant. Changing this creates a new port.
      • 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 Port get​(java.lang.String name,
                               com.pulumi.core.Output<java.lang.String> id,
                               @Nullable
                               PortState 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.