Example #1
0
 def allocate_resource(self):
     if self.allocation_status == 'able':
         self.allocation_status = 'busy'
         allocator = get_resource_allocator(self._get_vendor(),
                                            self._get_credential(),
                                            self._get_app_id())
         allocator.create()
         self.allocation_status = 'able'
         return True
Example #2
0
 def get_sdk(self):
     """
     This function should be destroyed.
     You should have to use open_sdk(..) instead.
     :return:
     """
     allocator = get_resource_allocator(self._get_vendor(),
                                        self._get_credential(),
                                        self._get_app_id())
     client = Client(allocator.get_rest_api_url())
     return client
Example #3
0
 def terminate_resource(self):
     allocator = get_resource_allocator(self._get_vendor(),
                                        self._get_credential(),
                                        self._get_app_id())
     allocator.terminate()
Example #4
0
 def generate_sdk(self, platform):
     allocator = get_resource_allocator(self._get_vendor(),
                                        self._get_credential(),
                                        self._get_app_id())
     return allocator.generate_sdk(platform)
Example #5
0
 def get_rest_api_url(self):
     allocator = get_resource_allocator(self._get_vendor(),
                                        self._get_credential(),
                                        self._get_app_id())
     return allocator.get_rest_api_url()