Beispiel #1
0
 def handle(self, request, context):
     try:
         requestapi = RequestApi()
         res = requestapi.postRequestInfo('api/heterogeneous/platforms',
                                          context)
         if res.get('action') == 'success':
             return True
     except Exception as e:
         pass
     return False
Beispiel #2
0
 def handle(self, request, data):
     try:
         requestapi = RequestApi()
         data['datacentersandclusters'] = json.loads(data['datacentersandclusters'])
         res = requestapi.postRequestInfo('api/heterogeneous/platforms/sync',data)
         if res.get('action') == 'success':
             messages.success(request,_('Success to synchronize the control center.'))
             return True
     except Exception as e:
         exceptions.handle(request,
                           _('Unable to synchronize the control center.'))
     return False