Skip to content

Commit

Permalink
Add external_gateway_info param
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed May 28, 2019
1 parent 9b2c9ff commit ae9d81e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions libcloud/compute/drivers/openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -3584,7 +3584,8 @@ def ex_list_routers(self):
'/v2.0/routers').object
return self._to_routers(response)

def ex_create_router(self, name, description='', admin_state_up=True):
def ex_create_router(self, name, description='', admin_state_up=True,
external_gateway_info=None):
"""
Create a new Router
Expand All @@ -3598,16 +3599,21 @@ def ex_create_router(self, name, description='', admin_state_up=True):
resource, which is up or down
:type admin_state_up: ``bool``
:param external_gateway_info: The external gateway information
:type external_gateway_info: ``dict``
:rtype: :class:`OpenStack_2_Router`
"""
data = {
'router':
{
'name': name or '',
'description': description or '',
'admin_state_up': admin_state_up
'admin_state_up': admin_state_up,
}
}
if external_gateway_info:
data['router']['external_gateway_info'] = external_gateway_info
response = self.network_connection.request(
'/v2.0/routers', method='POST', data=data).object
return self._to_router(response['router'])
Expand Down

0 comments on commit ae9d81e

Please sign in to comment.