Module: ForemanPatch::Ticket::API
- Included in:
- AffectedItems, ChangeRequest
- Defined in:
- app/services/foreman_patch/ticket/api.rb
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
- #delete(path) ⇒ Object
- #get(path, params = {}) ⇒ Object
- #host ⇒ Object
- #post(path, payload, params = {}) ⇒ Object
- #proxy ⇒ Object
- #put(path, payload, params = {}) ⇒ Object
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
4 5 6 |
# File 'app/services/foreman_patch/ticket/api.rb', line 4 def request @request end |
Instance Method Details
#delete(path) ⇒ Object
28 29 30 |
# File 'app/services/foreman_patch/ticket/api.rb', line 28 def delete(path) send_request(:delete, path) end |
#get(path, params = {}) ⇒ Object
16 17 18 |
# File 'app/services/foreman_patch/ticket/api.rb', line 16 def get(path, params = {}) send_request(:get, path, params) end |
#host ⇒ Object
6 7 8 |
# File 'app/services/foreman_patch/ticket/api.rb', line 6 def host Setting[:ticket_api_host] end |
#post(path, payload, params = {}) ⇒ Object
20 21 22 |
# File 'app/services/foreman_patch/ticket/api.rb', line 20 def post(path, payload, params = {}) send_request(:post, path, params, payload) end |
#proxy ⇒ Object
10 11 12 13 14 |
# File 'app/services/foreman_patch/ticket/api.rb', line 10 def proxy return nil if Setting[:ticket_api_proxy].blank? HttpProxy.friendly.find(Setting[:ticket_api_proxy])&.url end |
#put(path, payload, params = {}) ⇒ Object
24 25 26 |
# File 'app/services/foreman_patch/ticket/api.rb', line 24 def put(path, payload, params = {}) send_request(:put, path, params, payload) end |