Permalink
Browse files

updates

  • Loading branch information...
1 parent f130d03 commit a6095226e6894aab531051ce309f03fa649ae685 @AndreCharbonneau AndreCharbonneau committed Apr 10, 2013
Showing with 37 additions and 18 deletions.
  1. +15 −0 README.md
  2. +8 −7 wsgi/conf/rpi-api.conf.sample
  3. +7 −4 wsgi/services/base.py
  4. +7 −7 wsgi/services/cloudscheduler.py
View
@@ -0,0 +1,15 @@
+Introduction
+============
+
+This repository contains the implementation of the RPI API, as specified by CANARIE's "RPI API Enhancements for CANARIE Service Registry and Monitoring System", for the following components:
+
+* Cloud Scheduler
+* CVMFS
+
+Developers will most likely be interested in editing the following 2 classes:
+
+* wsgi/services/cloudscheduler.py
+* wsgi/services/cvmfs.py
+
+More documentation is available online at: https://rpi.heprc.uvic.ca/ under "Documentation".
+
@@ -4,12 +4,12 @@ xmlrpc_server=http://condor.heprc.uvic.ca:8111
name=Cloud Scheduler
synopsis=A service to schedule work between clouds.
institution=UVIC HEP Group
-version=?
+version=1.4
# release_time must be a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SS)
-release_time=?
-invocations=0
+release_time=2012-01-01T00:00:00
+invocations=100000000
# last_reset must be a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SS)
-last_reset=?
+#last_reset=
documentation=?
release_notes=?
support=?
@@ -24,12 +24,13 @@ synopsis=CVMFS is a scalable read-only HTTP file system designed for distributed
institution=UVIC HEP Group
version=?
# release_time must be a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SS)
-release_time=?
+#release_time=
invocations=0
# last_reset must be a timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SS)
-last_reset=?
+#last_reset=
documentation=?
release_notes=?
support=?
#source=
-#tryme=
+#tryme=
+
View
@@ -53,7 +53,7 @@ def _parseISOTimestamp(self, timestamp):
return None
else:
# convert the ISO8601 string to a datetime object
- converted = datetime.datetime.strptime(timestamp, "%Y%m%dT%H:%M:%S")
+ converted = datetime.datetime.strptime(timestamp, "%Y-%m-%dT%H:%M:%S")
return converted
#
@@ -148,9 +148,12 @@ def stats(self):
d = {}
d['invocations'] = str(self.getInvocations())
dt = self.getLastReset()
- if (dt.tzinfo != None) and (dt.utcoffset() != None):
- dt = dt.astimezone(pytz.utc)
- d['lastReset'] = dt.strftime('%a %b %d %Y %H:%M:%S')
+ if dt != None:
+ if (dt.tzinfo != None) and (dt.utcoffset() != None):
+ dt = dt.astimezone(pytz.utc)
+ d['lastReset'] = dt.strftime('%a %b %d %Y %H:%M:%S')
+ else:
+ d['releaseTime'] = ''
if acceptHeader == 'application/json':
return json.dumps(d)
@@ -7,14 +7,14 @@ class CloudSchedulerService(RpiService):
# proxy = xmlrpclib.ServerProxy(self._getXmlRpcServer())
# return proxy.get_version()
- def getReleaseTime(self):
- """
- Must return a datetime.datetime object.
- """
- return datetime.datetime.now()
+# def getReleaseTime(self):
+# """
+# Must return a datetime.datetime object.
+# """
+# return datetime.datetime.now()
- def getInvocations(self):
- return 0
+# def getInvocations(self):
+# return 0
def getLastReset(self):
return datetime.datetime.now()

0 comments on commit a609522

Please sign in to comment.