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

providers/openstack: add port_id to router interface #3815

Closed
wants to merge 7 commits into from
Closed
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 @@ -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,
},
},
Expand All @@ -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)
Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.