af 0.3.22 → 0.5.0.beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. checksums.yaml +14 -6
  2. data/LICENSE +1277 -24
  3. data/Rakefile +24 -87
  4. data/bin/af +7 -2
  5. data/lib/af/version.rb +3 -0
  6. data/lib/vmc.rb +7 -2
  7. data/lib/vmc/cli.rb +475 -0
  8. data/lib/vmc/cli/app/app.rb +45 -0
  9. data/lib/vmc/cli/app/apps.rb +105 -0
  10. data/lib/vmc/cli/app/base.rb +82 -0
  11. data/lib/vmc/cli/app/crashes.rb +46 -0
  12. data/lib/vmc/cli/app/delete.rb +95 -0
  13. data/lib/vmc/cli/app/deprecated.rb +11 -0
  14. data/lib/vmc/cli/app/env.rb +78 -0
  15. data/lib/vmc/cli/app/files.rb +137 -0
  16. data/lib/vmc/cli/app/health.rb +26 -0
  17. data/lib/vmc/cli/app/instances.rb +53 -0
  18. data/lib/vmc/cli/app/logs.rb +76 -0
  19. data/lib/vmc/cli/app/push.rb +107 -0
  20. data/lib/vmc/cli/app/push/create.rb +150 -0
  21. data/lib/vmc/cli/app/push/interactions.rb +100 -0
  22. data/lib/vmc/cli/app/push/sync.rb +64 -0
  23. data/lib/vmc/cli/app/rename.rb +39 -0
  24. data/lib/vmc/cli/app/restart.rb +20 -0
  25. data/lib/vmc/cli/app/scale.rb +71 -0
  26. data/lib/vmc/cli/app/start.rb +93 -0
  27. data/lib/vmc/cli/app/stats.rb +67 -0
  28. data/lib/vmc/cli/app/stop.rb +27 -0
  29. data/lib/vmc/cli/domain/base.rb +12 -0
  30. data/lib/vmc/cli/domain/domains.rb +40 -0
  31. data/lib/vmc/cli/domain/map.rb +55 -0
  32. data/lib/vmc/cli/domain/unmap.rb +56 -0
  33. data/lib/vmc/cli/help.rb +16 -0
  34. data/lib/vmc/cli/interactive.rb +105 -0
  35. data/lib/vmc/cli/organization/base.rb +14 -0
  36. data/lib/vmc/cli/organization/create.rb +32 -0
  37. data/lib/vmc/cli/organization/delete.rb +73 -0
  38. data/lib/vmc/cli/organization/org.rb +45 -0
  39. data/lib/vmc/cli/organization/orgs.rb +35 -0
  40. data/lib/vmc/cli/organization/rename.rb +36 -0
  41. data/lib/vmc/cli/route/base.rb +12 -0
  42. data/lib/vmc/cli/route/map.rb +80 -0
  43. data/lib/vmc/cli/route/routes.rb +26 -0
  44. data/lib/vmc/cli/route/unmap.rb +94 -0
  45. data/lib/vmc/cli/service/base.rb +8 -0
  46. data/lib/vmc/cli/service/bind.rb +44 -0
  47. data/lib/vmc/cli/service/create.rb +126 -0
  48. data/lib/vmc/cli/service/delete.rb +86 -0
  49. data/lib/vmc/cli/service/rename.rb +35 -0
  50. data/lib/vmc/cli/service/service.rb +42 -0
  51. data/lib/vmc/cli/service/services.rb +115 -0
  52. data/lib/vmc/cli/service/unbind.rb +38 -0
  53. data/lib/vmc/cli/space/base.rb +21 -0
  54. data/lib/vmc/cli/space/create.rb +56 -0
  55. data/lib/vmc/cli/space/delete.rb +95 -0
  56. data/lib/vmc/cli/space/rename.rb +39 -0
  57. data/lib/vmc/cli/space/space.rb +64 -0
  58. data/lib/vmc/cli/space/spaces.rb +55 -0
  59. data/lib/vmc/cli/space/take.rb +16 -0
  60. data/lib/vmc/cli/start/base.rb +80 -0
  61. data/lib/vmc/cli/start/colors.rb +13 -0
  62. data/lib/vmc/cli/start/info.rb +122 -0
  63. data/lib/vmc/cli/start/login.rb +92 -0
  64. data/lib/vmc/cli/start/logout.rb +13 -0
  65. data/lib/vmc/cli/start/target.rb +64 -0
  66. data/lib/vmc/cli/start/target_interactions.rb +37 -0
  67. data/lib/vmc/cli/start/targets.rb +16 -0
  68. data/lib/vmc/cli/user/base.rb +29 -0
  69. data/lib/vmc/cli/user/create.rb +39 -0
  70. data/lib/vmc/cli/user/delete.rb +25 -0
  71. data/lib/vmc/cli/user/passwd.rb +50 -0
  72. data/lib/vmc/cli/user/register.rb +42 -0
  73. data/lib/vmc/cli/user/users.rb +32 -0
  74. data/lib/vmc/constants.rb +13 -0
  75. data/lib/vmc/detect.rb +134 -0
  76. data/lib/vmc/errors.rb +17 -0
  77. data/lib/vmc/plugin.rb +56 -0
  78. data/lib/vmc/spacing.rb +89 -0
  79. data/lib/vmc/spec_helper.rb +1 -0
  80. data/lib/vmc/test_support.rb +4 -0
  81. data/lib/vmc/test_support/command_helper.rb +32 -0
  82. data/lib/vmc/test_support/common_input_examples.rb +14 -0
  83. data/lib/vmc/test_support/fake_home_dir.rb +16 -0
  84. data/lib/vmc/test_support/interact_helper.rb +29 -0
  85. data/lib/vmc/version.rb +3 -0
  86. data/spec/assets/hello-sinatra/Gemfile +3 -0
  87. data/spec/assets/hello-sinatra/main.rb +6 -0
  88. data/spec/features/new_user_flow_spec.rb +71 -0
  89. data/spec/spec_helper.rb +63 -0
  90. data/spec/vmc/cli/app/base_spec.rb +17 -0
  91. data/spec/vmc/cli/app/delete_spec.rb +188 -0
  92. data/spec/vmc/cli/app/instances_spec.rb +65 -0
  93. data/spec/vmc/cli/app/push/create_spec.rb +571 -0
  94. data/spec/vmc/cli/app/push_spec.rb +369 -0
  95. data/spec/vmc/cli/app/rename_spec.rb +104 -0
  96. data/spec/vmc/cli/app/scale_spec.rb +81 -0
  97. data/spec/vmc/cli/app/stats_spec.rb +62 -0
  98. data/spec/vmc/cli/domain/map_spec.rb +140 -0
  99. data/spec/vmc/cli/domain/unmap_spec.rb +73 -0
  100. data/spec/vmc/cli/organization/orgs_spec.rb +108 -0
  101. data/spec/vmc/cli/organization/rename_spec.rb +113 -0
  102. data/spec/vmc/cli/route/map_spec.rb +138 -0
  103. data/spec/vmc/cli/route/unmap_spec.rb +215 -0
  104. data/spec/vmc/cli/service/bind_spec.rb +25 -0
  105. data/spec/vmc/cli/service/delete_spec.rb +22 -0
  106. data/spec/vmc/cli/service/rename_spec.rb +105 -0
  107. data/spec/vmc/cli/service/service_spec.rb +23 -0
  108. data/spec/vmc/cli/service/unbind_spec.rb +25 -0
  109. data/spec/vmc/cli/space/rename_spec.rb +102 -0
  110. data/spec/vmc/cli/space/spaces_spec.rb +104 -0
  111. data/spec/vmc/cli/start/info_spec.rb +153 -0
  112. data/spec/vmc/cli/start/login_spec.rb +71 -0
  113. data/spec/vmc/cli/user/create_spec.rb +54 -0
  114. data/spec/vmc/cli/user/passwd_spec.rb +102 -0
  115. data/spec/vmc/cli/user/register_spec.rb +148 -0
  116. data/spec/vmc/cli_spec.rb +448 -0
  117. data/spec/vmc/detect_spec.rb +54 -0
  118. metadata +231 -124
  119. data/README.md +0 -155
  120. data/caldecott_helper/Gemfile +0 -10
  121. data/caldecott_helper/Gemfile.lock +0 -48
  122. data/caldecott_helper/server.rb +0 -43
  123. data/config/clients.yml +0 -17
  124. data/config/micro/offline.conf +0 -2
  125. data/config/micro/paths.yml +0 -22
  126. data/config/micro/refresh_ip.rb +0 -20
  127. data/lib/cli.rb +0 -48
  128. data/lib/cli/commands/admin.rb +0 -81
  129. data/lib/cli/commands/apps.rb +0 -1358
  130. data/lib/cli/commands/base.rb +0 -233
  131. data/lib/cli/commands/manifest.rb +0 -56
  132. data/lib/cli/commands/micro.rb +0 -115
  133. data/lib/cli/commands/misc.rb +0 -147
  134. data/lib/cli/commands/services.rb +0 -217
  135. data/lib/cli/commands/user.rb +0 -70
  136. data/lib/cli/config.rb +0 -176
  137. data/lib/cli/console_helper.rb +0 -163
  138. data/lib/cli/core_ext.rb +0 -122
  139. data/lib/cli/errors.rb +0 -19
  140. data/lib/cli/file_helper.rb +0 -123
  141. data/lib/cli/frameworks.rb +0 -265
  142. data/lib/cli/manifest_helper.rb +0 -316
  143. data/lib/cli/runner.rb +0 -633
  144. data/lib/cli/services_helper.rb +0 -104
  145. data/lib/cli/tunnel_helper.rb +0 -336
  146. data/lib/cli/usage.rb +0 -129
  147. data/lib/cli/version.rb +0 -7
  148. data/lib/cli/zip_util.rb +0 -102
  149. data/lib/vmc/client.rb +0 -574
  150. data/lib/vmc/const.rb +0 -27
  151. data/lib/vmc/micro.rb +0 -56
  152. data/lib/vmc/micro/switcher/base.rb +0 -97
  153. data/lib/vmc/micro/switcher/darwin.rb +0 -19
  154. data/lib/vmc/micro/switcher/dummy.rb +0 -15
  155. data/lib/vmc/micro/switcher/linux.rb +0 -16
  156. data/lib/vmc/micro/switcher/windows.rb +0 -31
  157. data/lib/vmc/micro/vmrun.rb +0 -158
@@ -1,104 +0,0 @@
1
-
2
- module VMC::Cli
3
- module ServicesHelper
4
- def display_system_services(services=nil)
5
- services ||= client.services_info
6
-
7
- display "\n============== System Services ==============\n\n"
8
-
9
- return display "No system services available" if services.empty?
10
-
11
- displayed_services = []
12
- services.each do |service_type, value|
13
- value.each do |vendor, version|
14
- version.each do |version_str, service|
15
- displayed_services << [ vendor, version_str, service[:description] ]
16
- end
17
- end
18
- end
19
- displayed_services.sort! { |a, b| a.first.to_s <=> b.first.to_s}
20
-
21
- services_table = table do |t|
22
- t.headings = 'Service', 'Version', 'Description'
23
- displayed_services.each { |s| t << s }
24
- end
25
- display services_table
26
- end
27
-
28
- def display_provisioned_services(services=nil)
29
- services ||= client.services
30
- display "\n=========== Provisioned Services ============\n\n"
31
- display_provisioned_services_table(services)
32
- end
33
-
34
- def display_provisioned_services_table(services)
35
- return unless services && !services.empty?
36
-
37
- infra_supported = !services.detect { |a| a[:infra] }.nil?
38
- services_table = table do |t|
39
- t.headings = 'Name', 'Service'
40
- t.headings << 'In' if infra_supported
41
- services.each do |service|
42
- s = [ service[:name], service[:vendor] ]
43
- if infra_supported
44
- s << ( service[:infra] ? service[:infra][:provider] : " " )
45
- end
46
- t << s
47
- end
48
- end
49
- display services_table
50
- end
51
-
52
- def create_service_banner(service, name, display_name=false, infra=nil)
53
- sn = " [#{name}]" if display_name
54
- display "Creating Service#{sn}: ", false
55
- client.create_service(infra,service, name)
56
- display 'OK'.green
57
- end
58
-
59
- def bind_service_banner(service, appname, check_restart=true)
60
- display "Binding Service [#{service}]: ", false
61
- client.bind_service(service, appname)
62
- display 'OK'.green
63
- check_app_for_restart(appname) if check_restart
64
- end
65
-
66
- def unbind_service_banner(service, appname, check_restart=true)
67
- display "Unbinding Service [#{service}]: ", false
68
- client.unbind_service(service, appname)
69
- display 'OK'.green
70
- check_app_for_restart(appname) if check_restart
71
- end
72
-
73
- def delete_service_banner(service)
74
- display "Deleting service [#{service}]: ", false
75
- client.delete_service(service)
76
- display 'OK'.green
77
- end
78
-
79
- def random_service_name(service)
80
- r = "%04x" % [rand(0x0100000)]
81
- "#{service.to_s}-#{r}"
82
- end
83
-
84
- def generate_cloned_service_name(src_appname,dest_appname,src_servicename,dest_infra)
85
- r = "%04x" % [rand(0x0100000)]
86
- dest_servicename = src_servicename.sub(src_appname,dest_appname).sub(/-[0-9A-Fa-f]{4,5}/,"-#{r}")
87
- if src_servicename == dest_servicename
88
- if dest_infra
89
- dest_servicename = "#{dest_servicename}-#{dest_infra}"
90
- else
91
- dest_servicename = "#{dest_servicename}-#{r}"
92
- end
93
- end
94
- dest_servicename
95
- end
96
-
97
- def check_app_for_restart(appname)
98
- app = client.app_info(appname)
99
- cmd = VMC::Cli::Command::Apps.new(@options)
100
- cmd.restart(appname) if app[:state] == 'STARTED'
101
- end
102
-
103
- end
104
- end
@@ -1,336 +0,0 @@
1
- # Copyright (c) 2009-2011 VMware, Inc.
2
-
3
- require 'addressable/uri'
4
-
5
- begin
6
- require 'caldecott'
7
- rescue LoadError
8
- end
9
-
10
- module VMC::Cli
11
- module TunnelHelper
12
- PORT_RANGE = 10
13
-
14
- HELPER_APP = File.expand_path("../../../caldecott_helper", __FILE__)
15
-
16
- # bump this AND the version info reported by HELPER_APP/server.rb
17
- # this is to keep the helper in sync with any updates here
18
- HELPER_VERSION = '0.0.4'
19
-
20
- def tunnel_uniquename(infra)
21
- random_service_name(tunnel_appname(infra))
22
- end
23
-
24
- def tunnel_appname(infra)
25
- infra ? "caldecott-#{infra}" : "caldecott"
26
- end
27
-
28
- def tunnel_app_info(infra)
29
- begin
30
- client.app_info(tunnel_appname(infra))
31
- rescue => e
32
- nil
33
- end
34
- end
35
-
36
- def tunnel_auth(infra)
37
- tunnel_app_info(infra)[:env].each do |e|
38
- name, val = e.split("=", 2)
39
- return val if name == "CALDECOTT_AUTH"
40
- end
41
- nil
42
- end
43
-
44
- def tunnel_url(infra)
45
-
46
- tun_url = tunnel_app_info(infra)[:uris][0]
47
-
48
- ["https", "http"].each do |scheme|
49
- url = "#{scheme}://#{tun_url}"
50
- begin
51
- RestClient.get(url)
52
-
53
- # https failed
54
- rescue Errno::ECONNREFUSED
55
-
56
- # we expect a 404 since this request isn't auth'd
57
- rescue RestClient::ResourceNotFound
58
- return url
59
- end
60
- end
61
-
62
- err "Cannot determine URL for #{tun_url}"
63
- end
64
-
65
- def invalidate_tunnel_app_info(infra)
66
- end
67
-
68
- def tunnel_pushed?(infra)
69
- not tunnel_app_info(infra).nil?
70
- end
71
-
72
- def tunnel_healthy?(token,infra)
73
- return false unless tunnel_app_info(infra)[:state] == 'STARTED'
74
-
75
- begin
76
- response = RestClient.get(
77
- "#{tunnel_url(infra)}/info",
78
- "Auth-Token" => token
79
- )
80
- info = JSON.parse(response)
81
- if info["version"] == HELPER_VERSION
82
- true
83
- else
84
- stop_caldecott(infra)
85
- false
86
- end
87
- rescue RestClient::Exception
88
- stop_caldecott(infra)
89
- false
90
- end
91
- end
92
-
93
- def tunnel_bound?(service,infra)
94
- tunnel_app_info(infra)[:services].include?(service)
95
- end
96
-
97
- def tunnel_connection_info(type, service, token, infra)
98
- display "Getting tunnel connection info: ", false
99
- response = nil
100
- 10.times do
101
- begin
102
- response = RestClient.get(tunnel_url(infra) + "/" + VMC::Client.path("services", service), "Auth-Token" => token)
103
- break
104
- rescue RestClient::Exception => e
105
- puts "Error infra: #{infra}, url: #{tunnel_url(infra)}"
106
- display tunnel_url(infra)
107
- puts e.message.red
108
- sleep 1
109
- end
110
-
111
- display ".", false
112
- end
113
-
114
- unless response
115
- err "Expected remote tunnel to know about #{service}, but it doesn't"
116
- end
117
-
118
- display "OK".green
119
-
120
- info = JSON.parse(response)
121
- info["infra"] = infra
122
- case type
123
- when "rabbitmq"
124
- uri = Addressable::URI.parse info["url"]
125
- info["hostname"] = uri.host
126
- info["port"] = uri.port
127
- info["vhost"] = uri.path[1..-1]
128
- info["user"] = uri.user
129
- info["password"] = uri.password
130
- info.delete "url"
131
-
132
- # we use "db" as the "name" for mongo
133
- # existing "name" is junk
134
- when "mongodb"
135
- info["name"] = info["db"]
136
- info.delete "db"
137
-
138
- # our "name" is irrelevant for redis
139
- when "redis"
140
- info.delete "name"
141
- end
142
-
143
- ['hostname', 'port', 'password'].each do |k|
144
- err "Could not determine #{k} for #{service}" if info[k].nil?
145
- end
146
-
147
- info
148
- end
149
-
150
- def display_tunnel_connection_info(info)
151
- display ''
152
- display "Service connection info: "
153
-
154
- to_show = [nil, nil, nil] # reserved for user, pass, db name
155
- info.keys.each do |k|
156
- case k
157
- when "host", "hostname", "port", "node_id"
158
- # skip
159
- when "user", "username"
160
- # prefer "username" over "user"
161
- to_show[0] = k unless to_show[0] == "username"
162
- when "password"
163
- to_show[1] = k
164
- when "name"
165
- to_show[2] = k
166
- else
167
- to_show << k
168
- end
169
- end
170
- to_show.compact!
171
-
172
- align_len = to_show.collect(&:size).max + 1
173
-
174
- to_show.each do |k|
175
- # TODO: modify the server services rest call to have explicit knowledge
176
- # about the items to return. It should return all of them if
177
- # the service is unknown so that we don't have to do this weird
178
- # filtering.
179
- display " #{k.ljust align_len}: ", false
180
- display "#{info[k]}".yellow
181
- end
182
- display ''
183
- end
184
-
185
- def start_tunnel(local_port, conn_info, auth, infra)
186
- @local_tunnel_thread = Thread.new do
187
- Caldecott::Client.start({
188
- :local_port => local_port,
189
- :tun_url => tunnel_url(infra),
190
- :dst_host => conn_info['hostname'],
191
- :dst_port => conn_info['port'],
192
- :log_file => STDOUT,
193
- :log_level => ENV["VMC_TUNNEL_DEBUG"] || "ERROR",
194
- :auth_token => auth,
195
- :quiet => true
196
- })
197
- end
198
-
199
- at_exit { @local_tunnel_thread.kill }
200
- end
201
-
202
-
203
-
204
- def pick_tunnel_port(port)
205
- original = port
206
-
207
- PORT_RANGE.times do |n|
208
- begin
209
- TCPSocket.open('localhost', port)
210
- port += 1
211
- rescue
212
- return port
213
- end
214
- end
215
-
216
- grab_ephemeral_port
217
- end
218
-
219
- def grab_ephemeral_port
220
- socket = TCPServer.new('0.0.0.0', 0)
221
- socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR, true)
222
- Socket.do_not_reverse_lookup = true
223
- port = socket.addr[1]
224
- socket.close
225
- return port
226
- end
227
-
228
- def wait_for_tunnel_start(port)
229
- 10.times do |n|
230
- begin
231
- client = TCPSocket.open('localhost', port)
232
- display '' if n > 0
233
- client.close
234
- return true
235
- rescue => e
236
- display "Waiting for local tunnel to become available", false if n == 0
237
- display '.', false
238
- sleep 1
239
- end
240
- end
241
- err "Could not connect to local tunnel."
242
- end
243
-
244
- def wait_for_tunnel_end
245
- display "Open another shell to run command-line clients or"
246
- display "use a UI tool to connect using the displayed information."
247
- display "Press Ctrl-C to exit..."
248
- @local_tunnel_thread.join
249
- end
250
-
251
- def resolve_symbols(str, info, local_port)
252
- str.gsub(/\$\{\s*([^\}]+)\s*\}/) do
253
- case $1
254
- when "host"
255
- # TODO: determine proper host
256
- "localhost"
257
- when "port"
258
- local_port
259
- when "user", "username"
260
- info["username"]
261
- else
262
- info[$1] || ask($1)
263
- end
264
- end
265
- end
266
-
267
- def start_local_prog(clients, command, info, port)
268
- client = clients[File.basename(command)]
269
-
270
- cmdline = "#{command} "
271
-
272
- case client
273
- when Hash
274
- cmdline << resolve_symbols(client["command"], info, port)
275
- client["environment"].each do |e|
276
- if e =~ /([^=]+)=(["']?)([^"']*)\2/
277
- ENV[$1] = resolve_symbols($3, info, port)
278
- else
279
- err "Invalid environment variable: #{e}"
280
- end
281
- end
282
- when String
283
- cmdline << resolve_symbols(client, info, port)
284
- else
285
- err "Unknown client info: #{client.inspect}."
286
- end
287
-
288
- display "Launching '#{cmdline}'"
289
- display ''
290
-
291
- system(cmdline)
292
- end
293
-
294
- def push_caldecott(token,infra)
295
- manifest = {
296
- :name => tunnel_appname(infra),
297
- :staging => {:framework => "sinatra", :runtime => "ruby18" },
298
- :uris => ["#{tunnel_uniquename(infra)}.#{client.base_for_infra(infra)}"],
299
- :instances => 1,
300
- :resources => {:memory => 64},
301
- :env => ["CALDECOTT_AUTH=#{token}"]
302
- }
303
- manifest[:infra] = { :provider => infra } if infra
304
-
305
- client.create_app(
306
- tunnel_appname(infra),
307
- manifest
308
- )
309
-
310
- apps_cmd.send(:upload_app_bits, tunnel_appname(infra), HELPER_APP, infra)
311
-
312
- invalidate_tunnel_app_info(infra)
313
- end
314
-
315
- def stop_caldecott(infra)
316
- apps_cmd.stop(tunnel_appname(infra))
317
-
318
- invalidate_tunnel_app_info(infra)
319
- end
320
-
321
- def start_caldecott(infra)
322
- apps_cmd.start(tunnel_appname(infra))
323
-
324
- invalidate_tunnel_app_info(infra)
325
- end
326
-
327
- private
328
-
329
- def apps_cmd
330
- a = Command::Apps.new(@options)
331
- a.client client
332
- a
333
- end
334
-
335
- end
336
- end
@@ -1,129 +0,0 @@
1
- class VMC::Cli::Runner
2
-
3
- def basic_usage
4
- "Usage: af [options] command [<args>] [command_options]\n" +
5
- "Try 'af help [command]' or 'af help options' for more information."
6
- end
7
-
8
- def display_usage
9
- if @usage
10
- say @usage_error if @usage_error
11
- say "Usage: #{@usage}"
12
- return
13
- elsif @verb_usage
14
- say @verb_usage
15
- return
16
- end
17
- say command_usage
18
- end
19
-
20
- def command_usage
21
- <<-USAGE
22
-
23
- #{basic_usage}
24
-
25
- Currently available af commands are:
26
-
27
- Getting Started
28
- target [url] Reports current target or sets a new target
29
- login [email] [--email, --passwd] Login
30
- info System and account information
31
-
32
- Applications
33
- apps List deployed applications
34
-
35
- Application Creation
36
- push [appname] Create, push, map, and start a new application
37
- push [appname] --infra Push application to specified infrastructure
38
- push [appname] --path Push application from specified path
39
- push [appname] --url Set the url for the application
40
- push [appname] --instances <N> Set the expected number <N> of instances
41
- push [appname] --mem M Set the memory reservation for the application
42
- push [appname] --runtime RUNTIME Set the runtime to use for the application
43
- push [appname] --debug [MODE] Push application and start in a debug mode
44
- push [appname] --no-start Do not auto-start the application
45
- push [appname] --label Add specified label to app revision record
46
-
47
- Application Operations
48
- start <appname> [--debug [MODE]] Start the application
49
- stop <appname> Stop the application
50
- restart <appname> [--debug [MODE]] Restart the application
51
- delete <appname> Delete the application
52
- clone <src-app> <dest-app> [infra] --label LABEL Clone the application and services
53
-
54
- Application Updates
55
- update <appname> [--path,--debug [MODE],--label] Update the application bits
56
- mem <appname> [memsize] Update the memory reservation for an application
57
- map <appname> <url> Register the application to the url
58
- unmap <appname> <url> Unregister the application from the url
59
- instances <appname> <num|delta> Scale the application instances up or down
60
-
61
- Application Information
62
- crashes <appname> List recent application crashes
63
- crashlogs <appname> Display log information for crashed applications
64
- logs <appname> [--all] Display log information for the application
65
- files <appname> [path] [--all] Display directory listing or file download for [path]
66
- stats <appname> Display resource usage for the application
67
- instances <appname> List application instances
68
- history <appname> Show version history of the application
69
- diff <appname> Compare current directory with deployed application
70
- hash [path] [--full] Compute hash of directory, defaults to current
71
-
72
- Application Download
73
- pull <appname> [path] Downloads last pushed source to <appname> or [path]
74
- download <appname> [path] Downloads last pushed source to zipfile
75
-
76
- Application Environment
77
- env <appname> List application environment variables
78
- env-add <appname> <variable[=]value> Add an environment variable to an application
79
- env-del <appname> <variable> Delete an environment variable to an application
80
-
81
- Services
82
- services Lists of services available and provisioned
83
- create-service <service> [--name,--bind] Create a provisioned service
84
- create-service <service> --infra Create a provisioned service on a specified infrastructure
85
- create-service <service> <name> Create a provisioned service and assign it <name>
86
- create-service <service> <name> <app> Create a provisioned service and assign it <name>, and bind to <app>
87
- delete-service [servicename] Delete a provisioned service
88
- bind-service <servicename> <appname> Bind a service to an application
89
- unbind-service <servicename> <appname> Unbind service from the application
90
- clone-services <src-app> <dest-app> Clone service bindings from <src-app> application to <dest-app>
91
- export-service <service> Export the data from a service
92
- import-service <service> <url> Import data into a service
93
- tunnel <servicename> [--port] Create a local tunnel to a service
94
- tunnel <servicename> <clientcmd> Create a local tunnel to a service and start a local client
95
-
96
- Administration
97
- user Display user account information
98
- passwd Change the password for the current user
99
- logout Logs current user out of the target system
100
- add-user [--email, --passwd] Register a new user (requires admin privileges)
101
- delete-user <user> Delete a user and all apps and services (requires admin privileges)
102
-
103
- System
104
- runtimes Display the supported runtimes of the target system
105
- frameworks Display the recognized frameworks of the target system
106
- infras Display the available infrastructures
107
-
108
- Micro Cloud Foundry
109
- micro status Display Micro Cloud Foundry VM status
110
- micro offline Configure Micro Cloud Foundry VM for offline mode
111
- micro online Configure Micro Cloud Foundry VM for online mode
112
- [--vmx file] Path to micro.vmx
113
- [--vmrun executable] Path to vmrun executable
114
- [--password cleartext] Cleartext password for guest VM vcap user
115
- [--save] Save cleartext password in ~/.af_micro
116
-
117
- Misc
118
- aliases List aliases
119
- alias <alias[=]command> Create an alias for a command
120
- unalias <alias> Remove an alias
121
- targets List known targets and associated authorization tokens
122
-
123
- Help
124
- help [command] Get general help or help on a specific command
125
- help options Get help on available options
126
- USAGE
127
-
128
- end
129
- end