Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/openstack: LoadBalancer v2 VIP Port ID #9727

Merged
merged 1 commit into from
Nov 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ func resourceLoadBalancerV2() *schema.Resource {
ForceNew: true,
},

"vip_port_id": &schema.Schema{
Type: schema.TypeString,
Computed: true,
},

"admin_state_up": &schema.Schema{
Type: schema.TypeBool,
Default: true,
Expand Down Expand Up @@ -145,6 +150,7 @@ func resourceLoadBalancerV2Read(d *schema.ResourceData, meta interface{}) error
d.Set("vip_subnet_id", lb.VipSubnetID)
d.Set("tenant_id", lb.TenantID)
d.Set("vip_address", lb.VipAddress)
d.Set("vip_port_id", lb.VipPortID)
d.Set("admin_state_up", lb.AdminStateUp)
d.Set("flavor", lb.Flavor)
d.Set("provider", lb.Provider)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package openstack

import (
"fmt"
"regexp"
"testing"

"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/lbaas_v2/loadbalancers"
Expand All @@ -27,6 +28,7 @@ func TestAccLBV2LoadBalancer_basic(t *testing.T) {
Config: TestAccLBV2LoadBalancerConfig_update,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("openstack_lb_loadbalancer_v2.loadbalancer_1", "name", "tf_test_loadbalancer_v2_updated"),
resource.TestMatchResourceAttr("openstack_lb_loadbalancer_v2.loadbalancer_1", "vip_port_id", regexp.MustCompile("^[a-f0-9-]+")),
),
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The following arguments are supported:
`OS_REGION_NAME` environment variable is used. Changing this creates a new
LB member.

* `vip_subnet_id` - (Required) The network on which to allocate the
* `vip_subnet_id` - (Required) The network on which to allocate the
Loadbalancer's address. A tenant can only create Loadbalancers on networks
authorized by policy (e.g. networks that belong to them or networks that
are shared). Changing this creates a new loadbalancer.
Expand All @@ -40,13 +40,13 @@ The following arguments are supported:
* `tenant_id` - (Optional) Required for admins. The UUID of the tenant who owns
the Loadbalancer. Only administrative users can specify a tenant UUID
other than their own. Changing this creates a new loadbalancer.

* `vip_address` - (Optional) The ip address of the load balancer.
Changing this creates a new loadbalancer.

* `admin_state_up` - (Optional) The administrative state of the Loadbalancer.
A valid value is true (UP) or false (DOWN).

* `flavor` - (Optional) The UUID of a flavor. Changing this creates a new
loadbalancer.

Expand All @@ -66,3 +66,4 @@ The following attributes are exported:
* `admin_state_up` - See Argument Reference above.
* `flavor` - See Argument Reference above.
* `provider` - See Argument Reference above.
* `vip_port_id` - The Port ID of the Load Balancer IP.