Skip to content

Commit

Permalink
Add distributed routers support
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Shirinkin committed Feb 12, 2016
1 parent fe90cea commit 1df7f81
Show file tree
Hide file tree
Showing 15 changed files with 190 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ func resourceNetworkingRouterV2() *schema.Resource {
ForceNew: false,
Computed: true,
},
"distributed": &schema.Schema{
Type: schema.TypeBool,
Option: true,
ForceNew: true,
Computed: true,
},
"external_gateway": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -69,6 +75,11 @@ func resourceNetworkingRouterV2Create(d *schema.ResourceData, meta interface{})
createOpts.AdminStateUp = &asu
}

if dRaw, ok := d.GetOk("distributed"); ok {
d := dRaw.(bool)
createOpts.Distributed = &d
}

externalGateway := d.Get("external_gateway").(string)
if externalGateway != "" {
gatewayInfo := routers.GatewayInfo{
Expand Down Expand Up @@ -126,6 +137,7 @@ func resourceNetworkingRouterV2Read(d *schema.ResourceData, meta interface{}) er

d.Set("name", n.Name)
d.Set("admin_state_up", n.AdminStateUp)
d.Set("distributed", n.Distributed)
d.Set("tenant_id", n.TenantID)
d.Set("external_gateway", n.GatewayInfo.NetworkID)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ var testAccNetworkingV2Router_basic = fmt.Sprintf(`
resource "openstack_networking_router_v2" "foo" {
name = "router"
admin_state_up = "true"
distributed = "false"
}`)

var testAccNetworkingV2Router_update = fmt.Sprintf(`
resource "openstack_networking_router_v2" "foo" {
name = "router_2"
admin_state_up = "true"
distributed = "false"
}`)
43 changes: 39 additions & 4 deletions vendor/github.com/rackspace/gophercloud/openstack/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1df7f81

Please sign in to comment.