Sha256: 0f35f047f5ce6e1331d07fd6ad55a6587819547867fae40dacf881afa4215b72
Contents?: true
Size: 1.17 KB
Versions: 36
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
36 entries across 36 versions & 1 rubygems