OpenStack v5.0.3 published on Wednesday, Feb 12, 2025 by Pulumi
openstack.networking.getPortIds
Explore with Pulumi AI
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",
});
import pulumi
import pulumi_openstack as openstack
ports = openstack.networking.get_port_ids(name="port")
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
	})
}
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",
    });
});
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());
    }
}
variables:
  ports:
    fn::invoke:
      function: openstack:networking:getPortIds
      arguments:
        name: port
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>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]func GetPortIds(ctx *Context, args *GetPortIdsArgs, opts ...InvokeOption) (*GetPortIdsResult, error)
func GetPortIdsOutput(ctx *Context, args *GetPortIdsOutputArgs, opts ...InvokeOption) GetPortIdsResultOutput> 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)
}public static CompletableFuture<GetPortIdsResult> getPortIds(GetPortIdsArgs args, InvokeOptions options)
public static Output<GetPortIdsResult> getPortIds(GetPortIdsArgs args, InvokeOptions options)
fn::invoke:
  function: openstack:networking/getPortIds:getPortIds
  arguments:
    # arguments dictionaryThe following arguments are supported:
- AdminState boolUp 
- 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
- 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.
- 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
regionargument of the provider is used.
- SecurityGroup List<string>Ids 
- The list of port security group IDs to filter.
- SortDirection string
- Order the results in either ascordesc. Defaults to none.
- SortKey string
- Sort ports based on a certain key. Defaults to none.
- Status string
- The status of the port.
- List<string>
- The list of port tags to filter.
- TenantId string
- AdminState boolUp 
- 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
- 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.
- 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
regionargument of the provider is used.
- SecurityGroup []stringIds 
- The list of port security group IDs to filter.
- SortDirection string
- Order the results in either ascordesc. Defaults to none.
- SortKey string
- Sort ports based on a certain key. Defaults to none.
- Status string
- The status of the port.
- []string
- The list of port tags to filter.
- TenantId string
- adminState BooleanUp 
- 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
- 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.
- 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
regionargument of the provider is used.
- securityGroup List<String>Ids 
- The list of port security group IDs to filter.
- sortDirection String
- Order the results in either ascordesc. Defaults to none.
- sortKey String
- Sort ports based on a certain key. Defaults to none.
- status String
- The status of the port.
- List<String>
- The list of port tags to filter.
- tenantId String
- adminState booleanUp 
- 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
- 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.
- 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
regionargument of the provider is used.
- securityGroup string[]Ids 
- The list of port security group IDs to filter.
- sortDirection string
- Order the results in either ascordesc. Defaults to none.
- sortKey string
- Sort ports based on a certain key. Defaults to none.
- status string
- The status of the port.
- string[]
- The list of port tags to filter.
- tenantId string
- admin_state_ boolup 
- 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
- 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.
- 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
regionargument of the provider is used.
- security_group_ Sequence[str]ids 
- The list of port security group IDs to filter.
- sort_direction str
- Order the results in either ascordesc. Defaults to none.
- sort_key str
- Sort ports based on a certain key. Defaults to none.
- status str
- The status of the port.
- Sequence[str]
- The list of port tags to filter.
- tenant_id str
- adminState BooleanUp 
- 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
- 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.
- 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
regionargument of the provider is used.
- securityGroup List<String>Ids 
- The list of port security group IDs to filter.
- sortDirection String
- Order the results in either ascordesc. Defaults to none.
- sortKey String
- Sort ports based on a certain key. Defaults to none.
- status String
- The status of the port.
- List<String>
- The list of port tags to filter.
- tenantId String
getPortIds Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- AdminState boolUp 
- Description string
- DeviceId string
- DeviceOwner string
- DnsName string
- FixedIp string
- MacAddress string
- Name string
- NetworkId string
- ProjectId string
- Region string
- SecurityGroup List<string>Ids 
- SortDirection string
- SortKey string
- Status string
- List<string>
- TenantId string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- AdminState boolUp 
- Description string
- DeviceId string
- DeviceOwner string
- DnsName string
- FixedIp string
- MacAddress string
- Name string
- NetworkId string
- ProjectId string
- Region string
- SecurityGroup []stringIds 
- SortDirection string
- SortKey string
- Status string
- []string
- TenantId string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- adminState BooleanUp 
- description String
- deviceId String
- deviceOwner String
- dnsName String
- fixedIp String
- macAddress String
- name String
- networkId String
- projectId String
- region String
- securityGroup List<String>Ids 
- sortDirection String
- sortKey String
- status String
- List<String>
- tenantId String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- adminState booleanUp 
- description string
- deviceId string
- deviceOwner string
- dnsName string
- fixedIp string
- macAddress string
- name string
- networkId string
- projectId string
- region string
- securityGroup string[]Ids 
- sortDirection string
- sortKey string
- status string
- string[]
- tenantId string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- admin_state_ boolup 
- 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_ Sequence[str]ids 
- sort_direction str
- sort_key str
- status str
- Sequence[str]
- tenant_id str
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- adminState BooleanUp 
- description String
- deviceId String
- deviceOwner String
- dnsName String
- fixedIp String
- macAddress String
- name String
- networkId String
- projectId String
- region String
- securityGroup List<String>Ids 
- sortDirection String
- sortKey String
- status String
- List<String>
- tenantId String
Package Details
- Repository
- OpenStack pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the openstackTerraform Provider.