1. Packages
  2. Openstack Provider
  3. API Docs
  4. networking
  5. getSegmentV2
OpenStack v5.3.2 published on Friday, Jul 18, 2025 by Pulumi

openstack.networking.getSegmentV2

Explore with Pulumi AI

openstack logo
OpenStack v5.3.2 published on Friday, Jul 18, 2025 by Pulumi

    Use this data source to get the ID of an available OpenStack network.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as openstack from "@pulumi/openstack";
    
    const network = openstack.networking.getSegmentV2({
        name: "tf_test_segment",
    });
    
    import pulumi
    import pulumi_openstack as openstack
    
    network = openstack.networking.get_segment_v2(name="tf_test_segment")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-openstack/sdk/v5/go/openstack/networking"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := networking.LookupSegmentV2(ctx, &networking.LookupSegmentV2Args{
    			Name: pulumi.StringRef("tf_test_segment"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using OpenStack = Pulumi.OpenStack;
    
    return await Deployment.RunAsync(() => 
    {
        var network = OpenStack.Networking.GetSegmentV2.Invoke(new()
        {
            Name = "tf_test_segment",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.openstack.networking.NetworkingFunctions;
    import com.pulumi.openstack.networking.inputs.GetSegmentV2Args;
    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) {
            final var network = NetworkingFunctions.getSegmentV2(GetSegmentV2Args.builder()
                .name("tf_test_segment")
                .build());
    
        }
    }
    
    variables:
      network:
        fn::invoke:
          function: openstack:networking:getSegmentV2
          arguments:
            name: tf_test_segment
    

    Using getSegmentV2

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getSegmentV2(args: GetSegmentV2Args, opts?: InvokeOptions): Promise<GetSegmentV2Result>
    function getSegmentV2Output(args: GetSegmentV2OutputArgs, opts?: InvokeOptions): Output<GetSegmentV2Result>
    def get_segment_v2(description: Optional[str] = None,
                       name: Optional[str] = None,
                       network_id: Optional[str] = None,
                       network_type: Optional[str] = None,
                       physical_network: Optional[str] = None,
                       region: Optional[str] = None,
                       revision_number: Optional[int] = None,
                       segment_id: Optional[str] = None,
                       segmentation_id: Optional[int] = None,
                       opts: Optional[InvokeOptions] = None) -> GetSegmentV2Result
    def get_segment_v2_output(description: Optional[pulumi.Input[str]] = None,
                       name: Optional[pulumi.Input[str]] = None,
                       network_id: Optional[pulumi.Input[str]] = None,
                       network_type: Optional[pulumi.Input[str]] = None,
                       physical_network: Optional[pulumi.Input[str]] = None,
                       region: Optional[pulumi.Input[str]] = None,
                       revision_number: Optional[pulumi.Input[int]] = None,
                       segment_id: Optional[pulumi.Input[str]] = None,
                       segmentation_id: Optional[pulumi.Input[int]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetSegmentV2Result]
    func LookupSegmentV2(ctx *Context, args *LookupSegmentV2Args, opts ...InvokeOption) (*LookupSegmentV2Result, error)
    func LookupSegmentV2Output(ctx *Context, args *LookupSegmentV2OutputArgs, opts ...InvokeOption) LookupSegmentV2ResultOutput

    > Note: This function is named LookupSegmentV2 in the Go SDK.

    public static class GetSegmentV2 
    {
        public static Task<GetSegmentV2Result> InvokeAsync(GetSegmentV2Args args, InvokeOptions? opts = null)
        public static Output<GetSegmentV2Result> Invoke(GetSegmentV2InvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSegmentV2Result> getSegmentV2(GetSegmentV2Args args, InvokeOptions options)
    public static Output<GetSegmentV2Result> getSegmentV2(GetSegmentV2Args args, InvokeOptions options)
    
    fn::invoke:
      function: openstack:networking/getSegmentV2:getSegmentV2
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Description string
    Human-readable description of the network segment.
    Name string
    The name of the network segment.
    NetworkId string
    The ID of the network.
    NetworkType string
    The type of the network, such as vlan, vxlan, flat, gre, geneve, or local.
    PhysicalNetwork string
    The name of the physical network.
    Region string
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve networks ids. If omitted, the region argument of the provider is used.
    RevisionNumber int
    See Argument Reference above.
    SegmentId string
    The ID of the network segment
    SegmentationId int
    The segmentation ID of the network segment.
    Description string
    Human-readable description of the network segment.
    Name string
    The name of the network segment.
    NetworkId string
    The ID of the network.
    NetworkType string
    The type of the network, such as vlan, vxlan, flat, gre, geneve, or local.
    PhysicalNetwork string
    The name of the physical network.
    Region string
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve networks ids. If omitted, the region argument of the provider is used.
    RevisionNumber int
    See Argument Reference above.
    SegmentId string
    The ID of the network segment
    SegmentationId int
    The segmentation ID of the network segment.
    description String
    Human-readable description of the network segment.
    name String
    The name of the network segment.
    networkId String
    The ID of the network.
    networkType String
    The type of the network, such as vlan, vxlan, flat, gre, geneve, or local.
    physicalNetwork String
    The name of the physical network.
    region String
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve networks ids. If omitted, the region argument of the provider is used.
    revisionNumber Integer
    See Argument Reference above.
    segmentId String
    The ID of the network segment
    segmentationId Integer
    The segmentation ID of the network segment.
    description string
    Human-readable description of the network segment.
    name string
    The name of the network segment.
    networkId string
    The ID of the network.
    networkType string
    The type of the network, such as vlan, vxlan, flat, gre, geneve, or local.
    physicalNetwork string
    The name of the physical network.
    region string
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve networks ids. If omitted, the region argument of the provider is used.
    revisionNumber number
    See Argument Reference above.
    segmentId string
    The ID of the network segment
    segmentationId number
    The segmentation ID of the network segment.
    description str
    Human-readable description of the network segment.
    name str
    The name of the network segment.
    network_id str
    The ID of the network.
    network_type str
    The type of the network, such as vlan, vxlan, flat, gre, geneve, or local.
    physical_network str
    The name of the physical network.
    region str
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve networks ids. If omitted, the region argument of the provider is used.
    revision_number int
    See Argument Reference above.
    segment_id str
    The ID of the network segment
    segmentation_id int
    The segmentation ID of the network segment.
    description String
    Human-readable description of the network segment.
    name String
    The name of the network segment.
    networkId String
    The ID of the network.
    networkType String
    The type of the network, such as vlan, vxlan, flat, gre, geneve, or local.
    physicalNetwork String
    The name of the physical network.
    region String
    The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve networks ids. If omitted, the region argument of the provider is used.
    revisionNumber Number
    See Argument Reference above.
    segmentId String
    The ID of the network segment
    segmentationId Number
    The segmentation ID of the network segment.

    getSegmentV2 Result

    The following output properties are available:

    CreatedAt string
    The date and time when the network segment was created.
    Description string
    See Argument Reference above.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    See Argument Reference above.
    NetworkId string
    See Argument Reference above.
    NetworkType string
    See Argument Reference above.
    PhysicalNetwork string
    See Argument Reference above.
    Region string
    RevisionNumber int
    See Argument Reference above.
    SegmentId string
    See Argument Reference above.
    SegmentationId int
    See Argument Reference above.
    UpdatedAt string
    The date and time when the network segment was last updated.
    CreatedAt string
    The date and time when the network segment was created.
    Description string
    See Argument Reference above.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    See Argument Reference above.
    NetworkId string
    See Argument Reference above.
    NetworkType string
    See Argument Reference above.
    PhysicalNetwork string
    See Argument Reference above.
    Region string
    RevisionNumber int
    See Argument Reference above.
    SegmentId string
    See Argument Reference above.
    SegmentationId int
    See Argument Reference above.
    UpdatedAt string
    The date and time when the network segment was last updated.
    createdAt String
    The date and time when the network segment was created.
    description String
    See Argument Reference above.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    See Argument Reference above.
    networkId String
    See Argument Reference above.
    networkType String
    See Argument Reference above.
    physicalNetwork String
    See Argument Reference above.
    region String
    revisionNumber Integer
    See Argument Reference above.
    segmentId String
    See Argument Reference above.
    segmentationId Integer
    See Argument Reference above.
    updatedAt String
    The date and time when the network segment was last updated.
    createdAt string
    The date and time when the network segment was created.
    description string
    See Argument Reference above.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    See Argument Reference above.
    networkId string
    See Argument Reference above.
    networkType string
    See Argument Reference above.
    physicalNetwork string
    See Argument Reference above.
    region string
    revisionNumber number
    See Argument Reference above.
    segmentId string
    See Argument Reference above.
    segmentationId number
    See Argument Reference above.
    updatedAt string
    The date and time when the network segment was last updated.
    created_at str
    The date and time when the network segment was created.
    description str
    See Argument Reference above.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    See Argument Reference above.
    network_id str
    See Argument Reference above.
    network_type str
    See Argument Reference above.
    physical_network str
    See Argument Reference above.
    region str
    revision_number int
    See Argument Reference above.
    segment_id str
    See Argument Reference above.
    segmentation_id int
    See Argument Reference above.
    updated_at str
    The date and time when the network segment was last updated.
    createdAt String
    The date and time when the network segment was created.
    description String
    See Argument Reference above.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    See Argument Reference above.
    networkId String
    See Argument Reference above.
    networkType String
    See Argument Reference above.
    physicalNetwork String
    See Argument Reference above.
    region String
    revisionNumber Number
    See Argument Reference above.
    segmentId String
    See Argument Reference above.
    segmentationId Number
    See Argument Reference above.
    updatedAt String
    The date and time when the network segment was last updated.

    Package Details

    Repository
    OpenStack pulumi/pulumi-openstack
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the openstack Terraform Provider.
    openstack logo
    OpenStack v5.3.2 published on Friday, Jul 18, 2025 by Pulumi