Sha256: 79fb92d5b17ea781c84755073fb0c2893413a08fdb41e74d98d7f9c0644de700
Contents?: true
Size: 1.17 KB
Versions: 15
Compression:
Stored size: 1.17 KB
Contents
require_dependency "redhat_access/application_controller" module RedhatAccess class TelemetryConfigurationsController < ApplicationController include RedhatAccess::Telemetry::LookUps def show #TODO require current ORG conf = get_telemetry_config(Organization.current) render json: conf.to_json(:except => [ :id, :created_at, :portal_password ,:updated_at]) end def update #TODO require current ORG conf = get_telemetry_config(Organization.current) if conf begin if conf.update_attributes(telemetry_configuration_params) render json: {:message => "config updated"} else render json: {:error=>"Invalid parameters"}.to_json, status: 400 end rescue => e Rails.logger.info(e) render json: {:error=>"Error processing update"}.to_json, status: 500 end else render json: {:error=>"Configurationnotfound"}.to_json, status: 404 end end private def telemetry_configuration_params params.require(:telemetry_configuration).permit(:enable_telemetry, :portal_password, :portal_user, :organization_id, :email) end end end
Version data entries
15 entries across 15 versions & 1 rubygems