New versions 0.16.0 (client), 0.23.0 (server), 0.15.0 (python)

This commit is contained in:
Javier Goizueta
2017-03-28 17:53:40 +02:00
parent f0b0a9e7f2
commit aac89e0236
16 changed files with 7507 additions and 3 deletions

View File

@@ -0,0 +1,94 @@
--DO NOT MODIFY THIS FILE, IT IS GENERATED AUTOMATICALLY FROM SOURCES
-- Complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "ALTER EXTENSION cdb_dataservices_server UPDATE TO '0.23.0'" to load this file. \quit
CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_get_rate_limit(
username TEXT,
orgname TEXT,
service TEXT)
RETURNS JSON AS $$
import json
from cartodb_services.config import ServiceConfiguration, RateLimitsConfigBuilder
import cartodb_services
cartodb_services.init(plpy, GD)
service_config = ServiceConfiguration(service, username, orgname)
rate_limit_config = RateLimitsConfigBuilder(service_config.server, service_config.user, service_config.org, service=service, username=username, orgname=orgname).get()
if rate_limit_config.is_limited():
return json.dumps({'limit': rate_limit_config.limit, 'period': rate_limit_config.period})
else:
return None
$$ LANGUAGE plpythonu;
CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_user_rate_limit(
username TEXT,
orgname TEXT,
service TEXT,
rate_limit_json JSON)
RETURNS VOID AS $$
import json
from cartodb_services.config import RateLimitsConfig, RateLimitsConfigSetter
import cartodb_services
cartodb_services.init(plpy, GD)
config_setter = RateLimitsConfigSetter(service=service, username=username, orgname=orgname)
if rate_limit_json:
rate_limit = json.loads(rate_limit_json)
limit = rate_limit.get('limit', None)
period = rate_limit.get('period', None)
else:
limit = None
period = None
config = RateLimitsConfig(service=service, username=username, limit=limit, period=period)
config_setter.set_user_rate_limits(config)
$$ LANGUAGE plpythonu;
CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_org_rate_limit(
username TEXT,
orgname TEXT,
service TEXT,
rate_limit_json JSON)
RETURNS VOID AS $$
import json
from cartodb_services.config import RateLimitsConfig, RateLimitsConfigSetter
import cartodb_services
cartodb_services.init(plpy, GD)
config_setter = RateLimitsConfigSetter(service=service, username=username, orgname=orgname)
if rate_limit_json:
rate_limit = json.loads(rate_limit_json)
limit = rate_limit.get('limit', None)
period = rate_limit.get('period', None)
else:
limit = None
period = None
config = RateLimitsConfig(service=service, username=username, limit=limit, period=period)
config_setter.set_org_rate_limits(config)
$$ LANGUAGE plpythonu;
CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_service_set_server_rate_limit(
username TEXT,
orgname TEXT,
service TEXT,
rate_limit_json JSON)
RETURNS VOID AS $$
import json
from cartodb_services.config import RateLimitsConfig, RateLimitsConfigSetter
import cartodb_services
cartodb_services.init(plpy, GD)
config_setter = RateLimitsConfigSetter(service=service, username=username, orgname=orgname)
if rate_limit_json:
rate_limit = json.loads(rate_limit_json)
limit = rate_limit.get('limit', None)
period = rate_limit.get('period', None)
else:
limit = None
period = None
config = RateLimitsConfig(service=service, username=username, limit=limit, period=period)
config_setter.set_server_rate_limits(config)
$$ LANGUAGE plpythonu;

View File

@@ -0,0 +1,8 @@
--DO NOT MODIFY THIS FILE, IT IS GENERATED AUTOMATICALLY FROM SOURCES
-- Complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "ALTER EXTENSION cdb_dataservices_server UPDATE TO '0.22.0'" to load this file. \quit
DROP FUNCTION IF EXISTS cdb_dataservices_server.cdb_service_get_rate_limit(TEXT, TEXT, TEXT);
DROP FUNCTION IF EXISTS cdb_dataservices_server.cdb_service_set_user_rate_limit(TEXT, TEXT, TEXT, JSON);
DROP FUNCTION IF EXISTS cdb_dataservices_server.cdb_service_set_org_rate_limit(TEXT, TEXT, TEXT, JSON);
DROP FUNCTION IF EXISTS cdb_dataservices_server.cdb_service_set_server_rate_limit(TEXT, TEXT, TEXT, JSON);

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
comment = 'CartoDB dataservices server extension'
default_version = '0.22.0'
default_version = '0.23.0'
requires = 'plpythonu, plproxy, postgis, cdb_geocoder'
superuser = true
schema = cdb_dataservices_server

View File

@@ -10,7 +10,7 @@ from setuptools import setup, find_packages
setup(
name='cartodb_services',
version='0.14.1',
version='0.15.0',
description='CartoDB Services API Python Library',