def create_profile(self, request): profile_iface = PluginProfiles(self.getStore()) profile_description = profile_iface.new(request) self.returnData(profile_description) self.returnCode(201) return self.prepareRetVals()
def post(self, *uriargs): """ Request: adminProfileDesc Response: adminProfileDesc Errors: InvalidInputFormat, ProfileNameConflict """ try: # TODO input mesage validation, or InvalidInputFormat request = validateMessage(self.request.body, requests.adminProfileDesc) profile_iface = PluginProfiles() profile_description = yield profile_iface.new(request) self.set_status(200) self.write(profile_description) except InvalidInputFormat, e: self.set_status(e.http_status) self.write({'error_message': e.error_message, 'error_code' : e.error_code})