1. Packages
  2. Openstack Provider
  3. API Docs
  4. networking
  5. getPortIds
OpenStack v5.0.3 published on Wednesday, Feb 12, 2025 by Pulumi

openstack.networking.getPortIds

Explore with Pulumi AI

OpenStack v5.0.3 published on Wednesday, Feb 12, 2025 by Pulumi

Use this data source to get a list of Openstack Port IDs matching the specified criteria.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";

const ports = openstack.networking.getPortIds({
    name: "port",
});
Copy
import pulumi
import pulumi_openstack as openstack

ports = openstack.networking.get_port_ids(name="port")
Copy
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.GetPortIds(ctx, &networking.GetPortIdsArgs{
			Name: pulumi.StringRef("port"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using OpenStack = Pulumi.OpenStack;

return await Deployment.RunAsync(() => 
{
    var ports = OpenStack.Networking.GetPortIds.Invoke(new()
    {
        Name = "port",
    });

});
Copy
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.GetPortIdsArgs;
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 ports = NetworkingFunctions.getPortIds(GetPortIdsArgs.builder()
            .name("port")
            .build());

    }
}
Copy
variables:
  ports:
    fn::invoke:
      function: openstack:networking:getPortIds
      arguments:
        name: port
Copy

Using getPortIds

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 getPortIds(args: GetPortIdsArgs, opts?: InvokeOptions): Promise<GetPortIdsResult>
function getPortIdsOutput(args: GetPortIdsOutputArgs, opts?: InvokeOptions): Output<GetPortIdsResult>
Copy
def get_port_ids(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,
                 project_id: Optional[str] = None,
                 region: Optional[str] = None,
                 security_group_ids: Optional[Sequence[str]] = None,
                 sort_direction: Optional[str] = None,
                 sort_key: Optional[str] = None,
                 status: Optional[str] = None,
                 tags: Optional[Sequence[str]] = None,
                 tenant_id: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetPortIdsResult
def get_port_ids_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,
                 project_id: Optional[pulumi.Input[str]] = None,
                 region: Optional[pulumi.Input[str]] = None,
                 security_group_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 sort_direction: Optional[pulumi.Input[str]] = None,
                 sort_key: Optional[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[GetPortIdsResult]
Copy
func GetPortIds(ctx *Context, args *GetPortIdsArgs, opts ...InvokeOption) (*GetPortIdsResult, error)
func GetPortIdsOutput(ctx *Context, args *GetPortIdsOutputArgs, opts ...InvokeOption) GetPortIdsResultOutput
Copy

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

public static class GetPortIds 
{
    public static Task<GetPortIdsResult> InvokeAsync(GetPortIdsArgs args, InvokeOptions? opts = null)
    public static Output<GetPortIdsResult> Invoke(GetPortIdsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetPortIdsResult> getPortIds(GetPortIdsArgs args, InvokeOptions options)
public static Output<GetPortIdsResult> getPortIds(GetPortIdsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: openstack:networking/getPortIds:getPortIds
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

AdminStateUp Changes to this property will trigger replacement. bool
The administrative state of the port.
Description Changes to this property will trigger replacement. string
Human-readable description of the port.
DeviceId Changes to this property will trigger replacement. string
The ID of the device the port belongs to.
DeviceOwner Changes to this property will trigger replacement. string
The device owner of the port.
DnsName Changes to this property will trigger replacement. string
FixedIp Changes to this property will trigger replacement. string
The port IP address filter.
MacAddress Changes to this property will trigger replacement. string
The MAC address of the port.
Name Changes to this property will trigger replacement. string
The name of the port.
NetworkId Changes to this property will trigger replacement. string
The ID of the network the port belongs to.
ProjectId Changes to this property will trigger replacement. string
The owner of the port.
Region Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<string>
The list of port security group IDs to filter.
SortDirection Changes to this property will trigger replacement. string
Order the results in either asc or desc. Defaults to none.
SortKey Changes to this property will trigger replacement. string
Sort ports based on a certain key. Defaults to none.
Status Changes to this property will trigger replacement. string
The status of the port.
Tags Changes to this property will trigger replacement. List<string>
The list of port tags to filter.
TenantId Changes to this property will trigger replacement. string
AdminStateUp Changes to this property will trigger replacement. bool
The administrative state of the port.
Description Changes to this property will trigger replacement. string
Human-readable description of the port.
DeviceId Changes to this property will trigger replacement. string
The ID of the device the port belongs to.
DeviceOwner Changes to this property will trigger replacement. string
The device owner of the port.
DnsName Changes to this property will trigger replacement. string
FixedIp Changes to this property will trigger replacement. string
The port IP address filter.
MacAddress Changes to this property will trigger replacement. string
The MAC address of the port.
Name Changes to this property will trigger replacement. string
The name of the port.
NetworkId Changes to this property will trigger replacement. string
The ID of the network the port belongs to.
ProjectId Changes to this property will trigger replacement. string
The owner of the port.
Region Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. []string
The list of port security group IDs to filter.
SortDirection Changes to this property will trigger replacement. string
Order the results in either asc or desc. Defaults to none.
SortKey Changes to this property will trigger replacement. string
Sort ports based on a certain key. Defaults to none.
Status Changes to this property will trigger replacement. string
The status of the port.
Tags Changes to this property will trigger replacement. []string
The list of port tags to filter.
TenantId Changes to this property will trigger replacement. string
adminStateUp Changes to this property will trigger replacement. Boolean
The administrative state of the port.
description Changes to this property will trigger replacement. String
Human-readable description of the port.
deviceId Changes to this property will trigger replacement. String
The ID of the device the port belongs to.
deviceOwner Changes to this property will trigger replacement. String
The device owner of the port.
dnsName Changes to this property will trigger replacement. String
fixedIp Changes to this property will trigger replacement. String
The port IP address filter.
macAddress Changes to this property will trigger replacement. String
The MAC address of the port.
name Changes to this property will trigger replacement. String
The name of the port.
networkId Changes to this property will trigger replacement. String
The ID of the network the port belongs to.
projectId Changes to this property will trigger replacement. String
The owner of the port.
region Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<String>
The list of port security group IDs to filter.
sortDirection Changes to this property will trigger replacement. String
Order the results in either asc or desc. Defaults to none.
sortKey Changes to this property will trigger replacement. String
Sort ports based on a certain key. Defaults to none.
status Changes to this property will trigger replacement. String
The status of the port.
tags Changes to this property will trigger replacement. List<String>
The list of port tags to filter.
tenantId Changes to this property will trigger replacement. String
adminStateUp Changes to this property will trigger replacement. boolean
The administrative state of the port.
description Changes to this property will trigger replacement. string
Human-readable description of the port.
deviceId Changes to this property will trigger replacement. string
The ID of the device the port belongs to.
deviceOwner Changes to this property will trigger replacement. string
The device owner of the port.
dnsName Changes to this property will trigger replacement. string
fixedIp Changes to this property will trigger replacement. string
The port IP address filter.
macAddress Changes to this property will trigger replacement. string
The MAC address of the port.
name Changes to this property will trigger replacement. string
The name of the port.
networkId Changes to this property will trigger replacement. string
The ID of the network the port belongs to.
projectId Changes to this property will trigger replacement. string
The owner of the port.
region Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string[]
The list of port security group IDs to filter.
sortDirection Changes to this property will trigger replacement. string
Order the results in either asc or desc. Defaults to none.
sortKey Changes to this property will trigger replacement. string
Sort ports based on a certain key. Defaults to none.
status Changes to this property will trigger replacement. string
The status of the port.
tags Changes to this property will trigger replacement. string[]
The list of port tags to filter.
tenantId Changes to this property will trigger replacement. string
admin_state_up Changes to this property will trigger replacement. bool
The administrative state of the port.
description Changes to this property will trigger replacement. str
Human-readable description of the port.
device_id Changes to this property will trigger replacement. str
The ID of the device the port belongs to.
device_owner Changes to this property will trigger replacement. str
The device owner of the port.
dns_name Changes to this property will trigger replacement. str
fixed_ip Changes to this property will trigger replacement. str
The port IP address filter.
mac_address Changes to this property will trigger replacement. str
The MAC address of the port.
name Changes to this property will trigger replacement. str
The name of the port.
network_id Changes to this property will trigger replacement. str
The ID of the network the port belongs to.
project_id Changes to this property will trigger replacement. str
The owner of the port.
region Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. Sequence[str]
The list of port security group IDs to filter.
sort_direction Changes to this property will trigger replacement. str
Order the results in either asc or desc. Defaults to none.
sort_key Changes to this property will trigger replacement. str
Sort ports based on a certain key. Defaults to none.
status Changes to this property will trigger replacement. str
The status of the port.
tags Changes to this property will trigger replacement. Sequence[str]
The list of port tags to filter.
tenant_id Changes to this property will trigger replacement. str
adminStateUp Changes to this property will trigger replacement. Boolean
The administrative state of the port.
description Changes to this property will trigger replacement. String
Human-readable description of the port.
deviceId Changes to this property will trigger replacement. String
The ID of the device the port belongs to.
deviceOwner Changes to this property will trigger replacement. String
The device owner of the port.
dnsName Changes to this property will trigger replacement. String
fixedIp Changes to this property will trigger replacement. String
The port IP address filter.
macAddress Changes to this property will trigger replacement. String
The MAC address of the port.
name Changes to this property will trigger replacement. String
The name of the port.
networkId Changes to this property will trigger replacement. String
The ID of the network the port belongs to.
projectId Changes to this property will trigger replacement. String
The owner of the port.
region Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<String>
The list of port security group IDs to filter.
sortDirection Changes to this property will trigger replacement. String
Order the results in either asc or desc. Defaults to none.
sortKey Changes to this property will trigger replacement. String
Sort ports based on a certain key. Defaults to none.
status Changes to this property will trigger replacement. String
The status of the port.
tags Changes to this property will trigger replacement. List<String>
The list of port tags to filter.
tenantId Changes to this property will trigger replacement. String

getPortIds Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
AdminStateUp bool
Description string
DeviceId string
DeviceOwner string
DnsName string
FixedIp string
MacAddress string
Name string
NetworkId string
ProjectId string
Region string
SecurityGroupIds List<string>
SortDirection string
SortKey string
Status string
Tags List<string>
TenantId string
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
AdminStateUp bool
Description string
DeviceId string
DeviceOwner string
DnsName string
FixedIp string
MacAddress string
Name string
NetworkId string
ProjectId string
Region string
SecurityGroupIds []string
SortDirection string
SortKey string
Status string
Tags []string
TenantId string
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
adminStateUp Boolean
description String
deviceId String
deviceOwner String
dnsName String
fixedIp String
macAddress String
name String
networkId String
projectId String
region String
securityGroupIds List<String>
sortDirection String
sortKey String
status String
tags List<String>
tenantId String
id string
The provider-assigned unique ID for this managed resource.
ids string[]
adminStateUp boolean
description string
deviceId string
deviceOwner string
dnsName string
fixedIp string
macAddress string
name string
networkId string
projectId string
region string
securityGroupIds string[]
sortDirection string
sortKey string
status string
tags string[]
tenantId string
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
admin_state_up bool
description str
device_id str
device_owner str
dns_name str
fixed_ip str
mac_address str
name str
network_id str
project_id str
region str
security_group_ids Sequence[str]
sort_direction str
sort_key str
status str
tags Sequence[str]
tenant_id str
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
adminStateUp Boolean
description String
deviceId String
deviceOwner String
dnsName String
fixedIp String
macAddress String
name String
networkId String
projectId String
region String
securityGroupIds List<String>
sortDirection String
sortKey String
status String
tags List<String>
tenantId String

Package Details

Repository
OpenStack pulumi/pulumi-openstack
License
Apache-2.0
Notes
This Pulumi package is based on the openstack Terraform Provider.
OpenStack v5.0.3 published on Wednesday, Feb 12, 2025 by Pulumi