Skip to content

Commit

Permalink
rename mashape-analytics to galileo
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultcha committed May 23, 2016
1 parent aff24eb commit df70338
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 50 deletions.
10 changes: 5 additions & 5 deletions kong-0.8.1-0.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ build = {
["kong.plugins.runscope.schema"] = "kong/plugins/runscope/schema.lua",
["kong.plugins.runscope.log"] = "kong/plugins/runscope/log.lua",

["kong.plugins.mashape-analytics.migrations.cassandra"] = "kong/plugins/mashape-analytics/migrations/cassandra.lua",
["kong.plugins.mashape-analytics.handler"] = "kong/plugins/mashape-analytics/handler.lua",
["kong.plugins.mashape-analytics.schema"] = "kong/plugins/mashape-analytics/schema.lua",
["kong.plugins.mashape-analytics.buffer"] = "kong/plugins/mashape-analytics/buffer.lua",
["kong.plugins.mashape-analytics.alf"] = "kong/plugins/mashape-analytics/alf.lua",
["kong.plugins.galileo.migrations.cassandra"] = "kong/plugins/galileo/migrations/cassandra.lua",
["kong.plugins.galileo.handler"] = "kong/plugins/galileo/handler.lua",
["kong.plugins.galileo.schema"] = "kong/plugins/galileo/schema.lua",
["kong.plugins.galileo.buffer"] = "kong/plugins/galileo/buffer.lua",
["kong.plugins.galileo.alf"] = "kong/plugins/galileo/alf.lua",

["kong.plugins.rate-limiting.migrations.cassandra"] = "kong/plugins/rate-limiting/migrations/cassandra.lua",
["kong.plugins.rate-limiting.migrations.postgres"] = "kong/plugins/rate-limiting/migrations/postgres.lua",
Expand Down
2 changes: 1 addition & 1 deletion kong/constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ return {
PLUGINS_AVAILABLE = {
"ssl", "jwt", "acl", "correlation-id", "cors", "oauth2", "tcp-log", "udp-log", "file-log",
"http-log", "key-auth", "hmac-auth", "basic-auth", "ip-restriction",
"mashape-analytics", "request-transformer", "response-transformer",
"galileo", "request-transformer", "response-transformer",
"request-size-limiting", "rate-limiting", "response-ratelimiting", "syslog",
"loggly", "datadog", "runscope", "ldap-auth", "statsd"
},
Expand Down
2 changes: 1 addition & 1 deletion kong/dao/factory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ local function migrate(self, identifier, migrations_modules, cur_migrations, on_
end

-- record success
err = _db:record_migration(identifier, migration.name)
--err = _db:record_migration(identifier, migration.name)
if err then
return false, string.format("Error recording migration %s: %s", migration.name, err)
end
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
31 changes: 31 additions & 0 deletions kong/plugins/galileo/migrations/cassandra.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
return {
{
name = "2016-04-15_galileo-import-mashape-analytics",
up = function(_, _, dao)
local rows, err = dao.plugins:find_all {name = "mashape-analytics"}
if err then return err end

for i = 1, #rows do
local analytics = rows[i]
local _, err = dao.plugins:insert {
name = "galileo",
api_id = analytics.api_id,
enabled = analytics.enabled,
config = {
service_token = analytics.config.service_token,
environment = analytics.config.environment,
host = analytics.config.host,
port = analytics.config.port,
log_bodies = analytics.config.log_body,
queue_size = analytics.config.batch_size,
flush_timeout = analytics.config.delay
}
}
if err then return err end

_, err = dao.plugins:delete(analytics)
if err then return err end
end
end
}
}
31 changes: 31 additions & 0 deletions kong/plugins/galileo/migrations/postgres.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
return {
{
name = "2016-04-15_galileo-import-mashape-analytics",
up = function(_, _, dao)
local rows, err = dao.plugins:find_all {name = "mashape-analytics"}
if err then return err end

for i = 1, #rows do
local analytics = rows[i]
local _, err = dao.plugins:insert {
name = "galileo",
api_id = analytics.api_id,
enabled = analytics.enabled,
config = {
service_token = analytics.config.service_token,
environment = analytics.config.environment,
host = analytics.config.host,
port = analytics.config.port,
log_bodies = analytics.config.log_body,
queue_size = analytics.config.batch_size,
flush_timeout = analytics.config.delay
}
}
if err then return err end

_, err = dao.plugins:delete(analytics)
if err then return err end
end
end
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
return {
fields = {
environment = {type = "string"},
retry_count = {type = "number", default = 0},
queue_size = {type = "number", default = 500},
retry_count = {type = "number", default = 10},
queue_size = {type = "number", default = 1000},
flush_timeout = {type = "number", default = 2},
log_bodies = {type = "boolean", default = false},
service_token = {type = "string", required = true},
Expand Down
41 changes: 0 additions & 41 deletions kong/plugins/mashape-analytics/migrations/cassandra.lua

This file was deleted.

0 comments on commit df70338

Please sign in to comment.