1. Packages
  2. Openstack Provider
  3. API Docs
  4. networking
  5. getPortIds
OpenStack v4.1.3 published on Wednesday, Aug 21, 2024 by Pulumi

openstack.networking.getPortIds

Explore with Pulumi AI

openstack logo
OpenStack v4.1.3 published on Wednesday, Aug 21, 2024 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",
    });
    
    import pulumi
    import pulumi_openstack as openstack
    
    ports = openstack.networking.get_port_ids(name="port")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-openstack/sdk/v4/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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: openstack:networking/getPortIds:getPortIds
      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
    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 region argument of the provider is used.
    SecurityGroupIds List<string>
    The list of port security group IDs to filter.
    SortDirection string
    Order the results in either asc or desc. Defaults to none.
    SortKey string
    Sort ports based on a certain key. Defaults to none.
    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
    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 region argument of the provider is used.
    SecurityGroupIds []string
    The list of port security group IDs to filter.
    SortDirection string
    Order the results in either asc or desc. Defaults to none.
    SortKey string
    Sort ports based on a certain key. Defaults to none.
    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
    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 region argument of the provider is used.
    securityGroupIds List<String>
    The list of port security group IDs to filter.
    sortDirection String
    Order the results in either asc or desc. Defaults to none.
    sortKey String
    Sort ports based on a certain key. Defaults to none.
    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
    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 region argument of the provider is used.
    securityGroupIds string[]
    The list of port security group IDs to filter.
    sortDirection string
    Order the results in either asc or desc. Defaults to none.
    sortKey string
    Sort ports based on a certain key. Defaults to none.
    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
    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 region argument of the provider is used.
    security_group_ids Sequence[str]
    The list of port security group IDs to filter.
    sort_direction str
    Order the results in either asc or desc. Defaults to none.
    sort_key str
    Sort ports based on a certain key. Defaults to none.
    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
    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 region argument of the provider is used.
    securityGroupIds List<String>
    The list of port security group IDs to filter.
    sortDirection String
    Order the results in either asc or desc. Defaults to none.
    sortKey String
    Sort ports based on a certain key. Defaults to none.
    status String
    The status of the port.
    tags 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>
    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 logo
    OpenStack v4.1.3 published on Wednesday, Aug 21, 2024 by Pulumi