openstack logo
OpenStack v3.12.1, Mar 23 23

openstack.networking.getTrunk

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

Example Usage

using System.Collections.Generic;
using Pulumi;
using OpenStack = Pulumi.OpenStack;

return await Deployment.RunAsync(() => 
{
    var trunk1 = OpenStack.Networking.GetTrunk.Invoke(new()
    {
        Name = "trunk_1",
    });

});
package main

import (
	"github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/networking"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := networking.LookupTrunk(ctx, &networking.LookupTrunkArgs{
			Name: pulumi.StringRef("trunk_1"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
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.GetTrunkArgs;
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 trunk1 = NetworkingFunctions.getTrunk(GetTrunkArgs.builder()
            .name("trunk_1")
            .build());

    }
}
import pulumi
import pulumi_openstack as openstack

trunk1 = openstack.networking.get_trunk(name="trunk_1")
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";

const trunk1 = openstack.networking.getTrunk({
    name: "trunk_1",
});
variables:
  trunk1:
    fn::invoke:
      Function: openstack:networking:getTrunk
      Arguments:
        name: trunk_1

Using getTrunk

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 getTrunk(args: GetTrunkArgs, opts?: InvokeOptions): Promise<GetTrunkResult>
function getTrunkOutput(args: GetTrunkOutputArgs, opts?: InvokeOptions): Output<GetTrunkResult>
def get_trunk(admin_state_up: Optional[bool] = None,
              description: Optional[str] = None,
              name: Optional[str] = None,
              port_id: Optional[str] = None,
              project_id: Optional[str] = None,
              region: Optional[str] = None,
              status: Optional[str] = None,
              tags: Optional[Sequence[str]] = None,
              trunk_id: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetTrunkResult
def get_trunk_output(admin_state_up: Optional[pulumi.Input[bool]] = None,
              description: Optional[pulumi.Input[str]] = None,
              name: Optional[pulumi.Input[str]] = None,
              port_id: Optional[pulumi.Input[str]] = None,
              project_id: Optional[pulumi.Input[str]] = None,
              region: Optional[pulumi.Input[str]] = None,
              status: Optional[pulumi.Input[str]] = None,
              tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
              trunk_id: Optional[pulumi.Input[str]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetTrunkResult]
func LookupTrunk(ctx *Context, args *LookupTrunkArgs, opts ...InvokeOption) (*LookupTrunkResult, error)
func LookupTrunkOutput(ctx *Context, args *LookupTrunkOutputArgs, opts ...InvokeOption) LookupTrunkResultOutput

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

public static class GetTrunk 
{
    public static Task<GetTrunkResult> InvokeAsync(GetTrunkArgs args, InvokeOptions? opts = null)
    public static Output<GetTrunkResult> Invoke(GetTrunkInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetTrunkResult> getTrunk(GetTrunkArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: openstack:networking/getTrunk:getTrunk
  arguments:
    # arguments dictionary

The following arguments are supported:

AdminStateUp bool

The administrative state of the trunk.

Description string

Human-readable description of the trunk.

Name string

The name of the trunk.

PortId string

The ID of the trunk parent port.

ProjectId string

The owner of the trunk.

Region string

The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve trunk ids. If omitted, the region argument of the provider is used.

Status string

The status of the trunk.

Tags List<string>

The list of trunk tags to filter.

TrunkId string

The ID of the trunk.

AdminStateUp bool

The administrative state of the trunk.

Description string

Human-readable description of the trunk.

Name string

The name of the trunk.

PortId string

The ID of the trunk parent port.

ProjectId string

The owner of the trunk.

Region string

The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve trunk ids. If omitted, the region argument of the provider is used.

Status string

The status of the trunk.

Tags []string

The list of trunk tags to filter.

TrunkId string

The ID of the trunk.

adminStateUp Boolean

The administrative state of the trunk.

description String

Human-readable description of the trunk.

name String

The name of the trunk.

portId String

The ID of the trunk parent port.

projectId String

The owner of the trunk.

region String

The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve trunk ids. If omitted, the region argument of the provider is used.

status String

The status of the trunk.

tags List<String>

The list of trunk tags to filter.

trunkId String

The ID of the trunk.

adminStateUp boolean

The administrative state of the trunk.

description string

Human-readable description of the trunk.

name string

The name of the trunk.

portId string

The ID of the trunk parent port.

projectId string

The owner of the trunk.

region string

The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve trunk ids. If omitted, the region argument of the provider is used.

status string

The status of the trunk.

tags string[]

The list of trunk tags to filter.

trunkId string

The ID of the trunk.

admin_state_up bool

The administrative state of the trunk.

description str

Human-readable description of the trunk.

name str

The name of the trunk.

port_id str

The ID of the trunk parent port.

project_id str

The owner of the trunk.

region str

The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve trunk ids. If omitted, the region argument of the provider is used.

status str

The status of the trunk.

tags Sequence[str]

The list of trunk tags to filter.

trunk_id str

The ID of the trunk.

adminStateUp Boolean

The administrative state of the trunk.

description String

Human-readable description of the trunk.

name String

The name of the trunk.

portId String

The ID of the trunk parent port.

projectId String

The owner of the trunk.

region String

The region in which to obtain the V2 Neutron client. A Neutron client is needed to retrieve trunk ids. If omitted, the region argument of the provider is used.

status String

The status of the trunk.

tags List<String>

The list of trunk tags to filter.

trunkId String

The ID of the trunk.

getTrunk Result

The following output properties are available:

AllTags List<string>

The set of string tags applied on the trunk.

Id string

The provider-assigned unique ID for this managed resource.

ProjectId string
Region string
SubPorts List<Pulumi.OpenStack.Networking.Outputs.GetTrunkSubPort>

The set of the trunk subports. The structure of each subport is described below.

AdminStateUp bool
Description string
Name string
PortId string

The ID of the trunk subport.

Status string
Tags List<string>
TrunkId string
AllTags []string

The set of string tags applied on the trunk.

Id string

The provider-assigned unique ID for this managed resource.

ProjectId string
Region string
SubPorts []GetTrunkSubPort

The set of the trunk subports. The structure of each subport is described below.

AdminStateUp bool
Description string
Name string
PortId string

The ID of the trunk subport.

Status string
Tags []string
TrunkId string
allTags List<String>

The set of string tags applied on the trunk.

id String

The provider-assigned unique ID for this managed resource.

projectId String
region String
subPorts List<GetTrunkSubPort>

The set of the trunk subports. The structure of each subport is described below.

adminStateUp Boolean
description String
name String
portId String

The ID of the trunk subport.

status String
tags List<String>
trunkId String
allTags string[]

The set of string tags applied on the trunk.

id string

The provider-assigned unique ID for this managed resource.

projectId string
region string
subPorts GetTrunkSubPort[]

The set of the trunk subports. The structure of each subport is described below.

adminStateUp boolean
description string
name string
portId string

The ID of the trunk subport.

status string
tags string[]
trunkId string
all_tags Sequence[str]

The set of string tags applied on the trunk.

id str

The provider-assigned unique ID for this managed resource.

project_id str
region str
sub_ports Sequence[GetTrunkSubPort]

The set of the trunk subports. The structure of each subport is described below.

admin_state_up bool
description str
name str
port_id str

The ID of the trunk subport.

status str
tags Sequence[str]
trunk_id str
allTags List<String>

The set of string tags applied on the trunk.

id String

The provider-assigned unique ID for this managed resource.

projectId String
region String
subPorts List<Property Map>

The set of the trunk subports. The structure of each subport is described below.

adminStateUp Boolean
description String
name String
portId String

The ID of the trunk subport.

status String
tags List<String>
trunkId String

Supporting Types

GetTrunkSubPort

PortId string

The ID of the trunk parent port.

SegmentationId int

The numeric id of the subport segment.

SegmentationType string

The segmenation tecnology used, e.g., "vlan".

PortId string

The ID of the trunk parent port.

SegmentationId int

The numeric id of the subport segment.

SegmentationType string

The segmenation tecnology used, e.g., "vlan".

portId String

The ID of the trunk parent port.

segmentationId Integer

The numeric id of the subport segment.

segmentationType String

The segmenation tecnology used, e.g., "vlan".

portId string

The ID of the trunk parent port.

segmentationId number

The numeric id of the subport segment.

segmentationType string

The segmenation tecnology used, e.g., "vlan".

port_id str

The ID of the trunk parent port.

segmentation_id int

The numeric id of the subport segment.

segmentation_type str

The segmenation tecnology used, e.g., "vlan".

portId String

The ID of the trunk parent port.

segmentationId Number

The numeric id of the subport segment.

segmentationType String

The segmenation tecnology used, e.g., "vlan".

Package Details

Repository
OpenStack pulumi/pulumi-openstack
License
Apache-2.0
Notes

This Pulumi package is based on the openstack Terraform Provider.