provider/openstack: Allow port_id for router interface

This commit is contained in:
Kirill Shirinkin 2015-11-09 09:38:35 +01:00 committed by Joe Topjian
parent 2dbd9b47e4
commit 3a1a242a7a
2 changed files with 13 additions and 2 deletions

View File

@ -33,7 +33,12 @@ func resourceNetworkingRouterInterfaceV2() *schema.Resource {
},
"subnet_id": &schema.Schema{
Type: schema.TypeString,
Required: true,
Optional: true,
ForceNew: true,
},
"port_id": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ForceNew: true,
},
},
@ -49,6 +54,7 @@ func resourceNetworkingRouterInterfaceV2Create(d *schema.ResourceData, meta inte
createOpts := routers.InterfaceOpts{
SubnetID: d.Get("subnet_id").(string),
PortID: d.Get("port_id").(string),
}
log.Printf("[DEBUG] Create Options: %#v", createOpts)
@ -148,6 +154,7 @@ func waitForRouterInterfaceDelete(networkingClient *gophercloud.ServiceClient, d
removeOpts := routers.InterfaceOpts{
SubnetID: d.Get("subnet_id").(string),
PortID: d.Get("port_id").(string),
}
r, err := ports.Get(networkingClient, routerInterfaceId).Extract()

View File

@ -49,7 +49,10 @@ The following arguments are supported:
* `router_id` - (Required) ID of the router this interface belongs to. Changing
this creates a new router interface.
* `subnet_id` - (Required) ID of the subnet this interface connects to. Changing
* `subnet_id` - ID of the subnet this interface connects to. Changing
this creates a new router interface.
* `port_id` - ID of the port this interface connects to. Changing
this creates a new router interface.
## Attributes Reference
@ -59,3 +62,4 @@ The following attributes are exported:
* `region` - See Argument Reference above.
* `router_id` - See Argument Reference above.
* `subnet_id` - See Argument Reference above.
* `port_id` - See Argument Reference above.