Module: Pagoda::Apis::App

Included in:
Client
Defined in:
lib/pagoda-client/apis/app.rb

Instance Method Summary collapse

Instance Method Details

#app_available?(app) ⇒ Boolean

Get

Returns:

  • (Boolean)


8
9
10
# File 'lib/pagoda-client/apis/app.rb', line 8

def app_available?(app)
  json get("/apps/#{app}/available.json")
end

#app_create(name) ⇒ Object

post



41
42
43
44
# File 'lib/pagoda-client/apis/app.rb', line 41

def app_create(name)
  user_id = [:id]
  json post("/apps", {:app => {:name => name, :owner_id => user_id, :git_repo_attributes => { :fork_url=>"" }}})
end

#app_deploy(app, branch, commit) ⇒ Object



50
51
52
# File 'lib/pagoda-client/apis/app.rb', line 50

def app_deploy(app, branch, commit)
  post("/apps/#{app}/deploys", {:deploy => {:git_branch => branch, :commit => commit}})
end

#app_deploy_latest(app) ⇒ Object



46
47
48
# File 'lib/pagoda-client/apis/app.rb', line 46

def app_deploy_latest(app)
  post("/apps/#{app}/deploys")
end

#app_destroy(app) ⇒ Object

Delete



67
68
69
# File 'lib/pagoda-client/apis/app.rb', line 67

def app_destroy(app)
  delete("/apps/#{app}.json")
end

#app_fast_forward(app) ⇒ Object



58
59
60
# File 'lib/pagoda-client/apis/app.rb', line 58

def app_fast_forward(app)
  # Not sure what goes in here yet
end

#app_info(app) ⇒ Object



16
17
18
# File 'lib/pagoda-client/apis/app.rb', line 16

def app_info(app)
  json get("/apps/#{app}.json")
end

#app_listObject



12
13
14
# File 'lib/pagoda-client/apis/app.rb', line 12

def app_list
  json get("/apps.json")
end

#app_rollback(app) ⇒ Object



54
55
56
# File 'lib/pagoda-client/apis/app.rb', line 54

def app_rollback(app)
  json post("/apps/#{app}/deploys/rollback")
end

#app_scale_down(app, qty = 1) ⇒ Object



29
30
31
# File 'lib/pagoda-client/apis/app.rb', line 29

def app_scale_down(app, qty=1)
  put("/apps/#{app}/scale-down", {:quantity => qty})
end

#app_scale_up(app, qty = 1) ⇒ Object



25
26
27
# File 'lib/pagoda-client/apis/app.rb', line 25

def app_scale_up(app, qty=1)
  put("/apps/#{app}/scale-up", {:quantity => qty})
end

#app_update(app, updates) ⇒ Object



33
34
35
# File 'lib/pagoda-client/apis/app.rb', line 33

def app_update(app, updates)
  put("/apps/#{app}", {:app => updates}).to_s
end