Class: Service
- Defined in:
- lib/resources/service.rb
Instance Method Summary collapse
- #containerstats_token ⇒ Object
- #finish_upgrade ⇒ Object
- #request_token ⇒ Object
- #upgrade(attributes) ⇒ Object
Instance Method Details
#containerstats_token ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/resources/service.rb', line 6 def containerstats_token attributes = { 'follow': true, 'lines': 500 } request_token(:logs, attributes) end |
#finish_upgrade ⇒ Object
24 25 26 27 |
# File 'lib/resources/service.rb', line 24 def finish_upgrade response = post(nil, {action: :finishupgrade}) JSON.parse(response.body) end |
#request_token ⇒ Object
14 15 16 17 |
# File 'lib/resources/service.rb', line 14 def request_token response = get(:containerstats) {token: response['token'], url: response['url']} end |
#upgrade(attributes) ⇒ Object
19 20 21 22 |
# File 'lib/resources/service.rb', line 19 def upgrade(attributes) response = post(nil, {action: :upgrade}, attributes.to_json) JSON.parse(response.body) end |