OpenStack

Pulumi Official
Package maintained by Pulumi
v3.9.0 published on Thursday, Aug 4, 2022 by Pulumi

getPort

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

Example Usage

using Pulumi;
using OpenStack = Pulumi.OpenStack;

class MyStack : Stack
{
    public MyStack()
    {
        var port1 = Output.Create(OpenStack.Networking.GetPort.InvokeAsync(new OpenStack.Networking.GetPortArgs
        {
            Name = "port_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.LookupPort(ctx, &networking.LookupPortArgs{
			Name: pulumi.StringRef("port_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.GetPortArgs;
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 port1 = NetworkingFunctions.getPort(GetPortArgs.builder()
            .name("port_1")
            .build());

    }
}
import pulumi
import pulumi_openstack as openstack

port1 = openstack.networking.get_port(name="port_1")
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";

const port1 = pulumi.output(openstack.networking.getPort({
    name: "port_1",
}));
variables:
  port1:
    Fn::Invoke:
      Function: openstack:networking:getPort
      Arguments:
        name: port_1

Using getPort

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 getPort(args: GetPortArgs, opts?: InvokeOptions): Promise<GetPortResult>
function getPortOutput(args: GetPortOutputArgs, opts?: InvokeOptions): Output<GetPortResult>
def get_port(admin_state_up: Optional[bool] = None,
             description: Optional[str] = None,
             device_id: Optional[str] = None,
             device_owner: Optional[str] = None,
             dns_name: Optional[str] = None,
             fixed_ip: Optional[str] = None,
             mac_address: Optional[str] = None,
             name: Optional[str] = None,
             network_id: Optional[str] = None,
             port_id: Optional[str] = None,
             project_id: Optional[str] = None,
             region: Optional[str] = None,
             security_group_ids: Optional[Sequence[str]] = None,
             status: Optional[str] = None,
             tags: Optional[Sequence[str]] = None,
             tenant_id: Optional[str] = None,
             opts: Optional[InvokeOptions] = None) -> GetPortResult
def get_port_output(admin_state_up: Optional[pulumi.Input[bool]] = None,
             description: Optional[pulumi.Input[str]] = None,
             device_id: Optional[pulumi.Input[str]] = None,
             device_owner: Optional[pulumi.Input[str]] = None,
             dns_name: Optional[pulumi.Input[str]] = None,
             fixed_ip: Optional[pulumi.Input[str]] = None,
             mac_address: Optional[pulumi.Input[str]] = None,
             name: Optional[pulumi.Input[str]] = None,
             network_id: 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,
             security_group_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
             status: Optional[pulumi.Input[str]] = None,
             tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
             tenant_id: Optional[pulumi.Input[str]] = None,
             opts: Optional[InvokeOptions] = None) -> Output[GetPortResult]
func LookupPort(ctx *Context, args *LookupPortArgs, opts ...InvokeOption) (*LookupPortResult, error)
func LookupPortOutput(ctx *Context, args *LookupPortOutputArgs, opts ...InvokeOption) LookupPortResultOutput

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

public static class GetPort 
{
    public static Task<GetPortResult> InvokeAsync(GetPortArgs args, InvokeOptions? opts = null)
    public static Output<GetPortResult> Invoke(GetPortInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetPortResult> getPort(GetPortArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: openstack:networking/getPort:getPort
  Arguments:
    # Arguments dictionary

The following arguments are supported:

AdminStateUp bool

The administrative state of the port.

Description string

Human-readable description of the port.

DeviceId string

The ID of the device the port belongs to.

DeviceOwner string

The device owner of the port.

DnsName string

The port DNS name to filter. Available, when Neutron DNS extension is enabled.

FixedIp string

The port IP address filter.

MacAddress string

The MAC address of the port.

Name string

The name of the port.

NetworkId string

The ID of the network the port belongs to.

PortId string

The ID of the port.

ProjectId string

The owner of the port.

Region string

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

SecurityGroupIds List<string>

The list of port security group IDs to filter.

Status string

The status of the port.

Tags List<string>

The list of port tags to filter.

TenantId string
AdminStateUp bool

The administrative state of the port.

Description string

Human-readable description of the port.

DeviceId string

The ID of the device the port belongs to.

DeviceOwner string

The device owner of the port.

DnsName string

The port DNS name to filter. Available, when Neutron DNS extension is enabled.

FixedIp string

The port IP address filter.

MacAddress string

The MAC address of the port.

Name string

The name of the port.

NetworkId string

The ID of the network the port belongs to.

PortId string

The ID of the port.

ProjectId string

The owner of the port.

Region string

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

SecurityGroupIds []string

The list of port security group IDs to filter.

Status string

The status of the port.

Tags []string

The list of port tags to filter.

TenantId string
adminStateUp Boolean

The administrative state of the port.

description String

Human-readable description of the port.

deviceId String

The ID of the device the port belongs to.

deviceOwner String

The device owner of the port.

dnsName String

The port DNS name to filter. Available, when Neutron DNS extension is enabled.

fixedIp String

The port IP address filter.

macAddress String

The MAC address of the port.

name String

The name of the port.

networkId String

The ID of the network the port belongs to.

portId String

The ID of the port.

projectId String

The owner of the port.

region String

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

securityGroupIds List<String>

The list of port security group IDs to filter.

status String

The status of the port.

tags List<String>

The list of port tags to filter.

tenantId String
adminStateUp boolean

The administrative state of the port.

description string

Human-readable description of the port.

deviceId string

The ID of the device the port belongs to.

deviceOwner string

The device owner of the port.

dnsName string

The port DNS name to filter. Available, when Neutron DNS extension is enabled.

fixedIp string

The port IP address filter.

macAddress string

The MAC address of the port.

name string

The name of the port.

networkId string

The ID of the network the port belongs to.

portId string

The ID of the port.

projectId string

The owner of the port.

region string

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

securityGroupIds string[]

The list of port security group IDs to filter.

status string

The status of the port.

tags string[]

The list of port tags to filter.

tenantId string
admin_state_up bool

The administrative state of the port.

description str

Human-readable description of the port.

device_id str

The ID of the device the port belongs to.

device_owner str

The device owner of the port.

dns_name str

The port DNS name to filter. Available, when Neutron DNS extension is enabled.

fixed_ip str

The port IP address filter.

mac_address str

The MAC address of the port.

name str

The name of the port.

network_id str

The ID of the network the port belongs to.

port_id str

The ID of the port.

project_id str

The owner of the port.

region str

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

security_group_ids Sequence[str]

The list of port security group IDs to filter.

status str

The status of the port.

tags Sequence[str]

The list of port tags to filter.

tenant_id str
adminStateUp Boolean

The administrative state of the port.

description String

Human-readable description of the port.

deviceId String

The ID of the device the port belongs to.

deviceOwner String

The device owner of the port.

dnsName String

The port DNS name to filter. Available, when Neutron DNS extension is enabled.

fixedIp String

The port IP address filter.

macAddress String

The MAC address of the port.

name String

The name of the port.

networkId String

The ID of the network the port belongs to.

portId String

The ID of the port.

projectId String

The owner of the port.

region String

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

securityGroupIds List<String>

The list of port security group IDs to filter.

status String

The status of the port.

tags List<String>

The list of port tags to filter.

tenantId String

getPort Result

The following output properties are available:

AllFixedIps List<string>

The collection of Fixed IP addresses on the port in the order returned by the Network v2 API.

AllSecurityGroupIds List<string>

The set of security group IDs applied on the port.

AllTags List<string>

The set of string tags applied on the port.

AllowedAddressPairs List<Pulumi.OpenStack.Networking.Outputs.GetPortAllowedAddressPair>

An IP/MAC Address pair of additional IP addresses that can be active on this port. The structure is described below.

Bindings List<Pulumi.OpenStack.Networking.Outputs.GetPortBinding>

The port binding information. The structure is described below.

DnsAssignments List<ImmutableDictionary<string, object>>

The list of maps representing port DNS assignments.

ExtraDhcpOptions List<Pulumi.OpenStack.Networking.Outputs.GetPortExtraDhcpOption>

An extra DHCP option configured on the port. The structure is described below.

Id string

The provider-assigned unique ID for this managed resource.

AdminStateUp bool

See Argument Reference above.

Description string

See Argument Reference above.

DeviceId string

See Argument Reference above.

DeviceOwner string

See Argument Reference above.

DnsName string

See Argument Reference above.

FixedIp string
MacAddress string

The additional MAC address.

Name string

Name of the DHCP option.

NetworkId string

See Argument Reference above.

PortId string

See Argument Reference above.

ProjectId string

See Argument Reference above.

Region string

See Argument Reference above.

SecurityGroupIds List<string>
Status string
Tags List<string>
TenantId string
AllFixedIps []string

The collection of Fixed IP addresses on the port in the order returned by the Network v2 API.

AllSecurityGroupIds []string

The set of security group IDs applied on the port.

AllTags []string

The set of string tags applied on the port.

AllowedAddressPairs []GetPortAllowedAddressPair

An IP/MAC Address pair of additional IP addresses that can be active on this port. The structure is described below.

Bindings []GetPortBinding

The port binding information. The structure is described below.

DnsAssignments []map[string]interface{}

The list of maps representing port DNS assignments.

ExtraDhcpOptions []GetPortExtraDhcpOption

An extra DHCP option configured on the port. The structure is described below.

Id string

The provider-assigned unique ID for this managed resource.

AdminStateUp bool

See Argument Reference above.

Description string

See Argument Reference above.

DeviceId string

See Argument Reference above.

DeviceOwner string

See Argument Reference above.

DnsName string

See Argument Reference above.

FixedIp string
MacAddress string

The additional MAC address.

Name string

Name of the DHCP option.

NetworkId string

See Argument Reference above.

PortId string

See Argument Reference above.

ProjectId string

See Argument Reference above.

Region string

See Argument Reference above.

SecurityGroupIds []string
Status string
Tags []string
TenantId string
allFixedIps List<String>

The collection of Fixed IP addresses on the port in the order returned by the Network v2 API.

allSecurityGroupIds List<String>

The set of security group IDs applied on the port.

allTags List<String>

The set of string tags applied on the port.

allowedAddressPairs List<GetPortAllowedAddressPair>

An IP/MAC Address pair of additional IP addresses that can be active on this port. The structure is described below.

bindings List<GetPortBinding>

The port binding information. The structure is described below.

dnsAssignments List<Map<String,Object>>

The list of maps representing port DNS assignments.

extraDhcpOptions List<GetPortExtraDhcpOption>

An extra DHCP option configured on the port. The structure is described below.

id String

The provider-assigned unique ID for this managed resource.

adminStateUp Boolean

See Argument Reference above.

description String

See Argument Reference above.

deviceId String

See Argument Reference above.

deviceOwner String

See Argument Reference above.

dnsName String

See Argument Reference above.

fixedIp String
macAddress String

The additional MAC address.

name String

Name of the DHCP option.

networkId String

See Argument Reference above.

portId String

See Argument Reference above.

projectId String

See Argument Reference above.

region String

See Argument Reference above.

securityGroupIds List<String>
status String
tags List<String>
tenantId String
allFixedIps string[]

The collection of Fixed IP addresses on the port in the order returned by the Network v2 API.

allSecurityGroupIds string[]

The set of security group IDs applied on the port.

allTags string[]

The set of string tags applied on the port.

allowedAddressPairs GetPortAllowedAddressPair[]

An IP/MAC Address pair of additional IP addresses that can be active on this port. The structure is described below.

bindings GetPortBinding[]

The port binding information. The structure is described below.

dnsAssignments {[key: string]: any}[]

The list of maps representing port DNS assignments.

extraDhcpOptions GetPortExtraDhcpOption[]

An extra DHCP option configured on the port. The structure is described below.

id string

The provider-assigned unique ID for this managed resource.

adminStateUp boolean

See Argument Reference above.

description string

See Argument Reference above.

deviceId string

See Argument Reference above.

deviceOwner string

See Argument Reference above.

dnsName string

See Argument Reference above.

fixedIp string
macAddress string

The additional MAC address.

name string

Name of the DHCP option.

networkId string

See Argument Reference above.

portId string

See Argument Reference above.

projectId string

See Argument Reference above.

region string

See Argument Reference above.

securityGroupIds string[]
status string
tags string[]
tenantId string
all_fixed_ips Sequence[str]

The collection of Fixed IP addresses on the port in the order returned by the Network v2 API.

all_security_group_ids Sequence[str]

The set of security group IDs applied on the port.

all_tags Sequence[str]

The set of string tags applied on the port.

allowed_address_pairs Sequence[GetPortAllowedAddressPair]

An IP/MAC Address pair of additional IP addresses that can be active on this port. The structure is described below.

bindings Sequence[GetPortBinding]

The port binding information. The structure is described below.

dns_assignments Sequence[Mapping[str, Any]]

The list of maps representing port DNS assignments.

extra_dhcp_options Sequence[GetPortExtraDhcpOption]

An extra DHCP option configured on the port. The structure is described below.

id str

The provider-assigned unique ID for this managed resource.

admin_state_up bool

See Argument Reference above.

description str

See Argument Reference above.

device_id str

See Argument Reference above.

device_owner str

See Argument Reference above.

dns_name str

See Argument Reference above.

fixed_ip str
mac_address str

The additional MAC address.

name str

Name of the DHCP option.

network_id str

See Argument Reference above.

port_id str

See Argument Reference above.

project_id str

See Argument Reference above.

region str

See Argument Reference above.

security_group_ids Sequence[str]
status str
tags Sequence[str]
tenant_id str
allFixedIps List<String>

The collection of Fixed IP addresses on the port in the order returned by the Network v2 API.

allSecurityGroupIds List<String>

The set of security group IDs applied on the port.

allTags List<String>

The set of string tags applied on the port.

allowedAddressPairs List<Property Map>

An IP/MAC Address pair of additional IP addresses that can be active on this port. The structure is described below.

bindings List<Property Map>

The port binding information. The structure is described below.

dnsAssignments List<Map<Any>>

The list of maps representing port DNS assignments.

extraDhcpOptions List<Property Map>

An extra DHCP option configured on the port. The structure is described below.

id String

The provider-assigned unique ID for this managed resource.

adminStateUp Boolean

See Argument Reference above.

description String

See Argument Reference above.

deviceId String

See Argument Reference above.

deviceOwner String

See Argument Reference above.

dnsName String

See Argument Reference above.

fixedIp String
macAddress String

The additional MAC address.

name String

Name of the DHCP option.

networkId String

See Argument Reference above.

portId String

See Argument Reference above.

projectId String

See Argument Reference above.

region String

See Argument Reference above.

securityGroupIds List<String>
status String
tags List<String>
tenantId String

Supporting Types

GetPortAllowedAddressPair

IpAddress string

The additional IP address.

MacAddress string

The MAC address of the port.

IpAddress string

The additional IP address.

MacAddress string

The MAC address of the port.

ipAddress String

The additional IP address.

macAddress String

The MAC address of the port.

ipAddress string

The additional IP address.

macAddress string

The MAC address of the port.

ip_address str

The additional IP address.

mac_address str

The MAC address of the port.

ipAddress String

The additional IP address.

macAddress String

The MAC address of the port.

GetPortBinding

HostId string

The ID of the host, which has the allocatee port.

Profile string

A JSON string containing the binding profile information.

VifDetails Dictionary<string, object>

A map of JSON strings containing additional details for this specific binding.

VifType string

The VNIC type of the port binding.

VnicType string

VNIC type for the port.

HostId string

The ID of the host, which has the allocatee port.

Profile string

A JSON string containing the binding profile information.

VifDetails map[string]interface{}

A map of JSON strings containing additional details for this specific binding.

VifType string

The VNIC type of the port binding.

VnicType string

VNIC type for the port.

hostId String

The ID of the host, which has the allocatee port.

profile String

A JSON string containing the binding profile information.

vifDetails Map<String,Object>

A map of JSON strings containing additional details for this specific binding.

vifType String

The VNIC type of the port binding.

vnicType String

VNIC type for the port.

hostId string

The ID of the host, which has the allocatee port.

profile string

A JSON string containing the binding profile information.

vifDetails {[key: string]: any}

A map of JSON strings containing additional details for this specific binding.

vifType string

The VNIC type of the port binding.

vnicType string

VNIC type for the port.

host_id str

The ID of the host, which has the allocatee port.

profile str

A JSON string containing the binding profile information.

vif_details Mapping[str, Any]

A map of JSON strings containing additional details for this specific binding.

vif_type str

The VNIC type of the port binding.

vnic_type str

VNIC type for the port.

hostId String

The ID of the host, which has the allocatee port.

profile String

A JSON string containing the binding profile information.

vifDetails Map<Any>

A map of JSON strings containing additional details for this specific binding.

vifType String

The VNIC type of the port binding.

vnicType String

VNIC type for the port.

GetPortExtraDhcpOption

IpVersion int

IP protocol version

Name string

The name of the port.

Value string

Value of the DHCP option.

IpVersion int

IP protocol version

Name string

The name of the port.

Value string

Value of the DHCP option.

ipVersion Integer

IP protocol version

name String

The name of the port.

value String

Value of the DHCP option.

ipVersion number

IP protocol version

name string

The name of the port.

value string

Value of the DHCP option.

ip_version int

IP protocol version

name str

The name of the port.

value str

Value of the DHCP option.

ipVersion Number

IP protocol version

name String

The name of the port.

value String

Value of the DHCP option.

Package Details

Repository
https://github.com/pulumi/pulumi-openstack
License
Apache-2.0
Notes

This Pulumi package is based on the openstack Terraform Provider.