Class: RedhatAccess::Api::AttachmentsController
Instance Method Summary
collapse
#api_request?, #http_error_response
Instance Method Details
#api_version ⇒ Object
35
36
37
|
# File 'app/controllers/redhat_access/api/attachments_controller.rb', line 35
def api_version
'v1'
end
|
#create ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'app/controllers/redhat_access/api/attachments_controller.rb', line 14
def create
data = params[:attach_payload]
begin
case_number = data[:caseNum]
sos_file = RedhatAccess::SosReports::Generator.create_report case_number
strata = RedhatAccess::Strata::Client.new(data[:authToken])
strata.api.attachment_broker.add(case_number,
false,
sos_file,
"Attachment for case #{case_number}")
render :nothing => true,
:status => 201
rescue => e
logger.error e.backtrace
render :text => "Error attaching sos file " + e.message,
:layout => false ,
:status => 500
end
end
|
#index ⇒ Object
9
10
11
12
|
# File 'app/controllers/redhat_access/api/attachments_controller.rb', line 9
def index
render :text => "SOS Report?checked=true",
:layout => false
end
|