def delete(self): ''' remove an existing node ''' log.info('request node destruction', user=flask.g.get('user')) node = NodeFoundation(self.default_image, self._node_name()) unregistration, success = node.forget() feedback = node.destroy() feedback.update({ 'unregistration': { 'message': unregistration, 'success': success } }) return feedback
def post(self): ''' Create and register a new node ''' log.info('request node creation', user=flask.g.get('user')) node = NodeFoundation(self.default_image, self._node_name()) feedback = node.activate() # Wait for the node to boot registration, success = node.register() feedback.update( {'registration': { 'message': registration, 'success': success }}) return feedback
def setUp(self): self.node = NodeFoundation(self.image_test, self.name_test, self.role_test)
def get(self): ''' Fetch and return node informations ''' log.info('request node information', user=flask.g.get('user')) return NodeFoundation(self.default_image, self._node_name()).inspect()
def post(self): ''' Create and register a new node ''' log.info('request node creation', user=flask.g.get('user')) node = NodeFoundation(self.default_image, self._node_name()) feedback = node.activate() # Wait for the node to boot registration, success = node.register() feedback.update({ 'registration': { 'message': registration, 'success': success } }) return feedback