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",
        }));
    }

}

Coming soon!

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",
}, { async: true }));

Using GetPort

function getPort(args: GetPortArgs, opts?: InvokeOptions): Promise<GetPortResult>
function  get_port(admin_state_up=None, description=None, device_id=None, device_owner=None, dns_name=None, fixed_ip=None, mac_address=None, name=None, network_id=None, port_id=None, project_id=None, region=None, security_group_ids=None, status=None, tags=None, tenant_id=None, opts=None)
func LookupPort(ctx *Context, args *LookupPortArgs, opts ...InvokeOption) (*LookupPortResult, error)

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

public static class GetPort {
    public static Task<GetPortResult> InvokeAsync(GetPortArgs args, InvokeOptions? opts = null)
}

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 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 List[str]

The list of port security group IDs to filter.

status str

The status of the port.

tags List[str]

The list of port tags to filter.

tenant_id str

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 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 List[str]

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

all_security_group_ids List[str]

The set of security group IDs applied on the port.

all_tags List[str]

The set of string tags applied on the port.

allowed_address_pairs 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.

dns_assignments List[Any>]

The list of maps representing port DNS assignments.

extra_dhcp_options List[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 List[str]
status str
tags List[str]
tenant_id str

Supporting Types

GetPortAllowedAddressPair

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

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.

GetPortBinding

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

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 {[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.

hostId str

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

profile str

A JSON string containing the binding profile information.

vifDetails Dict[str, Any]

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

vifType str

The VNIC type of the port binding.

vnicType str

VNIC type for the port.

GetPortExtraDhcpOption

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

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 number

IP protocol version

name string

The name of the port.

value string

Value of the DHCP option.

ip_version float

IP protocol version

name str

The name of the port.

value str

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.