From 73dab1ca88f39e5715ec7737e3e26cec617a8266 Mon Sep 17 00:00:00 2001 From: Lance52259 Date: Thu, 11 Mar 2021 17:52:40 +0800 Subject: [PATCH] feat: vpc subnet supports IPv6 enable --- openstack/networking/v1/subnets/requests.go | 2 ++ openstack/networking/v1/subnets/results.go | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/openstack/networking/v1/subnets/requests.go b/openstack/networking/v1/subnets/requests.go index e268c47ac..34fa625c3 100644 --- a/openstack/networking/v1/subnets/requests.go +++ b/openstack/networking/v1/subnets/requests.go @@ -139,6 +139,7 @@ type CreateOpts struct { CIDR string `json:"cidr" required:"true"` DnsList []string `json:"dnsList,omitempty"` GatewayIP string `json:"gateway_ip" required:"true"` + EnableIPv6 *bool `json:"ipv6_enable,omitempty"` EnableDHCP bool `json:"dhcp_enable" no_default:"y"` PRIMARY_DNS string `json:"primary_dns,omitempty"` SECONDARY_DNS string `json:"secondary_dns,omitempty"` @@ -188,6 +189,7 @@ type UpdateOptsBuilder interface { // UpdateOpts contains the values used when updating a subnets. type UpdateOpts struct { Name string `json:"name,omitempty"` + EnableIPv6 *bool `json:"ipv6_enable,omitempty"` EnableDHCP bool `json:"dhcp_enable"` PRIMARY_DNS string `json:"primary_dns,omitempty"` SECONDARY_DNS string `json:"secondary_dns,omitempty"` diff --git a/openstack/networking/v1/subnets/results.go b/openstack/networking/v1/subnets/results.go index d4116c33c..733678d4b 100644 --- a/openstack/networking/v1/subnets/results.go +++ b/openstack/networking/v1/subnets/results.go @@ -25,6 +25,15 @@ type Subnet struct { //Specifies the gateway of the subnet. GatewayIP string `json:"gateway_ip"` + //Specifies whether the IPv6 function is enabled for the subnet. + EnableIPv6 bool `json:"ipv6_enable"` + + //Specifies the IPv6 subnet CIDR block. + IPv6CIDR string `json:"cidr_v6"` + + //Specifies the IPv6 subnet gateway. + IPv6Gateway string `json:"gateway_ip_v6"` + //Specifies whether the DHCP function is enabled for the subnet. EnableDHCP bool `json:"dhcp_enable"`