Example #1
0
    def post(self, public_key):
        """
          Receives a request for a new Instance
        """
        try:
            instance = Instance.create_from_args(self.params.post, public_key)
            job_id = InstanceTask().start(instance.instance_id)
        except Exception as ex:
            logger.error(ex.message)
            return abort(500)

        return marshal_and_count('instances',
                                 instance,
                                 f=self.params.fields,
                                 job_id=job_id)