Skip to content

Commit

Permalink
create new crontabber service for current mware
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnen committed Feb 21, 2013
1 parent 2b3f32e commit 8276114
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
2 changes: 2 additions & 0 deletions scripts/config/webapiconfig.py.dist
Expand Up @@ -157,6 +157,7 @@ import socorro.middleware.releases_featured_service as releases_featured
import socorro.middleware.server_status_service as server_status
import socorro.middleware.crashes_daily_service as crashes_daily
import socorro.middleware.platforms_service as platforms
import socorro.middleware.crontabber_state_service as crontabber_state

servicesList = cm.Option()
servicesList.doc = 'a python list of classes to offer as services'
Expand Down Expand Up @@ -192,6 +193,7 @@ servicesList.default = [
server_status.ServerStatus,
crashes_daily.CrashesDaily,
platforms.Platforms,
crontabber_state.CrontabberState
]

crashBaseUrl = cm.Option()
Expand Down
3 changes: 1 addition & 2 deletions socorro/external/postgresql/crontabber_state.py
Expand Up @@ -15,8 +15,7 @@ class CrontabberState(PostgreSQLBase):
"""Implement the /crontabber_state service with PostgreSQL. """

def get(self, **kwargs):
"""Return the current state of the server and the revisions of Socorro
and Breakpad. """
"""Return the current state of all Crontabber jobs"""
sql = (
'/* socorro.external.postgresql.crontabber_state.CrontabberState'
'.get */\n'
Expand Down
27 changes: 27 additions & 0 deletions socorro/middleware/crontabber_state_service.py
@@ -0,0 +1,27 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import logging

from socorro.middleware.service import DataAPIService

logger = logging.getLogger("webapi")


class CrontabberState(DataAPIService):
"""Return the current state of Crontabber jobs"""

service_name = "crontabber_state"
uri = "/crontabber_state/(.*)"

def __init__(self, config):
super(CrontabberState, self).__init__(config)
logger.debug('CrontabberState service __init__')

def get(self, *args):
"""Called when a GET HTTP request is executed to /crontabber_state"""
params = self.parse_query_string(args[0])
module = self.get_module(params)
impl = module.CrontabberState(config=self.context)
return impl.get(**params)

0 comments on commit 8276114

Please sign in to comment.