def create_network(self, **kwargs): # Supply defaults that are expected to be set by the api # framwork kwargs.setdefault('admin_state_up', True) kwargs.setdefault('shared', False) data = dict(network=kwargs) result = self.plugin.create_network(self.ctx, data) return base_v2.AttributeDict(result)
def get_networks(self, *args, **kwargs): result = self.plugin.get_networks(self.ctx, *args, **kwargs) return [base_v2.AttributeDict(x) for x in result]
def get_network(self, *args, **kwargs): result = self.plugin.get_network(self.ctx, *args, **kwargs) return base_v2.AttributeDict(result)
def update_network(self, id_, **kwargs): data = dict(network=kwargs) result = self.plugin.update_network(self.ctx, id_, data) return base_v2.AttributeDict(result)
def get_networks(self, **kwargs): body = self.client.list_networks(**kwargs) return [base_v2.AttributeDict(x) for x in body['networks']]
def get_network(self, id_, **kwargs): body = self.client.show_network(id_, **kwargs) return base_v2.AttributeDict(body['network'])
def update_network(self, id_, **kwargs): body = self.client.update_network(id_, **kwargs) return base_v2.AttributeDict(body['network'])
def _create_network(self, **kwargs): # Internal method - use create_network() instead body = self.client.create_network(**kwargs) return base_v2.AttributeDict(body['network'])