'ipAddressSubnet': netmask,
'description': subnet['name'],
'gateway': subnet['gateway_ip'],
+ 'dhcp': subnet['enable_dhcp'],
+ 'dnsServersList': subnet['dns_nameservers'],
'networkAddress': network_address,
'tenantId': subnet['tenant_id']}
return self._post(self.ip_pool_path % subnet['id'],
body=body)
+ def update_ip_pool(self, subnet):
+ """
+ Update an ip-pool on the VSM.
+
+ :param subnet: subnet dictionary
+ """
+ body = {'description': subnet['name'],
+ 'dhcp': subnet['enable_dhcp'],
+ 'dnsServersList': subnet['dns_nameservers']}
+ return self._post(self.ip_pool_path % subnet['id'],
+ body=body)
+
def delete_ip_pool(self, subnet_id):
"""
Delete an ip-pool on the VSM.
LOG.debug(_('_send_create_subnet_request: %s'), subnet['id'])
n1kvclient = n1kv_client.Client()
n1kvclient.create_ip_pool(subnet)
- body = {'ipPool': subnet['id']}
- n1kvclient.update_network_segment(subnet['network_id'], body=body)
+
+ def _send_update_subnet_request(self, subnet):
+ """
+ Send update subnet request to VSM.
+
+ :param subnet: subnet dictionary
+ """
+ LOG.debug(_('_send_update_subnet_request: %s'), subnet['name'])
+ n1kvclient = n1kv_client.Client()
+ n1kvclient.update_ip_pool(subnet)
def _send_delete_subnet_request(self, context, subnet):
"""
sub = super(N1kvNeutronPluginV2, self).update_subnet(context,
id,
subnet)
+ self._send_update_subnet_request(sub)
return sub
def delete_subnet(self, context, id):