title: "getPort" title_tag: "huaweicloud.Vpc.getPort" meta_desc: "Documentation for the huaweicloud.Vpc.getPort function with examples, input properties, output properties, and supporting types." layout: api no_edit_this_page: true
Use this data source to get the ID of an available HuaweiCloud port.
using System.Collections.Generic;
using Pulumi;
using Huaweicloud = Pulumi.Huaweicloud;
return await Deployment.RunAsync(() =>
{
var port1 = Huaweicloud.Vpc.GetPort.Invoke(new()
{
NetworkId = @var.Network_id,
FixedIp = "192.168.0.100",
});
});
package main
import (
"github.com/huaweicloud/pulumi-huaweicloud/sdk/go/huaweicloud/Vpc"
"github.com/pulumi/pulumi-huaweicloud/sdk/go/huaweicloud/Vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := Vpc.GetPort(ctx, &vpc.GetPortArgs{
NetworkId: pulumi.StringRef(_var.Network_id),
FixedIp: pulumi.StringRef("192.168.0.100"),
}, nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.huaweicloud.Vpc.VpcFunctions;
import com.pulumi.huaweicloud.Iec.inputs.GetPortArgs;
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 port1 = VpcFunctions.getPort(GetPortArgs.builder()
.networkId(var_.network_id())
.fixedIp("192.168.0.100")
.build());
}
}
import pulumi
import pulumi_huaweicloud as huaweicloud
port1 = huaweicloud.Vpc.get_port(network_id=var["network_id"],
fixed_ip="192.168.0.100")
import * as pulumi from "@pulumi/pulumi";
import * as huaweicloud from "@pulumi/huaweicloud";
const port1 = huaweicloud.Vpc.getPort({
networkId: _var.network_id,
fixedIp: "192.168.0.100",
});
variables:
port1:
Fn::Invoke:
Function: huaweicloud:Vpc:getPort
Arguments:
networkId: ${var.network_id}
fixedIp: 192.168.0.100
Using getPort {#using}
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 getPort(args: GetPortArgs, opts?: InvokeOptions): Promise<GetPortResult>
function getPortOutput(args: GetPortOutputArgs, opts?: InvokeOptions): Output<GetPortResult>
def get_port(admin_state_up: Optional[bool] = None,
device_id: Optional[str] = None,
device_owner: Optional[str] = None,
fixed_ip: Optional[str] = None,
mac_address: Optional[str] = None,
name: Optional[str] = None,
network_id: Optional[str] = None,
port_id: Optional[str] = None,
project_id: Optional[str] = None,
region: Optional[str] = None,
security_group_ids: Optional[Sequence[str]] = None,
status: Optional[str] = None,
tenant_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetPortResult
def get_port_output(admin_state_up: Optional[pulumi.Input[bool]] = None,
device_id: Optional[pulumi.Input[str]] = None,
device_owner: 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,
port_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,
status: Optional[pulumi.Input[str]] = None,
tenant_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetPortResult]
func GetPort(ctx *Context, args *GetPortArgs, opts ...InvokeOption) (*GetPortResult, error)
func GetPortOutput(ctx *Context, args *GetPortOutputArgs, opts ...InvokeOption) GetPortResultOutput
> Note: This function is named GetPort
in the Go SDK.
public static class GetPort
{
public static Task<GetPortResult> InvokeAsync(GetPortArgs args, InvokeOptions? opts = null)
public static Output<GetPortResult> Invoke(GetPortInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetPortResult> getPort(GetPortArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: huaweicloud:Vpc/getPort:getPort
Arguments:
# Arguments dictionary
The following arguments are supported:
-
Admin
State boolUp The administrative state of the port.
-
Device
Id string The ID of the device the port belongs to.
-
Device
Owner string The device owner of the port.
-
Fixed
Ip string Specifies the port IP address filter.
-
Mac
Address string Specifies the MAC address of the port.
- Name string
The name of the port.
-
Network
Id string Specifies the ID of the network the port belongs to.
-
Port
Id string Specifies the ID of the port.
-
Project
Id string - Region string
Specifies the region in which to obtain the port. If omitted, the provider-level region will be used.
-
Security
Group List<string>Ids The list of port security group IDs to filter.
- Status string
Specifies the status of the port.
-
Tenant
Id string
-
Admin
State boolUp The administrative state of the port.
-
Device
Id string The ID of the device the port belongs to.
-
Device
Owner string The device owner of the port.
-
Fixed
Ip string Specifies the port IP address filter.
-
Mac
Address string Specifies the MAC address of the port.
- Name string
The name of the port.
-
Network
Id string Specifies the ID of the network the port belongs to.
-
Port
Id string Specifies the ID of the port.
-
Project
Id string - Region string
Specifies the region in which to obtain the port. If omitted, the provider-level region will be used.
-
Security
Group []stringIds The list of port security group IDs to filter.
- Status string
Specifies the status of the port.
-
Tenant
Id string
-
admin
State BooleanUp The administrative state of the port.
-
device
Id String The ID of the device the port belongs to.
-
device
Owner String The device owner of the port.
-
fixed
Ip String Specifies the port IP address filter.
-
mac
Address String Specifies the MAC address of the port.
- name String
The name of the port.
-
network
Id String Specifies the ID of the network the port belongs to.
-
port
Id String Specifies the ID of the port.
-
project
Id String - region String
Specifies the region in which to obtain the port. If omitted, the provider-level region will be used.
-
security
Group List<String>Ids The list of port security group IDs to filter.
- status String
Specifies the status of the port.
-
tenant
Id String
-
admin
State booleanUp The administrative state of the port.
-
device
Id string The ID of the device the port belongs to.
-
device
Owner string The device owner of the port.
-
fixed
Ip string Specifies the port IP address filter.
-
mac
Address string Specifies the MAC address of the port.
- name string
The name of the port.
-
network
Id string Specifies the ID of the network the port belongs to.
-
port
Id string Specifies the ID of the port.
-
project
Id string - region string
Specifies the region in which to obtain the port. If omitted, the provider-level region will be used.
-
security
Group string[]Ids The list of port security group IDs to filter.
- status string
Specifies the status of the port.
-
tenant
Id string
-
admin_
state_ boolup The administrative state of the port.
-
device_
id str The ID of the device the port belongs to.
-
device_
owner str The device owner of the port.
-
fixed_
ip str Specifies the port IP address filter.
-
mac_
address str Specifies the MAC address of the port.
- name str
The name of the port.
-
network_
id str Specifies the ID of the network the port belongs to.
-
port_
id str Specifies the ID of the port.
-
project_
id str - region str
Specifies the region in which to obtain the port. If omitted, the provider-level region will be used.
-
security_
group_ Sequence[str]ids The list of port security group IDs to filter.
- status str
Specifies the status of the port.
-
tenant_
id str
-
admin
State BooleanUp The administrative state of the port.
-
device
Id String The ID of the device the port belongs to.
-
device
Owner String The device owner of the port.
-
fixed
Ip String Specifies the port IP address filter.
-
mac
Address String Specifies the MAC address of the port.
- name String
The name of the port.
-
network
Id String Specifies the ID of the network the port belongs to.
-
port
Id String Specifies the ID of the port.
-
project
Id String - region String
Specifies the region in which to obtain the port. If omitted, the provider-level region will be used.
-
security
Group List<String>Ids The list of port security group IDs to filter.
- status String
Specifies the status of the port.
-
tenant
Id String
getPort Result {#result}
The following output properties are available:
-
Admin
State boolUp The administrative state of the port.
-
All
Fixed List<string>Ips The collection of Fixed IP addresses on the port.
-
All
Security List<string>Group Ids The collection of security group IDs applied on the port.
-
Device
Id string The ID of the device the port belongs to.
-
Device
Owner string The device owner of the port.
- Id string
The provider-assigned unique ID for this managed resource.
-
Mac
Address string - Name string
The name of the port.
-
Network
Id string -
Port
Id string - Region string
- Status string
-
Fixed
Ip string -
Project
Id string -
Security
Group List<string>Ids -
Tenant
Id string
-
Admin
State boolUp The administrative state of the port.
-
All
Fixed []stringIps The collection of Fixed IP addresses on the port.
-
All
Security []stringGroup Ids The collection of security group IDs applied on the port.
-
Device
Id string The ID of the device the port belongs to.
-
Device
Owner string The device owner of the port.
- Id string
The provider-assigned unique ID for this managed resource.
-
Mac
Address string - Name string
The name of the port.
-
Network
Id string -
Port
Id string - Region string
- Status string
-
Fixed
Ip string -
Project
Id string -
Security
Group []stringIds -
Tenant
Id string
-
admin
State BooleanUp The administrative state of the port.
-
all
Fixed List<String>Ips The collection of Fixed IP addresses on the port.
-
all
Security List<String>Group Ids The collection of security group IDs applied on the port.
-
device
Id String The ID of the device the port belongs to.
-
device
Owner String The device owner of the port.
- id String
The provider-assigned unique ID for this managed resource.
-
mac
Address String - name String
The name of the port.
-
network
Id String -
port
Id String - region String
- status String
-
fixed
Ip String -
project
Id String -
security
Group List<String>Ids -
tenant
Id String
-
admin
State booleanUp The administrative state of the port.
-
all
Fixed string[]Ips The collection of Fixed IP addresses on the port.
-
all
Security string[]Group Ids The collection of security group IDs applied on the port.
-
device
Id string The ID of the device the port belongs to.
-
device
Owner string The device owner of the port.
- id string
The provider-assigned unique ID for this managed resource.
-
mac
Address string - name string
The name of the port.
-
network
Id string -
port
Id string - region string
- status string
-
fixed
Ip string -
project
Id string -
security
Group string[]Ids -
tenant
Id string
-
admin_
state_ boolup The administrative state of the port.
-
all_
fixed_ Sequence[str]ips The collection of Fixed IP addresses on the port.
-
all_
security_ Sequence[str]group_ ids The collection of security group IDs applied on the port.
-
device_
id str The ID of the device the port belongs to.
-
device_
owner str The device owner of the port.
- id str
The provider-assigned unique ID for this managed resource.
-
mac_
address str - name str
The name of the port.
-
network_
id str -
port_
id str - region str
- status str
-
fixed_
ip str -
project_
id str -
security_
group_ Sequence[str]ids -
tenant_
id str
-
admin
State BooleanUp The administrative state of the port.
-
all
Fixed List<String>Ips The collection of Fixed IP addresses on the port.
-
all
Security List<String>Group Ids The collection of security group IDs applied on the port.
-
device
Id String The ID of the device the port belongs to.
-
device
Owner String The device owner of the port.
- id String
The provider-assigned unique ID for this managed resource.
-
mac
Address String - name String
The name of the port.
-
network
Id String -
port
Id String - region String
- status String
-
fixed
Ip String -
project
Id String -
security
Group List<String>Ids -
tenant
Id String
Package Details
- Repository
- https://github.com/huaweicloud/pulumi-huaweicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
huaweicloud
Terraform Provider.