Beispiel #1
0
 def post(self, dep):
     """Create a new deployable.
     :param dep: a deployable within the request body.
     """
     context = pecan.request.context
     obj_dep = objects.Deployable(context, **dep)
     new_dep = pecan.request.conductor_api.deployable_create(
         context, obj_dep)
     # Set the HTTP Location Header
     pecan.response.location = link.build_url('deployables', new_dep.uuid)
     return Deployable.convert_with_links(new_dep)
Beispiel #2
0
    def post(self, port):
        """Create a new port.

        :param port: an port within the request body.
        """
        context = pecan.request.context
        rpc_port = objects.Port(context, **port)
        new_port = pecan.request.conductor_api.port_create(context, rpc_port)
        # Set the HTTP Location Header
        pecan.response.location = link.build_url('ports', new_port.uuid)
        return Port.convert_with_links(new_port)
Beispiel #3
0
    def post(self, accelerator):
        """Create a new accelerator.

        :param accelerator: an accelerator within the request body.
        """
        context = pecan.request.context
        rpc_acc = objects.Accelerator(context, **accelerator)
        new_acc = pecan.request.conductor_api.accelerator_create(
            context, rpc_acc)
        # Set the HTTP Location Header
        pecan.response.location = link.build_url('accelerators', new_acc.uuid)
        return Accelerator.convert_with_links(new_acc)