Class: Service

Inherits:
Base
  • Object
show all
Defined in:
lib/resources/service.rb

Instance Method Summary collapse

Instance Method Details

#containerstats_tokenObject



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_upgradeObject



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_tokenObject



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