OpenStack v5.0.0 published on Friday, Sep 27, 2024 by Pulumi
openstack.networking.getNetwork
Explore with Pulumi AI
Use this data source to get the ID of an available OpenStack network.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const network = openstack.networking.getNetwork({
name: "tf_test_network",
});
import pulumi
import pulumi_openstack as openstack
network = openstack.networking.get_network(name="tf_test_network")
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.LookupNetwork(ctx, &networking.LookupNetworkArgs{
Name: pulumi.StringRef("tf_test_network"),
}, 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 network = OpenStack.Networking.GetNetwork.Invoke(new()
{
Name = "tf_test_network",
});
});
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.GetNetworkArgs;
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 network = NetworkingFunctions.getNetwork(GetNetworkArgs.builder()
.name("tf_test_network")
.build());
}
}
variables:
network:
fn::invoke:
Function: openstack:networking:getNetwork
Arguments:
name: tf_test_network
Using getNetwork
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 getNetwork(args: GetNetworkArgs, opts?: InvokeOptions): Promise<GetNetworkResult>
function getNetworkOutput(args: GetNetworkOutputArgs, opts?: InvokeOptions): Output<GetNetworkResult>
def get_network(description: Optional[str] = None,
external: Optional[bool] = None,
matching_subnet_cidr: Optional[str] = None,
mtu: Optional[int] = None,
name: Optional[str] = None,
network_id: Optional[str] = None,
region: Optional[str] = None,
status: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
tenant_id: Optional[str] = None,
transparent_vlan: Optional[bool] = None,
opts: Optional[InvokeOptions] = None) -> GetNetworkResult
def get_network_output(description: Optional[pulumi.Input[str]] = None,
external: Optional[pulumi.Input[bool]] = None,
matching_subnet_cidr: Optional[pulumi.Input[str]] = None,
mtu: Optional[pulumi.Input[int]] = None,
name: Optional[pulumi.Input[str]] = None,
network_id: Optional[pulumi.Input[str]] = None,
region: 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,
transparent_vlan: Optional[pulumi.Input[bool]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetNetworkResult]
func LookupNetwork(ctx *Context, args *LookupNetworkArgs, opts ...InvokeOption) (*LookupNetworkResult, error)
func LookupNetworkOutput(ctx *Context, args *LookupNetworkOutputArgs, opts ...InvokeOption) LookupNetworkResultOutput
> Note: This function is named LookupNetwork
in the Go SDK.
public static class GetNetwork
{
public static Task<GetNetworkResult> InvokeAsync(GetNetworkArgs args, InvokeOptions? opts = null)
public static Output<GetNetworkResult> Invoke(GetNetworkInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetNetworkResult> getNetwork(GetNetworkArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: openstack:networking/getNetwork:getNetwork
arguments:
# arguments dictionary
The following arguments are supported:
- Description string
- Human-readable description of the network.
- External bool
- The external routing facility of the network.
- Matching
Subnet stringCidr - The CIDR of a subnet within the network.
- Mtu int
- The network MTU to filter. Available, when Neutron
net-mtu
extension is enabled. - Name string
- The name of the network.
- Network
Id string - The ID of the network.
- Region string
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve networks ids. If omitted, the
region
argument of the provider is used. - Status string
- The status of the network.
- List<string>
- The list of network tags to filter.
- Tenant
Id string - The owner of the network.
- Transparent
Vlan bool - The VLAN transparent attribute for the network.
- Description string
- Human-readable description of the network.
- External bool
- The external routing facility of the network.
- Matching
Subnet stringCidr - The CIDR of a subnet within the network.
- Mtu int
- The network MTU to filter. Available, when Neutron
net-mtu
extension is enabled. - Name string
- The name of the network.
- Network
Id string - The ID of the network.
- Region string
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve networks ids. If omitted, the
region
argument of the provider is used. - Status string
- The status of the network.
- []string
- The list of network tags to filter.
- Tenant
Id string - The owner of the network.
- Transparent
Vlan bool - The VLAN transparent attribute for the network.
- description String
- Human-readable description of the network.
- external Boolean
- The external routing facility of the network.
- matching
Subnet StringCidr - The CIDR of a subnet within the network.
- mtu Integer
- The network MTU to filter. Available, when Neutron
net-mtu
extension is enabled. - name String
- The name of the network.
- network
Id String - The ID of the network.
- region String
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve networks ids. If omitted, the
region
argument of the provider is used. - status String
- The status of the network.
- List<String>
- The list of network tags to filter.
- tenant
Id String - The owner of the network.
- transparent
Vlan Boolean - The VLAN transparent attribute for the network.
- description string
- Human-readable description of the network.
- external boolean
- The external routing facility of the network.
- matching
Subnet stringCidr - The CIDR of a subnet within the network.
- mtu number
- The network MTU to filter. Available, when Neutron
net-mtu
extension is enabled. - name string
- The name of the network.
- network
Id string - The ID of the network.
- region string
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve networks ids. If omitted, the
region
argument of the provider is used. - status string
- The status of the network.
- string[]
- The list of network tags to filter.
- tenant
Id string - The owner of the network.
- transparent
Vlan boolean - The VLAN transparent attribute for the network.
- description str
- Human-readable description of the network.
- external bool
- The external routing facility of the network.
- matching_
subnet_ strcidr - The CIDR of a subnet within the network.
- mtu int
- The network MTU to filter. Available, when Neutron
net-mtu
extension is enabled. - name str
- The name of the network.
- network_
id str - The ID of the network.
- region str
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve networks ids. If omitted, the
region
argument of the provider is used. - status str
- The status of the network.
- Sequence[str]
- The list of network tags to filter.
- tenant_
id str - The owner of the network.
- transparent_
vlan bool - The VLAN transparent attribute for the network.
- description String
- Human-readable description of the network.
- external Boolean
- The external routing facility of the network.
- matching
Subnet StringCidr - The CIDR of a subnet within the network.
- mtu Number
- The network MTU to filter. Available, when Neutron
net-mtu
extension is enabled. - name String
- The name of the network.
- network
Id String - The ID of the network.
- region String
- The region in which to obtain the V2 Neutron client.
A Neutron client is needed to retrieve networks ids. If omitted, the
region
argument of the provider is used. - status String
- The status of the network.
- List<String>
- The list of network tags to filter.
- tenant
Id String - The owner of the network.
- transparent
Vlan Boolean - The VLAN transparent attribute for the network.
getNetwork Result
The following output properties are available:
- Admin
State stringUp - The administrative state of the network.
- List<string>
- The set of string tags applied on the network.
- Availability
Zone List<string>Hints - The availability zone candidates for the network.
- Dns
Domain string - The network DNS domain. Available, when Neutron DNS extension is enabled
- Id string
- The provider-assigned unique ID for this managed resource.
- Region string
- See Argument Reference above.
- Segments
List<Pulumi.
Open Stack. Networking. Outputs. Get Network Segment> - An array of one or more provider segment objects.
- string
- Specifies whether the network resource can be accessed by any tenant or not.
- Subnets List<string>
- A list of subnet IDs belonging to the network.
- Description string
- See Argument Reference above.
- External bool
- See Argument Reference above.
- Matching
Subnet stringCidr - Mtu int
- See Argument Reference above.
- Name string
- See Argument Reference above.
- Network
Id string - Status string
- List<string>
- Tenant
Id string - Transparent
Vlan bool - See Argument Reference above.
- Admin
State stringUp - The administrative state of the network.
- []string
- The set of string tags applied on the network.
- Availability
Zone []stringHints - The availability zone candidates for the network.
- Dns
Domain string - The network DNS domain. Available, when Neutron DNS extension is enabled
- Id string
- The provider-assigned unique ID for this managed resource.
- Region string
- See Argument Reference above.
- Segments
[]Get
Network Segment - An array of one or more provider segment objects.
- string
- Specifies whether the network resource can be accessed by any tenant or not.
- Subnets []string
- A list of subnet IDs belonging to the network.
- Description string
- See Argument Reference above.
- External bool
- See Argument Reference above.
- Matching
Subnet stringCidr - Mtu int
- See Argument Reference above.
- Name string
- See Argument Reference above.
- Network
Id string - Status string
- []string
- Tenant
Id string - Transparent
Vlan bool - See Argument Reference above.
- admin
State StringUp - The administrative state of the network.
- List<String>
- The set of string tags applied on the network.
- availability
Zone List<String>Hints - The availability zone candidates for the network.
- dns
Domain String - The network DNS domain. Available, when Neutron DNS extension is enabled
- id String
- The provider-assigned unique ID for this managed resource.
- region String
- See Argument Reference above.
- segments
List<Get
Network Segment> - An array of one or more provider segment objects.
- String
- Specifies whether the network resource can be accessed by any tenant or not.
- subnets List<String>
- A list of subnet IDs belonging to the network.
- description String
- See Argument Reference above.
- external Boolean
- See Argument Reference above.
- matching
Subnet StringCidr - mtu Integer
- See Argument Reference above.
- name String
- See Argument Reference above.
- network
Id String - status String
- List<String>
- tenant
Id String - transparent
Vlan Boolean - See Argument Reference above.
- admin
State stringUp - The administrative state of the network.
- string[]
- The set of string tags applied on the network.
- availability
Zone string[]Hints - The availability zone candidates for the network.
- dns
Domain string - The network DNS domain. Available, when Neutron DNS extension is enabled
- id string
- The provider-assigned unique ID for this managed resource.
- region string
- See Argument Reference above.
- segments
Get
Network Segment[] - An array of one or more provider segment objects.
- string
- Specifies whether the network resource can be accessed by any tenant or not.
- subnets string[]
- A list of subnet IDs belonging to the network.
- description string
- See Argument Reference above.
- external boolean
- See Argument Reference above.
- matching
Subnet stringCidr - mtu number
- See Argument Reference above.
- name string
- See Argument Reference above.
- network
Id string - status string
- string[]
- tenant
Id string - transparent
Vlan boolean - See Argument Reference above.
- admin_
state_ strup - The administrative state of the network.
- Sequence[str]
- The set of string tags applied on the network.
- availability_
zone_ Sequence[str]hints - The availability zone candidates for the network.
- dns_
domain str - The network DNS domain. Available, when Neutron DNS extension is enabled
- id str
- The provider-assigned unique ID for this managed resource.
- region str
- See Argument Reference above.
- segments
Sequence[Get
Network Segment] - An array of one or more provider segment objects.
- str
- Specifies whether the network resource can be accessed by any tenant or not.
- subnets Sequence[str]
- A list of subnet IDs belonging to the network.
- description str
- See Argument Reference above.
- external bool
- See Argument Reference above.
- matching_
subnet_ strcidr - mtu int
- See Argument Reference above.
- name str
- See Argument Reference above.
- network_
id str - status str
- Sequence[str]
- tenant_
id str - transparent_
vlan bool - See Argument Reference above.
- admin
State StringUp - The administrative state of the network.
- List<String>
- The set of string tags applied on the network.
- availability
Zone List<String>Hints - The availability zone candidates for the network.
- dns
Domain String - The network DNS domain. Available, when Neutron DNS extension is enabled
- id String
- The provider-assigned unique ID for this managed resource.
- region String
- See Argument Reference above.
- segments List<Property Map>
- An array of one or more provider segment objects.
- String
- Specifies whether the network resource can be accessed by any tenant or not.
- subnets List<String>
- A list of subnet IDs belonging to the network.
- description String
- See Argument Reference above.
- external Boolean
- See Argument Reference above.
- matching
Subnet StringCidr - mtu Number
- See Argument Reference above.
- name String
- See Argument Reference above.
- network
Id String - status String
- List<String>
- tenant
Id String - transparent
Vlan Boolean - See Argument Reference above.
Supporting Types
GetNetworkSegment
- Network
Type string - Physical
Network string - Segmentation
Id int
- Network
Type string - Physical
Network string - Segmentation
Id int
- network
Type String - physical
Network String - segmentation
Id Integer
- network
Type string - physical
Network string - segmentation
Id number
- network_
type str - physical_
network str - segmentation_
id int
- network
Type String - physical
Network String - segmentation
Id Number
Package Details
- Repository
- OpenStack pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
openstack
Terraform Provider.