(self)
return error.check_return_status(response, logger)
Save the aggregation group in the database.
Save the aggregation group in the database.
Save the aggregation group in the database .
def save(self):
        """Save the aggregation group in the database."""
        if not self._aggregations:
            return False

        data = {
            'name': self._name,
            'description': self._description,
            'parameters': json.dumps(self._parameters),
            'aggregations': json.dumps([x.id for x in self._aggregations]),
            'orientation': self._orientation,
        }

        if self._resource_id:
            res_url = '{0:s}/sketches/{1:d}/aggregation/group/{2:d}/'.format(
                self.api.api_root, self._sketch.id, self._resource_id)
        else:
            res_url = '{0:s}/sketches/{1:d}/aggregation/group/'.format(
                self.api.api_root, self._sketch.id)

        response = self.api.session.post(res_url, json=data)
        _ = self.lazyload_data(refresh_cache=True)
        return error.check_return_status(response, logger)
def save ( self ) : if not self . _aggregations : return False data = { 'name' : self . _name , 'description' : self . _description , 'parameters' : json . dumps ( self . _parameters ) , 'aggregations' : json . dumps ( [ x . id for x in self . _aggregations ] ) , 'orientation' : self . _orientation , } if self . _resource_id : res_url = '{0:s}/sketches/{1:d}/aggregation/group/{2:d}/' . format ( self . api . api_root , self . _sketch . id , self . _resource_id ) else : res_url = '{0:s}/sketches/{1:d}/aggregation/group/' . format ( self . api . api_root , self . _sketch . id ) response = self . api . session . post ( res_url , json = data ) _ = self . lazyload_data ( refresh_cache = True ) return error . check_return_status ( response , logger )