Esempio n. 1
0
    def show(self, req, id):
        endpoint = self._endpoint_api.get_endpoint(
            req.environ["coriolis.context"], id)
        if not endpoint:
            raise exc.HTTPNotFound()

        return endpoint_view.single(req, endpoint)
Esempio n. 2
0
 def update(self, req, id, body):
     context = req.environ["coriolis.context"]
     context.can(endpoint_policies.get_endpoints_policy_label("update"))
     updated_values = self._validate_update_body(body)
     return endpoint_view.single(
         req,
         self._endpoint_api.update(req.environ['coriolis.context'], id,
                                   updated_values))
Esempio n. 3
0
    def show(self, req, id):
        context = req.environ["coriolis.context"]
        context.can(endpoint_policies.get_endpoints_policy_label("show"))
        endpoint = self._endpoint_api.get_endpoint(context, id)
        if not endpoint:
            raise exc.HTTPNotFound()

        return endpoint_view.single(req, endpoint)
Esempio n. 4
0
 def create(self, req, body):
     context = req.environ["coriolis.context"]
     context.can(endpoint_policies.get_endpoints_policy_label("create"))
     (name, endpoint_type, description, connection_info,
      mapped_regions) = self._validate_create_body(body)
     return endpoint_view.single(
         req,
         self._endpoint_api.create(context, name, endpoint_type,
                                   description, connection_info,
                                   mapped_regions))
Esempio n. 5
0
 def update(self, req, id, body):
     updated_values = self._validate_update_body(body)
     return endpoint_view.single(req, self._endpoint_api.update(
         req.environ['coriolis.context'], id, updated_values))
Esempio n. 6
0
 def create(self, req, body):
     (name, endpoint_type, description,
      connection_info) = self._validate_create_body(body)
     return endpoint_view.single(req, self._endpoint_api.create(
         req.environ['coriolis.context'], name, endpoint_type, description,
         connection_info))