Commit ef150497 authored by Rafael Monnerat's avatar Rafael Monnerat

Define REST API for software release

parent c044d7bc
......@@ -97,19 +97,14 @@ def setComputerPartitionConnectionJson(computer_id, computer_partition_id):
execute_db('partition', query, argument_list)
return 'done'
@app.route('/buildingSoftwareRelease', methods=['POST'])
def buildingSoftwareRelease():
return 'Ignored'
@app.route('/availableSoftwareRelease', methods=['POST'])
def availableSoftwareRelease():
computer_id = request.form['computer_id']
@app.route('/<computer_id>/software/building', methods=['POST'])
@app.route('/<computer_id>/software/available', methods=['POST'])
def software_release_ignored_api(computer_id):
url = request.form['url']
return 'Ignored'
@app.route('/softwareReleaseError', methods=['POST'])
def softwareReleaseError():
return 'Ignored'
@app.route('/<computer_id>/software/error', methods=['POST'])
def softwareReleaseError(computer_id):
@app.route('/<computer_id>/partition/<computer_partition_id>/building', methods=['POST'])
def buildingComputerPartition(computer_id, computer_partition_id):
......
......@@ -107,23 +107,23 @@ class SoftwareRelease(SlapDocument):
def error(self, error_log):
# Does not follow interface
self._connection_helper.POST('/softwareReleaseError', {
url = '%s/software/error' % self._computer_guid,
self._connection_helper.POST(url, {
'url': self._software_release,
'computer_id' : self._computer_guid,
'error_log': error_log})
def getURI(self):
return self._software_release
def available(self):
self._connection_helper.POST('/availableSoftwareRelease', {
'url': self._software_release,
'computer_id': self._computer_guid})
url = '%s/software/available' % self._computer_guid
self._connection_helper.POST(url, {
'url': self._software_release})
def building(self):
self._connection_helper.POST('/buildingSoftwareRelease', {
'url': self._software_release,
'computer_id': self._computer_guid})
url = '%s/software/building' % self._computer_guid
self._connection_helper.POST(url, {
'url': self._software_release})
"""Exposed exceptions"""
# XXX Why do we need to expose exceptions?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment