def get_network(self, context, id, fields=None): flavor = meta_db_v2.get_flavor_by_network(id) plugin = self._get_plugin(flavor) net = plugin.get_network(context, id, fields) if not fields or FLAVOR_NETWORK in fields: self._extend_network_dict(context, net) return net
def get_network(self, context, id, fields=None): flavor = meta_db_v2.get_flavor_by_network(id) plugin = self._get_plugin(flavor) net = plugin.get_network(context, id, fields) if not fields or 'flavor:id' in fields: self._extend_network_dict(context, net) return net
def update_network(self, context, id, network): flavor = meta_db_v2.get_flavor_by_network(context.session, id) plugin = self._get_plugin(flavor) with context.session.begin(subtransactions=True): net = plugin.update_network(context, id, network) if not self._is_l3_plugin(plugin): self._process_l3_update(context, network["network"], id) self._extend_network_dict_l3(context, net) return net
def update_network(self, context, id, network): flavor = meta_db_v2.get_flavor_by_network(context.session, id) plugin = self._get_plugin(flavor) with context.session.begin(subtransactions=True): net = plugin.update_network(context, id, network) if not self._is_l3_plugin(plugin): self._process_l3_update(context, network['network'], id) self._extend_network_dict_l3(context, net) return net
def get_network(self, context, id, fields=None): flavor = meta_db_v2.get_flavor_by_network(context.session, id) plugin = self._get_plugin(flavor) net = plugin.get_network(context, id, fields) net["id"] = id if not fields or "router:external" in fields: self._extend_network_dict_l3(context, net) if not fields or FLAVOR_NETWORK in fields: self._extend_network_dict(context, net) if fields and not "id" in fields: del net["id"] return net
def get_network(self, context, id, fields=None): flavor = meta_db_v2.get_flavor_by_network(context.session, id) plugin = self._get_plugin(flavor) net = plugin.get_network(context, id, fields) net['id'] = id if not fields or 'router:external' in fields: self._extend_network_dict_l3(context, net) if not fields or FLAVOR_NETWORK in fields: self._extend_network_dict(context, net) if fields and 'id' not in fields: del net['id'] return net
def _get_flavor_by_network_id(self, network_id): return meta_db_v2.get_flavor_by_network(network_id)
def delete_network(self, context, id): flavor = meta_db_v2.get_flavor_by_network(id) plugin = self._get_plugin(flavor) return plugin.delete_network(context, id)
def _get_flavor_by_network_id(self, context, network_id): return meta_db_v2.get_flavor_by_network(context.session, network_id)
def delete_network(self, context, id): flavor = meta_db_v2.get_flavor_by_network(context.session, id) plugin = self._get_plugin(flavor) return plugin.delete_network(context, id)