heroku-api 0.3.14 → 0.3.15

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -42,6 +42,7 @@ For additional details about any of the commands, see the [API docs](http://api-
42
42
  heroku.delete_app(APP) # delete the app named APP
43
43
  heroku.get_apps # get a list of your apps
44
44
  heroku.get_app(APP) # get info about the app named APP
45
+ heroku.get_dyno_types(APP) # get dyno types for the app named APP
45
46
  heroku.post_app # create an app with a generated name and the default stack
46
47
  heroku.post_app_maintenance(APP, '1') # toggle maintenance mode for the app named APP
47
48
  heroku.post_app('name' => 'app') # create an app with a specified name, APP
@@ -78,17 +79,17 @@ For additional details about any of the commands, see the [API docs](http://api-
78
79
 
79
80
  ### Processes
80
81
 
81
- heroku.get_ps(APP) # list current processes for APP app
82
+ heroku.get_ps(APP) # list current dynos for APP app
82
83
  heroku.post_ps(APP, 'command') # run 'command' command in context of APP app
83
- heroku.post_ps_restart(APP) # restart all processes for APP app
84
- heroku.post_ps_scale(APP, TYPE, QTY) # scale TYPE type processes to QTY for APP app
85
- heroku.post_ps_stop(APP, 'ps' => 'web.1') # stop 'web.1' process for APP app
86
- heroku.post_ps_stop(APP, 'type' => 'web') # stop all 'web' processes for APP app
87
- heroku.post_ps_restart(APP, 'ps' => 'web.1') # restart 'web.1' process for APP app
84
+ heroku.post_ps_restart(APP) # restart all dynos for APP app
85
+ heroku.post_ps_scale(APP, TYPE, QTY) # scale TYPE type dynos to QTY for APP app
86
+ heroku.post_ps_stop(APP, 'ps' => 'web.1') # stop 'web.1' dyno for APP app
87
+ heroku.post_ps_stop(APP, 'type' => 'web') # stop all 'web' dynos for APP app
88
+ heroku.post_ps_restart(APP, 'ps' => 'web.1') # restart 'web.1' dyno for APP app
88
89
  heroku.put_dynos(APP, DYNOS) # set number of dynos for bamboo app APP to DYNOS
89
90
  heroku.put_workers(APP, WORKERS) # set number of workers for bamboo app APP to WORKERS
90
91
  heroku.post_ps_scale(APP, 'worker', WORKERS) # set number of workers for cedar app APP to WORKERS
91
- heroku.put_formation(APP, 'web' => '2X') # set dyno size to '2X' for all 'web' processes for APP app
92
+ heroku.put_formation(APP, 'web' => '2X') # set dyno size to '2X' for all 'web' dynos for APP app
92
93
 
93
94
  ### Releases
94
95
 
@@ -1,3 +1,8 @@
1
+ 0.3.15 11/03/2013
2
+ =================
3
+
4
+ add get__dyno_types for retrieving process types
5
+
1
6
  0.3.14 07/03/2013
2
7
  =================
3
8
 
@@ -209,6 +209,20 @@ module Heroku
209
209
  end
210
210
  end
211
211
 
212
+ # stub GET /apps/:app/dyno-types
213
+ Excon.stub(:expects => 200, :method => :get, :path => %r{^/apps/([^/]+)/dyno-types}) do |params|
214
+ request_params, mock_data = parse_stub_params(params)
215
+ app, _ = request_params[:captures][:path]
216
+ with_mock_app(mock_data, app) do |app_data|
217
+ {
218
+ :body => Heroku::API::OkJson.encode([{"command"=>"bundle exec rails console", "name"=>"console", "quantity"=>0}]),
219
+ :status => 200
220
+ }
221
+ end
222
+ end
223
+
224
+
225
+
212
226
  end
213
227
  end
214
228
  end
@@ -85,5 +85,15 @@ module Heroku
85
85
  )
86
86
  end
87
87
 
88
+ # GET /apps/:app/dyno-types
89
+ def get_dyno_types(app)
90
+ request(
91
+ :expects => 200,
92
+ :method => :get,
93
+ :path => "/apps/#{app}/dyno-types"
94
+ )
95
+ end
96
+
97
+
88
98
  end
89
99
  end
@@ -1,5 +1,5 @@
1
1
  module Heroku
2
2
  class API
3
- VERSION = "0.3.14"
3
+ VERSION = "0.3.15"
4
4
  end
5
5
  end
@@ -252,4 +252,15 @@ class TestProcesses < Minitest::Test
252
252
  end
253
253
  end
254
254
 
255
+ def test_get_dyno_types
256
+ with_app('stack' => 'cedar') do |app_data|
257
+ response = heroku.get_dyno_types(app_data['name'])
258
+ assert_equal(200, response.status)
259
+ assert_equal(['command' => 'bundle exec rails console',
260
+ 'name' => 'console',
261
+ 'quantity' => 0], response.body)
262
+ end
263
+ end
264
+
265
+
255
266
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.14
4
+ version: 0.3.15
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - geemus (Wesley Beary)
@@ -9,11 +10,12 @@ authors:
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2013-07-16 00:00:00.000000000 Z
13
+ date: 2013-08-13 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: excon
16
17
  requirement: !ruby/object:Gem::Requirement
18
+ none: false
17
19
  requirements:
18
20
  - - ~>
19
21
  - !ruby/object:Gem::Version
@@ -21,6 +23,7 @@ dependencies:
21
23
  type: :runtime
22
24
  prerelease: false
23
25
  version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
24
27
  requirements:
25
28
  - - ~>
26
29
  - !ruby/object:Gem::Version
@@ -28,29 +31,33 @@ dependencies:
28
31
  - !ruby/object:Gem::Dependency
29
32
  name: minitest
30
33
  requirement: !ruby/object:Gem::Requirement
34
+ none: false
31
35
  requirements:
32
- - - '>='
36
+ - - ! '>='
33
37
  - !ruby/object:Gem::Version
34
38
  version: '0'
35
39
  type: :development
36
40
  prerelease: false
37
41
  version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
38
43
  requirements:
39
- - - '>='
44
+ - - ! '>='
40
45
  - !ruby/object:Gem::Version
41
46
  version: '0'
42
47
  - !ruby/object:Gem::Dependency
43
48
  name: rake
44
49
  requirement: !ruby/object:Gem::Requirement
50
+ none: false
45
51
  requirements:
46
- - - '>='
52
+ - - ! '>='
47
53
  - !ruby/object:Gem::Version
48
54
  version: '0'
49
55
  type: :development
50
56
  prerelease: false
51
57
  version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
52
59
  requirements:
53
- - - '>='
60
+ - - ! '>='
54
61
  - !ruby/object:Gem::Version
55
62
  version: '0'
56
63
  description: Ruby Client for the Heroku API
@@ -127,26 +134,27 @@ files:
127
134
  - test/test_user.rb
128
135
  homepage: http://github.com/heroku/heroku.rb
129
136
  licenses: []
130
- metadata: {}
131
137
  post_install_message:
132
138
  rdoc_options: []
133
139
  require_paths:
134
140
  - lib
135
141
  required_ruby_version: !ruby/object:Gem::Requirement
142
+ none: false
136
143
  requirements:
137
- - - '>='
144
+ - - ! '>='
138
145
  - !ruby/object:Gem::Version
139
146
  version: '0'
140
147
  required_rubygems_version: !ruby/object:Gem::Requirement
148
+ none: false
141
149
  requirements:
142
- - - '>='
150
+ - - ! '>='
143
151
  - !ruby/object:Gem::Version
144
152
  version: '0'
145
153
  requirements: []
146
154
  rubyforge_project:
147
- rubygems_version: 2.0.3
155
+ rubygems_version: 1.8.23
148
156
  signing_key:
149
- specification_version: 4
157
+ specification_version: 3
150
158
  summary: Ruby Client for the Heroku API
151
159
  test_files:
152
160
  - test/data/site.crt
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: e71c648c13d3cada52f88f216da44c52a4bc0255
4
- data.tar.gz: dfec54d18cfbcac7f6368835e78278011ae78e9e
5
- SHA512:
6
- metadata.gz: 9123281cd684c46081f17cb28dbc5b2f636d40d7c73ebf9879e785308b027aab4454e502822fb831cface20fd60f38303dbfffb4d4afff037992e9584bd9f618
7
- data.tar.gz: 7ccd4a981e917a354ef5380b48aee6f100470eb7491d73aaa8cee5f807a8a51770415b6b45513e7dfdae72142b5a3abd60207c5f9a74f24d4bd826030704d09a