Modifying opts and model structs with stricter types
diff --git a/openstack/networking/v2/subnets/results.go b/openstack/networking/v2/subnets/results.go
index 3de2668..d916a1c 100644
--- a/openstack/networking/v2/subnets/results.go
+++ b/openstack/networking/v2/subnets/results.go
@@ -11,17 +11,28 @@
}
type Subnet struct {
- Name string `mapstructure:"name" json:"name"`
- EnableDHCP bool `mapstructure:"enable_dhcp" json:"enable_dhcp"`
- NetworkID string `mapstructure:"network_id" json:"network_id"`
- TenantID string `mapstructure:"tenant_id" json:"tenant_id"`
- DNSNameservers []interface{} `mapstructure:"dns_nameservers" json:"dns_nameservers"`
+ // UUID representing the subnet
+ ID string `mapstructure:"id" json:"id"`
+ // UUID of the parent network
+ NetworkID string `mapstructure:"network_id" json:"network_id"`
+ // Human-readable name for the subnet. Might not be unique.
+ Name string `mapstructure:"name" json:"name"`
+ // IP version, either `4' or `6'
+ IPVersion int `mapstructure:"ip_version" json:"ip_version"`
+ // CIDR representing IP range for this subnet, based on IP version
+ CIDR string `mapstructure:"cidr" json:"cidr"`
+ // Default gateway used by devices in this subnet
+ GatewayIP string `mapstructure:"gateway_ip" json:"gateway_ip"`
+ // DNS name servers used by hosts in this subnet.
+ DNSNameservers []string `mapstructure:"dns_nameservers" json:"dns_nameservers"`
+ // Sub-ranges of CIDR available for dynamic allocation to ports. See AllocationPool.
AllocationPools []AllocationPool `mapstructure:"allocation_pools" json:"allocation_pools"`
- HostRoutes []interface{} `mapstructure:"host_routes" json:"host_routes"`
- IPVersion int `mapstructure:"ip_version" json:"ip_version"`
- GatewayIP string `mapstructure:"gateway_ip" json:"gateway_ip"`
- CIDR string `mapstructure:"cidr" json:"cidr"`
- ID string `mapstructure:"id" json:"id"`
+ // Routes that should be used by devices with IPs from this subnet (not including local subnet route).
+ HostRoutes []interface{} `mapstructure:"host_routes" json:"host_routes"`
+ // Specifies whether DHCP is enabled for this subnet or not.
+ EnableDHCP bool `mapstructure:"enable_dhcp" json:"enable_dhcp"`
+ // Owner of network. Only admin users can specify a tenant_id other than its own.
+ TenantID string `mapstructure:"tenant_id" json:"tenant_id"`
}
type SubnetPage struct {