Class: Scalingo::Endpoint::App

Inherits:
Resource
  • Object
show all
Defined in:
lib/scalingo/endpoint/apps.rb

Instance Attribute Summary

Attributes included from Base

#api, #auth_api, #prefix

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Methods included from Scalingo::Endpoint

included

Methods included from ClassMethods

#resources

Methods included from Base

#initialize

Constructor Details

This class inherits a constructor from Scalingo::Endpoint::Resource

Instance Method Details

#destroy(current_name) ⇒ Object



21
22
23
# File 'lib/scalingo/endpoint/apps.rb', line 21

def destroy(current_name)
  delete(nil, current_name: current_name)
end

#destroy!Object



25
26
27
# File 'lib/scalingo/endpoint/apps.rb', line 25

def destroy!
  destroy(prefix)
end

#logsObject



45
46
47
# File 'lib/scalingo/endpoint/apps.rb', line 45

def logs
  Scalingo::Logs.new(self)
end

#logs_urlObject



41
42
43
# File 'lib/scalingo/endpoint/apps.rb', line 41

def logs_url
  get('logs')['logs_url']
end

#rename(new_name, current_name) ⇒ Object



29
30
31
# File 'lib/scalingo/endpoint/apps.rb', line 29

def rename(new_name, current_name)
  post('rename', new_name: new_name, current_name: current_name)
end

#rename!(new_name) ⇒ Object



33
34
35
# File 'lib/scalingo/endpoint/apps.rb', line 33

def rename!(new_name)
  rename(new_name, prefix)
end

#restart(*scopes) ⇒ Object



17
18
19
# File 'lib/scalingo/endpoint/apps.rb', line 17

def restart(*scopes)
  post('restart', scope: scopes)
end

#run(command, env = {}) ⇒ Object



49
50
51
# File 'lib/scalingo/endpoint/apps.rb', line 49

def run(command, env = {})
  post('run', command: command, env: env)
end

#scale(containers) ⇒ Object



13
14
15
# File 'lib/scalingo/endpoint/apps.rb', line 13

def scale(containers)
  post('scale', containers: containers)
end

#transfer(email) ⇒ Object



37
38
39
# File 'lib/scalingo/endpoint/apps.rb', line 37

def transfer(email)
  patch(nil, app: { owner: { email: email } })
end