OpenStack v5.0.0 published on Friday, Sep 27, 2024 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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: openstack:networking/getPortIds:getPortIds
arguments:
# arguments dictionary
The following arguments are supported:
- Admin
State boolUp - The administrative state of the port.
- Description string
- Human-readable description of the port.
- Device
Id string - The ID of the device the port belongs to.
- Device
Owner string - The device owner of the port.
- Dns
Name string - Fixed
Ip string - The port IP address filter.
- Mac
Address string - The MAC address of the port.
- Name string
- The name of the port.
- Network
Id string - The ID of the network the port belongs to.
- Project
Id 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. - Security
Group List<string>Ids - The list of port security group IDs to filter.
- Sort
Direction string - Order the results in either
asc
ordesc
. Defaults to none. - Sort
Key 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.
- Tenant
Id string
- Admin
State boolUp - The administrative state of the port.
- Description string
- Human-readable description of the port.
- Device
Id string - The ID of the device the port belongs to.
- Device
Owner string - The device owner of the port.
- Dns
Name string - Fixed
Ip string - The port IP address filter.
- Mac
Address string - The MAC address of the port.
- Name string
- The name of the port.
- Network
Id string - The ID of the network the port belongs to.
- Project
Id 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. - Security
Group []stringIds - The list of port security group IDs to filter.
- Sort
Direction string - Order the results in either
asc
ordesc
. Defaults to none. - Sort
Key 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.
- Tenant
Id string
- admin
State BooleanUp - The administrative state of the port.
- description String
- Human-readable description of the port.
- device
Id String - The ID of the device the port belongs to.
- device
Owner String - The device owner of the port.
- dns
Name String - fixed
Ip String - The port IP address filter.
- mac
Address String - The MAC address of the port.
- name String
- The name of the port.
- network
Id String - The ID of the network the port belongs to.
- project
Id 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. - security
Group List<String>Ids - The list of port security group IDs to filter.
- sort
Direction String - Order the results in either
asc
ordesc
. Defaults to none. - sort
Key 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.
- tenant
Id String
- admin
State booleanUp - The administrative state of the port.
- description string
- Human-readable description of the port.
- device
Id string - The ID of the device the port belongs to.
- device
Owner string - The device owner of the port.
- dns
Name string - fixed
Ip string - The port IP address filter.
- mac
Address string - The MAC address of the port.
- name string
- The name of the port.
- network
Id string - The ID of the network the port belongs to.
- project
Id 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. - security
Group string[]Ids - The list of port security group IDs to filter.
- sort
Direction string - Order the results in either
asc
ordesc
. Defaults to none. - sort
Key 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.
- tenant
Id 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
region
argument 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
asc
ordesc
. 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
- admin
State BooleanUp - The administrative state of the port.
- description String
- Human-readable description of the port.
- device
Id String - The ID of the device the port belongs to.
- device
Owner String - The device owner of the port.
- dns
Name String - fixed
Ip String - The port IP address filter.
- mac
Address String - The MAC address of the port.
- name String
- The name of the port.
- network
Id String - The ID of the network the port belongs to.
- project
Id 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. - security
Group List<String>Ids - The list of port security group IDs to filter.
- sort
Direction String - Order the results in either
asc
ordesc
. Defaults to none. - sort
Key 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.
- tenant
Id String
getPortIds Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Admin
State boolUp - Description string
- Device
Id string - Device
Owner string - Dns
Name string - Fixed
Ip string - Mac
Address string - Name string
- Network
Id string - Project
Id string - Region string
- Security
Group List<string>Ids - Sort
Direction string - Sort
Key string - Status string
- List<string>
- Tenant
Id string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Admin
State boolUp - Description string
- Device
Id string - Device
Owner string - Dns
Name string - Fixed
Ip string - Mac
Address string - Name string
- Network
Id string - Project
Id string - Region string
- Security
Group []stringIds - Sort
Direction string - Sort
Key string - Status string
- []string
- Tenant
Id string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- admin
State BooleanUp - description String
- device
Id String - device
Owner String - dns
Name String - fixed
Ip String - mac
Address String - name String
- network
Id String - project
Id String - region String
- security
Group List<String>Ids - sort
Direction String - sort
Key String - status String
- List<String>
- tenant
Id String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- admin
State booleanUp - description string
- device
Id string - device
Owner string - dns
Name string - fixed
Ip string - mac
Address string - name string
- network
Id string - project
Id string - region string
- security
Group string[]Ids - sort
Direction string - sort
Key string - status string
- string[]
- tenant
Id 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>
- admin
State BooleanUp - description String
- device
Id String - device
Owner String - dns
Name String - fixed
Ip String - mac
Address String - name String
- network
Id String - project
Id String - region String
- security
Group List<String>Ids - sort
Direction String - sort
Key String - status String
- List<String>
- tenant
Id String
Package Details
- Repository
- OpenStack pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
openstack
Terraform Provider.