Class: Zillabyte::API::Apps

Inherits:
Flows show all
Defined in:
lib/zillabyte/api/apps.rb

Instance Method Summary collapse

Methods inherited from Flows

#create_delete, #create_kill, #create_pause, #create_resume, #create_scale, #delete, #get_meta, #poll_delete, #poll_kill, #poll_pause, #poll_resume, #poll_scale, #pull_to_directory, #push_directory

Methods inherited from Base

#initialize, #request

Methods included from Helpers

#app, #ask, #command, #create_git_remote, #display, #error, #extract_app_from_git_config, #extract_app_in_dir, #format_with_bang, #friendly_dir, #get_flow_ui_link, #get_info, #get_rich_info, #git, #handle_downloading_manifest, #has_git?, #longest, #read_multiline, #truncate_message, #version_okay?, #with_tty

Constructor Details

This class inherits a constructor from Zillabyte::API::Base

Instance Method Details

#create_cycle(id, options = {}) ⇒ Object



55
56
57
58
59
60
61
62
63
# File 'lib/zillabyte/api/apps.rb', line 55

def create_cycle(id, options ={})
  res = @api.request(
    :expects => 200,
    :method  => :post,
    :path    => "/apps/#{id}/cycles",
    :body    => options.to_json
  )
  res.body
end

#cycles_poll(id, options = {}) ⇒ Object



75
76
77
78
79
80
81
82
83
# File 'lib/zillabyte/api/apps.rb', line 75

def cycles_poll(id, options={})
  res = @api.request(
    :expects => 200,
    :method => :get,
    :path => "/apps/#{id}/cycles/cycles_poll",
    :body => options.to_json
  )
  res.body
end

#get(id, options = {}) ⇒ Object

GET /apps/id



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/zillabyte/api/apps.rb', line 26

def get(id, options = {})

  options = {
    # TODO
  }.merge(options)
  
  res = @api.request(
    :expects  => 200,
    :method   => :get,
    :path     => "/apps/#{id}",
    :body     => options.to_json 
  )
  
  res.body

end

#list(options = {}) ⇒ Object

GET /apps



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/zillabyte/api/apps.rb', line 7

def list(options = {})

  options = {
    # TODO
  }.merge(options)
  
  res = @api.request(
    :expects  => 200,
    :method   => :get,
    :path     => "/apps",
    :body     => options.to_json
  )
  
  res.body

end

#list_cycles(id, options = {}) ⇒ Object



44
45
46
47
48
49
50
51
52
53
# File 'lib/zillabyte/api/apps.rb', line 44

def list_cycles(id, options={})
  res = @api.request(
    :expects => 200,
    :method  => :get,
    :path    => "/apps/#{id}/cycles",
    :body    => options.to_json
  )
  res.body

end

#run_forever(id, options = {}) ⇒ Object



65
66
67
68
69
70
71
72
73
# File 'lib/zillabyte/api/apps.rb', line 65

def run_forever(id, options ={})
  res = @api.request(
    :expects => 200,
    :method  => :post,
    :path    => "/apps/#{id}/cycles/run_forever",
    :body    => options.to_json
  )
  res.body
end