예제 #1
0
 def callback(resp):
     if not http_success(resp.code):
         self._error(500)
         return
     self._process['server_kill'] = 2
     logger.debug("Killed the server succesfully")
     self._continue()
예제 #2
0
 def callback(resp):
     if not http_success(resp.code):
         raise HTTPError(resp.code)
     try:
         j = json.loads(resp.body)
         log = j['output']
     except:
         log = ''
     self.write({'output': log})
     self.finish()
예제 #3
0
 def callback(resp):
     if not http_success(resp.code):
         raise HTTPError(resp.code)
     try:
         j = json.loads(resp.body)
         addr = j['server']['addresses']
         ip_address = addr[addr.keys()[0]][0]['addr']
     except:
         ip_address = ''
     self.write({'output': {'ip_address': ip_address}})
     self.finish()
예제 #4
0
 def callback(resp):
     if not http_success(resp.code):
         raise HTTPError(resp.code)
     try:
         j = json.loads(resp.body)
         limits = j['limits']['absolute']
         self.write({'output': {
             'servers': [limits['totalInstancesUsed'],
                         limits['maxTotalInstances']],
             'cores': [limits['totalCoresUsed'],
                       limits['maxTotalCores']],
             'ram': [limits['totalRAMUsed'],
                     limits['maxTotalRAMSize']]}})
     except:
         raise HTTPError(500)
     self.finish()
예제 #5
0
 def callback(resp):
     if not http_success(resp.code):
         raise HTTPError(resp.code)
     try:
         j = json.loads(resp.body)
         out = []
         for srv in j['servers']:
             addr = srv['addresses']
             try:
                 ip_address = addr[addr.keys()[0]][0]['addr']
             except:
                 ip_address = ''
             # TODO: meta-data to detect a Nexel instance or snapshot in process
             out.append({'id': srv['id'],
                         'name': srv['name'],
                         'created': srv['created'],
                         'ip_address': ip_address})
         self.write({'output': out})
     except:
         raise HTTPError(500)
     self.finish()
예제 #6
0
 def callback(resp):
     if not http_success(resp.code):
         raise HTTPError(resp.code)
     self.write({'output': json.loads(resp.body)})
     self.finish()
예제 #7
0
 def callback(resp):
     if not http_success(resp.code):
         raise HTTPError(resp.code)
     self.finish()