Class Trunk


  • public class Trunk
    extends com.pulumi.resources.CustomResource
    Manages a networking V2 trunk 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.networking.Port; import com.pulumi.openstack.networking.PortArgs; import com.pulumi.openstack.networking.Trunk; import com.pulumi.openstack.networking.TrunkArgs; import com.pulumi.openstack.networking.inputs.TrunkSubPortArgs; import com.pulumi.openstack.compute.Instance; import com.pulumi.openstack.compute.InstanceArgs; import com.pulumi.openstack.compute.inputs.InstanceNetworkArgs; import com.pulumi.resources.CustomResourceOptions; 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.1.0/24") .ipVersion(4) .enableDhcp(true) .noGateway(true) .build()); var parentPort1 = new Port("parentPort1", PortArgs.builder() .networkId(network1.id()) .adminStateUp("true") .build(), CustomResourceOptions.builder() .dependsOn("openstack_networking_subnet_v2.subnet_1") .build()); var subport1 = new Port("subport1", PortArgs.builder() .networkId(network1.id()) .adminStateUp("true") .build(), CustomResourceOptions.builder() .dependsOn("openstack_networking_subnet_v2.subnet_1") .build()); var trunk1 = new Trunk("trunk1", TrunkArgs.builder() .adminStateUp("true") .portId(parentPort1.id()) .subPorts(TrunkSubPortArgs.builder() .portId(subport1.id()) .segmentationId(1) .segmentationType("vlan") .build()) .build()); var instance1 = new Instance("instance1", InstanceArgs.builder() .securityGroups("default") .networks(InstanceNetworkArgs.builder() .port(trunk1.portId()) .build()) .build()); } } ```
    • 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
      Trunk​(java.lang.String name)  
      Trunk​(java.lang.String name, TrunkArgs args)  
      Trunk​(java.lang.String name, TrunkArgs 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.util.Optional<java.lang.Boolean>> adminStateUp()  
      com.pulumi.core.Output<java.util.List<java.lang.String>> allTags()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()  
      static Trunk get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, TrunkState 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> name()  
      com.pulumi.core.Output<java.lang.String> portId()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<TrunkSubPort>>> subPorts()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> tags()  
      com.pulumi.core.Output<java.lang.String> tenantId()  
      • 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

      • Trunk

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

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

        public Trunk​(java.lang.String name,
                     TrunkArgs 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.util.Optional<java.lang.Boolean>> adminStateUp()
        Returns:
        Administrative up/down status for the trunk (must be "true" or "false" if provided). Changing this updates the `admin_state_up` of an existing trunk.
      • allTags

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

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

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

        public com.pulumi.core.Output<java.lang.String> portId()
        Returns:
        The ID of the port to be used as the parent port of the trunk. This is the port that should be used as the compute instance network port. Changing this creates a new trunk.
      • 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 trunk. If omitted, the `region` argument of the provider is used. Changing this creates a new trunk.
      • subPorts

        public com.pulumi.core.Output<java.util.Optional<java.util.List<TrunkSubPort>>> subPorts()
        Returns:
        The set of ports that will be made subports of the trunk. The structure of each subport is described below.
      • 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 Trunk. Required if admin wants to create a trunk on behalf of another tenant. Changing this creates a new trunk.
      • get

        public static Trunk get​(java.lang.String name,
                                com.pulumi.core.Output<java.lang.String> id,
                                @Nullable
                                TrunkState 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.