Skip to content

Commit

Permalink
Networking: expose subnets in network data source (#1152)
Browse files Browse the repository at this point in the history
  • Loading branch information
kayrus committed Jan 31, 2021
1 parent 8768f0e commit 2d76c4b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 7 additions & 0 deletions openstack/data_source_openstack_networking_network_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ func dataSourceNetworkingNetworkV2() *schema.Resource {
Computed: true,
},

"subnets": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},

"all_tags": {
Type: schema.TypeSet,
Computed: true,
Expand Down Expand Up @@ -233,6 +239,7 @@ func dataSourceNetworkingNetworkV2Read(d *schema.ResourceData, meta interface{})
d.Set("external", network.External)
d.Set("tenant_id", network.TenantID)
d.Set("transparent_vlan", network.VLANTransparent)
d.Set("subnets", network.Subnets)
d.Set("all_tags", network.Tags)
d.Set("mtu", network.MTU)
d.Set("dns_domain", network.DNSDomain)
Expand Down
7 changes: 4 additions & 3 deletions website/docs/d/networking_network_v2.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ data "openstack_networking_network_v2" "network" {
* `tags` - (Optional) The list of network tags to filter.

* `mtu` - (Optional) The network MTU to filter. Available, when Neutron `net-mtu`
extension is enabled.
extension is enabled.

## Attributes Reference

Expand All @@ -62,7 +62,8 @@ are exported:
tenant or not.
* `availability_zone_hints` - The availability zone candidates for the network.
* `transparent_vlan` - See Argument Reference above.
* `all_tags` - The set of string tags applied on the network.
* `mtu` - See Argument Reference above.
* `dns_domain` - The network DNS domain. Available, when Neutron DNS extension
is enabled
is enabled
* `subnets` - A list of subnet IDs belonging to the network.
* `all_tags` - The set of string tags applied on the network.

0 comments on commit 2d76c4b

Please sign in to comment.