cloudfoundry-client 0.1.0

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 (76) hide show
  1. data/.gitignore +12 -0
  2. data/.rspec +2 -0
  3. data/.travis.yml +12 -0
  4. data/.yardopts +9 -0
  5. data/CHANGELOG.md +6 -0
  6. data/Gemfile +3 -0
  7. data/LICENSE +20 -0
  8. data/README.md +122 -0
  9. data/Rakefile +28 -0
  10. data/cloudfoundry.gemspec +29 -0
  11. data/lib/cloudfoundry.rb +34 -0
  12. data/lib/cloudfoundry/client.rb +93 -0
  13. data/lib/cloudfoundry/client/apps.rb +192 -0
  14. data/lib/cloudfoundry/client/info.rb +29 -0
  15. data/lib/cloudfoundry/client/request.rb +89 -0
  16. data/lib/cloudfoundry/client/resources.rb +16 -0
  17. data/lib/cloudfoundry/client/response.rb +68 -0
  18. data/lib/cloudfoundry/client/services.rb +122 -0
  19. data/lib/cloudfoundry/client/users.rb +121 -0
  20. data/lib/cloudfoundry/constants.rb +30 -0
  21. data/lib/cloudfoundry/exception.rb +24 -0
  22. data/lib/cloudfoundry/version.rb +27 -0
  23. data/spec/client/apps_spec.rb +423 -0
  24. data/spec/client/info_spec.rb +92 -0
  25. data/spec/client/resources_spec.rb +52 -0
  26. data/spec/client/services_spec.rb +230 -0
  27. data/spec/client/users_spec.rb +367 -0
  28. data/spec/client_spec.rb +110 -0
  29. data/spec/cloudfoundry_spec.rb +62 -0
  30. data/spec/fixtures/admin_logged/client.yml +85 -0
  31. data/spec/fixtures/admin_logged/users.yml +363 -0
  32. data/spec/fixtures/admin_logged/users_create_action.yml +36 -0
  33. data/spec/fixtures/admin_logged/users_proxy_action.yml +46 -0
  34. data/spec/fixtures/admin_logged/users_proxy_nouser_action.yml +44 -0
  35. data/spec/fixtures/admin_logged/users_unproxy_action.yml +44 -0
  36. data/spec/fixtures/app.js +16 -0
  37. data/spec/fixtures/app.zip +0 -0
  38. data/spec/fixtures/client.yml +151 -0
  39. data/spec/fixtures/client_invalid.yml +85 -0
  40. data/spec/fixtures/cloudfoundry.yml +124 -0
  41. data/spec/fixtures/cloudfoundry_vs_client.yml +159 -0
  42. data/spec/fixtures/no_logged/apps.yml +42 -0
  43. data/spec/fixtures/no_logged/client.yml +42 -0
  44. data/spec/fixtures/no_logged/info.yml +81 -0
  45. data/spec/fixtures/no_logged/resources.yml +42 -0
  46. data/spec/fixtures/no_logged/services.yml +42 -0
  47. data/spec/fixtures/no_logged/users.yml +108 -0
  48. data/spec/fixtures/no_logged/users_login_action.yml +81 -0
  49. data/spec/fixtures/no_logged/users_proxy_action.yml +42 -0
  50. data/spec/fixtures/no_logged/users_unproxy_action.yml +42 -0
  51. data/spec/fixtures/user_logged/apps.yml +828 -0
  52. data/spec/fixtures/user_logged/apps_create_action.yml +42 -0
  53. data/spec/fixtures/user_logged/apps_directory_action.yml +48 -0
  54. data/spec/fixtures/user_logged/apps_download_action.yml +55 -0
  55. data/spec/fixtures/user_logged/apps_file_action.yml +54 -0
  56. data/spec/fixtures/user_logged/apps_start_action.yml +81 -0
  57. data/spec/fixtures/user_logged/apps_stats_action.yml +44 -0
  58. data/spec/fixtures/user_logged/apps_update_info_action.yml +44 -0
  59. data/spec/fixtures/user_logged/apps_upload_filename_action.yml +62 -0
  60. data/spec/fixtures/user_logged/apps_upload_zipfile_action.yml +62 -0
  61. data/spec/fixtures/user_logged/client.yml +85 -0
  62. data/spec/fixtures/user_logged/info.yml +126 -0
  63. data/spec/fixtures/user_logged/resources.yml +44 -0
  64. data/spec/fixtures/user_logged/resources_check_action.yml +42 -0
  65. data/spec/fixtures/user_logged/services.yml +354 -0
  66. data/spec/fixtures/user_logged/services_bind_action.yml +161 -0
  67. data/spec/fixtures/user_logged/services_create_action.yml +83 -0
  68. data/spec/fixtures/user_logged/services_unbind_action.yml +122 -0
  69. data/spec/fixtures/user_logged/services_unbind_fail_action.yml +122 -0
  70. data/spec/fixtures/user_logged/users.yml +299 -0
  71. data/spec/fixtures/user_logged/users_proxy_action.yml +44 -0
  72. data/spec/fixtures/user_logged/users_unproxy_action.yml +44 -0
  73. data/spec/spec_helper.rb +29 -0
  74. data/spec/support/cf_connection_helper.rb +26 -0
  75. data/spec/support/vcr.rb +8 -0
  76. metadata +235 -0
@@ -0,0 +1,110 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "Cloudfoundry::Client" do
4
+ include CfConnectionHelper
5
+
6
+ before(:all) do
7
+ client_data()
8
+ end
9
+
10
+ use_vcr_cassette "client", :record => :new_episodes
11
+
12
+ it "should report its version" do
13
+ CloudFoundry::Client::VERSION.should match(/\d.\d.\d/)
14
+ end
15
+
16
+ it "should properly initialize when no options are passed" do
17
+ cf_client = CloudFoundry::Client.new()
18
+ cf_client.target_url.should eql(CloudFoundry::Client::DEFAULT_TARGET)
19
+ cf_client.proxy_url.should be_nil
20
+ cf_client.trace_key.should be_nil
21
+ cf_client.auth_token.should be_nil
22
+ cf_client.user.should be_nil
23
+ cf_client.proxy_user.should be_nil
24
+ end
25
+
26
+ it "should properly initialize with only proxy_url option" do
27
+ cf_client = CloudFoundry::Client.new({:proxy_url => "http://proxy.rodenas.org"})
28
+ cf_client.target_url.should eql(CloudFoundry::Client::DEFAULT_TARGET)
29
+ cf_client.proxy_url.should eql("http://proxy.rodenas.org")
30
+ cf_client.trace_key.should be_nil
31
+ cf_client.auth_token.should be_nil
32
+ cf_client.user.should be_nil
33
+ cf_client.proxy_user.should be_nil
34
+ end
35
+
36
+ it "should properly initialize with only target_url option" do
37
+ cf_client = CloudFoundry::Client.new({:target_url => @target})
38
+ cf_client.target_url.should eql(@target)
39
+ cf_client.proxy_url.should be_nil
40
+ cf_client.trace_key.should be_nil
41
+ cf_client.auth_token.should be_nil
42
+ cf_client.user.should be_nil
43
+ cf_client.proxy_user.should be_nil
44
+ end
45
+
46
+ it "should normalize a target_url with no scheme" do
47
+ cf_client = CloudFoundry::Client.new({:target_url => "api.vcap.me"})
48
+ cf_client.target_url.should eql("http://api.vcap.me")
49
+ end
50
+
51
+ it "should not normalize a target_url with an http scheme" do
52
+ cf_client = CloudFoundry::Client.new({:target_url => "http://api.vcap.me"})
53
+ cf_client.target_url.should eql("http://api.vcap.me")
54
+ end
55
+
56
+ it "should not normalize a target_url with an https scheme" do
57
+ cf_client = CloudFoundry::Client.new({:target_url => "https://api.cloudfoundry.com"})
58
+ cf_client.target_url.should eql("https://api.cloudfoundry.com")
59
+ end
60
+
61
+ it "should properly initialize with only trace_key option" do
62
+ cf_client = CloudFoundry::Client.new({:trace_key => "22"})
63
+ cf_client.target_url.should eql(CloudFoundry::Client::DEFAULT_TARGET)
64
+ cf_client.proxy_url.should be_nil
65
+ cf_client.trace_key.should eql("22")
66
+ cf_client.auth_token.should be_nil
67
+ cf_client.user.should be_nil
68
+ cf_client.proxy_user.should be_nil
69
+ end
70
+
71
+ it "should properly initialize with only auth_token option" do
72
+ cf_client = CloudFoundry::Client.new({:auth_token => @auth_token})
73
+ cf_client.target_url.should eql(CloudFoundry::Client::DEFAULT_TARGET)
74
+ cf_client.proxy_url.should be_nil
75
+ cf_client.trace_key.should be_nil
76
+ cf_client.auth_token.should eql(@auth_token)
77
+ cf_client.user.should eql(@user)
78
+ cf_client.proxy_user.should be_nil
79
+ end
80
+
81
+ it "should properly initialize with target_url and auth_token options" do
82
+ cf_client = CloudFoundry::Client.new({:target_url => @target, :auth_token => @auth_token})
83
+ cf_client.target_url.should eql(@target)
84
+ cf_client.proxy_url.should be_nil
85
+ cf_client.trace_key.should be_nil
86
+ cf_client.auth_token.should eql(@auth_token)
87
+ cf_client.user.should eql(@user)
88
+ cf_client.proxy_user.should be_nil
89
+ end
90
+
91
+ it "should raise a BadParams exception when target_url is an invalid URL" do
92
+ expect {
93
+ cf_client = CloudFoundry::Client.new({:target_url => "fakeaddress"})
94
+ }.to raise_exception(CloudFoundry::Client::Exception::BadParams)
95
+ end
96
+
97
+ it "should raise a BadParams exception when target_url is an invalid CloudFoundry target" do
98
+ expect {
99
+ cf_client = CloudFoundry::Client.new({:target_url => "http://www.example.com"})
100
+ }.to raise_exception(CloudFoundry::Client::Exception::BadParams)
101
+ end
102
+
103
+ it "should raise an AuthError exception when auth_token is invalid in the CloudFoundry target" do
104
+ VCR.use_cassette("client_invalid", :record => :new_episodes, :exclusive => true) do
105
+ expect {
106
+ cf_client = CloudFoundry::Client.new({:auth_token => "invalid_auth_token"})
107
+ }.to raise_exception(CloudFoundry::Client::Exception::AuthError)
108
+ end
109
+ end
110
+ end
@@ -0,0 +1,62 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "Cloudfoundry" do
4
+ include CfConnectionHelper
5
+
6
+ before(:all) do
7
+ client_data()
8
+ end
9
+
10
+ use_vcr_cassette "cloudfoundry", :record => :new_episodes
11
+
12
+ it "should report its version" do
13
+ CloudFoundry::VERSION.should match(/\d.\d.\d/)
14
+ CloudFoundry::VERSION.should eql(CloudFoundry::Client::VERSION)
15
+ end
16
+
17
+ it "should properly initialize when no options are passed" do
18
+ cf_client = CloudFoundry.new()
19
+ cf_client.target_url.should eql(CloudFoundry::Client::DEFAULT_TARGET)
20
+ cf_client.proxy_url.should be_nil
21
+ cf_client.trace_key.should be_nil
22
+ cf_client.auth_token.should be_nil
23
+ cf_client.user.should be_nil
24
+ cf_client.proxy_user.should be_nil
25
+ end
26
+
27
+ it "should be a CloudFoundry::Client" do
28
+ cf_client = CloudFoundry.new()
29
+ cf_client.should be_a CloudFoundry::Client
30
+ end
31
+
32
+ it "should properly initialize with target_url and auth_token options" do
33
+ cf_client = CloudFoundry.new({:target_url => @target, :auth_token => @auth_token})
34
+ cf_client.target_url.should eql(@target)
35
+ cf_client.proxy_url.should be_nil
36
+ cf_client.trace_key.should be_nil
37
+ cf_client.auth_token.should eql(@auth_token)
38
+ cf_client.user.should eql(@user)
39
+ cf_client.proxy_user.should be_nil
40
+ end
41
+
42
+ it "should delegate any method to CloudFoundry::Client" do
43
+ cf_client = CloudFoundry.new({:target_url => @target, :auth_token => @auth_token})
44
+ cloud_info = cf_client.cloud_info()
45
+ cloud_info.should have_key :name
46
+ cloud_info.should have_key :build
47
+ cloud_info.should have_key :support
48
+ cloud_info.should have_key :version
49
+ cloud_info.should have_key :description
50
+ cloud_info.should have_key :allow_debug
51
+ end
52
+
53
+ it "should return the same results as a CloudFoundry::Client" do
54
+ VCR.use_cassette("cloudfoundry_vs_client", :record => :new_episodes, :exclusive => true) do
55
+ cf_client_1 = CloudFoundry.new()
56
+ cloud_info_1 = cf_client_1.cloud_info()
57
+ cf_client_2 = CloudFoundry::Client.new()
58
+ cloud_info_2 = cf_client_2.cloud_info()
59
+ cloud_info_1.should eql(cloud_info_2)
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,85 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.vcap.me:80/info
6
+ body: ""
7
+ headers:
8
+ User-Agent:
9
+ - cloudfoundry-client-0.1.0
10
+ Authorization:
11
+ - 04085b0849221261646d696e40766361702e6d65063a0645546c2b070101dc4e22196ec60283e0258107d4a7d98f66644938607fb049
12
+ Accept:
13
+ - application/json
14
+ Content-Type:
15
+ - application/json
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx/0.7.65
25
+ Date:
26
+ - Fri, 02 Dec 2011 01:09:51 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Keep-Alive:
34
+ - timeout=20
35
+ Etag:
36
+ - "\"14474b6291887f823279b1168c3c5063\""
37
+ Cache-Control:
38
+ - max-age=0, private, must-revalidate
39
+ X-Ua-Compatible:
40
+ - IE=Edge
41
+ body: "{\"name\":\"vcap\",\"build\":2222,\"support\":\"http://support.cloudfoundry.com\",\"version\":\"0.999\",\"description\":\"VMware's Cloud Application Platform\",\"allow_debug\":true,\"user\":\"admin@vcap.me\",\"limits\":{\"memory\":32768,\"app_uris\":16,\"services\":32,\"apps\":200},\"usage\":{\"memory\":0,\"apps\":0,\"services\":0},\"frameworks\":{\"grails\":{\"name\":\"grails\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"spring\":{\"name\":\"spring\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"sinatra\":{\"name\":\"sinatra\",\"runtimes\":[{\"name\":\"ruby18\",\"version\":\"1.8.7\",\"description\":\"Ruby 1.8.7\"},{\"name\":\"ruby19\",\"version\":\"1.9.2p180\",\"description\":\"Ruby 1.9.2\"}],\"appservers\":[{\"name\":\"thin\",\"description\":\"Thin\"}],\"detection\":[{\"*.rb\":\"require 'sinatra'|require \\\"sinatra\\\"\"},{\"config/environment.rb\":false}]},\"java_web\":{\"name\":\"java_web\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"php\":{\"name\":\"php\",\"runtimes\":[{\"name\":\"php\",\"version\":\"5.3\",\"description\":\"PHP 5\"}],\"appservers\":[{\"name\":\"apache\",\"description\":\"Apache\"}],\"detection\":[{\"*.php\":true}]},\"otp_rebar\":{\"name\":\"otp_rebar\",\"runtimes\":[{\"name\":\"erlangR14B02\",\"version\":\"R14B02\",\"description\":\"Erlang R14B02\"}],\"appservers\":[],\"detection\":[{\"releases/*/*.rel\":\".\"}]},\"lift\":{\"name\":\"lift\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"rails3\":{\"name\":\"rails3\",\"runtimes\":[{\"name\":\"ruby18\",\"version\":\"1.8.7\",\"description\":\"Ruby 1.8.7\"},{\"name\":\"ruby19\",\"version\":\"1.9.2p180\",\"description\":\"Ruby 1.9.2\"}],\"appservers\":[{\"name\":\"thin\",\"description\":\"Thin\"}],\"detection\":[{\"config/application.rb\":true},{\"config/environment.rb\":true}]},\"django\":{\"name\":\"django\",\"runtimes\":[{\"name\":\"python26\",\"version\":\"2.6.5\",\"description\":\"Python 2.6.5\"}],\"appservers\":[],\"detection\":[{\"*.py\":\".\"}]},\"node\":{\"name\":\"node\",\"runtimes\":[{\"name\":\"node\",\"version\":\"0.4.5\",\"description\":\"Node.js\"}],\"appservers\":[],\"detection\":[{\"*.js\":\".\"}]},\"wsgi\":{\"name\":\"wsgi\",\"runtimes\":[{\"name\":\"python26\",\"version\":\"2.6.5\",\"description\":\"Python 2.6.5\"}],\"appservers\":[],\"detection\":[{\"*.py\":\".\"}]}}}"
42
+ http_version:
43
+ recorded_at: Fri, 02 Dec 2011 01:09:50 GMT
44
+ - request:
45
+ method: get
46
+ uri: http://api.vcap.me:80/info
47
+ body: ""
48
+ headers:
49
+ User-Agent:
50
+ - cloudfoundry-client-0.1.0
51
+ Authorization:
52
+ - 04085b0849221261646d696e40766361702e6d65063a0645546c2b070101dc4e22196ec60283e0258107d4a7d98f66644938607fb049
53
+ Accept:
54
+ - application/json
55
+ Content-Type:
56
+ - application/json
57
+ Accept-Encoding:
58
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
59
+ response:
60
+ status:
61
+ code: 200
62
+ message: OK
63
+ headers:
64
+ Server:
65
+ - nginx/0.7.65
66
+ Date:
67
+ - Fri, 02 Dec 2011 01:09:51 GMT
68
+ Content-Type:
69
+ - application/json; charset=utf-8
70
+ Transfer-Encoding:
71
+ - chunked
72
+ Connection:
73
+ - keep-alive
74
+ Keep-Alive:
75
+ - timeout=20
76
+ Etag:
77
+ - "\"14474b6291887f823279b1168c3c5063\""
78
+ Cache-Control:
79
+ - max-age=0, private, must-revalidate
80
+ X-Ua-Compatible:
81
+ - IE=Edge
82
+ body: "{\"name\":\"vcap\",\"build\":2222,\"support\":\"http://support.cloudfoundry.com\",\"version\":\"0.999\",\"description\":\"VMware's Cloud Application Platform\",\"allow_debug\":true,\"user\":\"admin@vcap.me\",\"limits\":{\"memory\":32768,\"app_uris\":16,\"services\":32,\"apps\":200},\"usage\":{\"memory\":0,\"apps\":0,\"services\":0},\"frameworks\":{\"grails\":{\"name\":\"grails\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"spring\":{\"name\":\"spring\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"sinatra\":{\"name\":\"sinatra\",\"runtimes\":[{\"name\":\"ruby18\",\"version\":\"1.8.7\",\"description\":\"Ruby 1.8.7\"},{\"name\":\"ruby19\",\"version\":\"1.9.2p180\",\"description\":\"Ruby 1.9.2\"}],\"appservers\":[{\"name\":\"thin\",\"description\":\"Thin\"}],\"detection\":[{\"*.rb\":\"require 'sinatra'|require \\\"sinatra\\\"\"},{\"config/environment.rb\":false}]},\"java_web\":{\"name\":\"java_web\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"php\":{\"name\":\"php\",\"runtimes\":[{\"name\":\"php\",\"version\":\"5.3\",\"description\":\"PHP 5\"}],\"appservers\":[{\"name\":\"apache\",\"description\":\"Apache\"}],\"detection\":[{\"*.php\":true}]},\"otp_rebar\":{\"name\":\"otp_rebar\",\"runtimes\":[{\"name\":\"erlangR14B02\",\"version\":\"R14B02\",\"description\":\"Erlang R14B02\"}],\"appservers\":[],\"detection\":[{\"releases/*/*.rel\":\".\"}]},\"lift\":{\"name\":\"lift\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"rails3\":{\"name\":\"rails3\",\"runtimes\":[{\"name\":\"ruby18\",\"version\":\"1.8.7\",\"description\":\"Ruby 1.8.7\"},{\"name\":\"ruby19\",\"version\":\"1.9.2p180\",\"description\":\"Ruby 1.9.2\"}],\"appservers\":[{\"name\":\"thin\",\"description\":\"Thin\"}],\"detection\":[{\"config/application.rb\":true},{\"config/environment.rb\":true}]},\"django\":{\"name\":\"django\",\"runtimes\":[{\"name\":\"python26\",\"version\":\"2.6.5\",\"description\":\"Python 2.6.5\"}],\"appservers\":[],\"detection\":[{\"*.py\":\".\"}]},\"node\":{\"name\":\"node\",\"runtimes\":[{\"name\":\"node\",\"version\":\"0.4.5\",\"description\":\"Node.js\"}],\"appservers\":[],\"detection\":[{\"*.js\":\".\"}]},\"wsgi\":{\"name\":\"wsgi\",\"runtimes\":[{\"name\":\"python26\",\"version\":\"2.6.5\",\"description\":\"Python 2.6.5\"}],\"appservers\":[],\"detection\":[{\"*.py\":\".\"}]}}}"
83
+ http_version:
84
+ recorded_at: Fri, 02 Dec 2011 01:09:50 GMT
85
+ recorded_with: VCR 2.0.0.beta2
@@ -0,0 +1,363 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://api.vcap.me:80/users
6
+ body: "{\"email\":\"user@vcap.me\",\"password\":\"foobar\"}"
7
+ headers:
8
+ User-Agent:
9
+ - cloudfoundry-client-0.1.0
10
+ Authorization:
11
+ - 04085b0849221261646d696e40766361702e6d65063a0645546c2b070101dc4e22196ec60283e0258107d4a7d98f66644938607fb049
12
+ Accept:
13
+ - application/json
14
+ Content-Type:
15
+ - application/json
16
+ response:
17
+ status:
18
+ code: 400
19
+ message: Bad Request
20
+ headers:
21
+ Server:
22
+ - nginx/0.7.65
23
+ Date:
24
+ - Fri, 02 Dec 2011 01:09:51 GMT
25
+ Content-Type:
26
+ - application/json; charset=utf-8
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Connection:
30
+ - keep-alive
31
+ Keep-Alive:
32
+ - timeout=20
33
+ Cache-Control:
34
+ - no-cache
35
+ X-Ua-Compatible:
36
+ - IE=Edge
37
+ body: "{\"code\":100,\"description\":\"Bad request\"}"
38
+ http_version:
39
+ recorded_at: Fri, 02 Dec 2011 01:09:50 GMT
40
+ - request:
41
+ method: get
42
+ uri: http://api.vcap.me:80/users
43
+ body: ""
44
+ headers:
45
+ User-Agent:
46
+ - cloudfoundry-client-0.1.0
47
+ Authorization:
48
+ - 04085b0849221261646d696e40766361702e6d65063a0645546c2b070101dc4e22196ec60283e0258107d4a7d98f66644938607fb049
49
+ Accept:
50
+ - application/json
51
+ Content-Type:
52
+ - application/json
53
+ Accept-Encoding:
54
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
55
+ response:
56
+ status:
57
+ code: 200
58
+ message: OK
59
+ headers:
60
+ Server:
61
+ - nginx/0.7.65
62
+ Date:
63
+ - Fri, 02 Dec 2011 01:09:52 GMT
64
+ Content-Type:
65
+ - application/json; charset=utf-8
66
+ Transfer-Encoding:
67
+ - chunked
68
+ Connection:
69
+ - keep-alive
70
+ Keep-Alive:
71
+ - timeout=20
72
+ Etag:
73
+ - "\"dbf9750f6f10ca8c34d7a42e0f3f16bf\""
74
+ Cache-Control:
75
+ - max-age=0, private, must-revalidate
76
+ X-Ua-Compatible:
77
+ - IE=Edge
78
+ body: "[{\"email\":\"admin@vcap.me\",\"admin\":true,\"apps\":[]},{\"email\":\"user@vcap.me\",\"admin\":false,\"apps\":[{\"name\":\"newapp\",\"state\":\"STOPPED\"}]},{\"email\":\"fakeuser1@vcap.me\",\"admin\":false,\"apps\":[]},{\"email\":\"fakeuser2@vcap.me\",\"admin\":false,\"apps\":[]},{\"email\":\"fakeuser@vcap.me\",\"admin\":false,\"apps\":[]}]"
79
+ http_version:
80
+ recorded_at: Fri, 02 Dec 2011 01:09:51 GMT
81
+ - request:
82
+ method: get
83
+ uri: http://api.vcap.me:80/users/nouser@vcap.me
84
+ body: ""
85
+ headers:
86
+ User-Agent:
87
+ - cloudfoundry-client-0.1.0
88
+ Authorization:
89
+ - 04085b0849221261646d696e40766361702e6d65063a0645546c2b070101dc4e22196ec60283e0258107d4a7d98f66644938607fb049
90
+ Accept:
91
+ - application/json
92
+ Content-Type:
93
+ - application/json
94
+ Accept-Encoding:
95
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
96
+ response:
97
+ status:
98
+ code: 403
99
+ message: Forbidden
100
+ headers:
101
+ Server:
102
+ - nginx/0.7.65
103
+ Date:
104
+ - Fri, 02 Dec 2011 01:09:52 GMT
105
+ Content-Type:
106
+ - application/json; charset=utf-8
107
+ Transfer-Encoding:
108
+ - chunked
109
+ Connection:
110
+ - keep-alive
111
+ Keep-Alive:
112
+ - timeout=20
113
+ Cache-Control:
114
+ - no-cache
115
+ X-Ua-Compatible:
116
+ - IE=Edge
117
+ body: "{\"code\":201,\"description\":\"User not found\"}"
118
+ http_version:
119
+ recorded_at: Fri, 02 Dec 2011 01:09:51 GMT
120
+ - request:
121
+ method: get
122
+ uri: http://api.vcap.me:80/users/fakeuser@vcap.me
123
+ body: ""
124
+ headers:
125
+ User-Agent:
126
+ - cloudfoundry-client-0.1.0
127
+ Authorization:
128
+ - 04085b0849221261646d696e40766361702e6d65063a0645546c2b070101dc4e22196ec60283e0258107d4a7d98f66644938607fb049
129
+ Accept:
130
+ - application/json
131
+ Content-Type:
132
+ - application/json
133
+ Accept-Encoding:
134
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
135
+ response:
136
+ status:
137
+ code: 200
138
+ message: OK
139
+ headers:
140
+ Server:
141
+ - nginx/0.7.65
142
+ Date:
143
+ - Fri, 02 Dec 2011 01:09:52 GMT
144
+ Content-Type:
145
+ - application/json; charset=utf-8
146
+ Transfer-Encoding:
147
+ - chunked
148
+ Connection:
149
+ - keep-alive
150
+ Keep-Alive:
151
+ - timeout=20
152
+ Etag:
153
+ - "\"3dd4a78f201e918efd9b16af0f2d2dfd\""
154
+ Cache-Control:
155
+ - max-age=0, private, must-revalidate
156
+ X-Ua-Compatible:
157
+ - IE=Edge
158
+ body: "{\"email\":\"fakeuser@vcap.me\"}"
159
+ http_version:
160
+ recorded_at: Fri, 02 Dec 2011 01:09:51 GMT
161
+ - request:
162
+ method: put
163
+ uri: http://api.vcap.me:80/users/fakeuser@vcap.me
164
+ body: "{\"email\":\"fakeuser@vcap.me\",\"password\":\"foobar\"}"
165
+ headers:
166
+ User-Agent:
167
+ - cloudfoundry-client-0.1.0
168
+ Authorization:
169
+ - 04085b0849221261646d696e40766361702e6d65063a0645546c2b070101dc4e22196ec60283e0258107d4a7d98f66644938607fb049
170
+ Accept:
171
+ - application/json
172
+ Content-Type:
173
+ - application/json
174
+ response:
175
+ status:
176
+ code: 204
177
+ message: No Content
178
+ headers:
179
+ Server:
180
+ - nginx/0.7.65
181
+ Date:
182
+ - Fri, 02 Dec 2011 01:09:52 GMT
183
+ Connection:
184
+ - keep-alive
185
+ Keep-Alive:
186
+ - timeout=20
187
+ Cache-Control:
188
+ - no-cache
189
+ X-Ua-Compatible:
190
+ - IE=Edge
191
+ body: ""
192
+ http_version:
193
+ recorded_at: Fri, 02 Dec 2011 01:09:51 GMT
194
+ - request:
195
+ method: delete
196
+ uri: http://api.vcap.me:80/users/nouser@vcap.me
197
+ body: ""
198
+ headers:
199
+ User-Agent:
200
+ - cloudfoundry-client-0.1.0
201
+ Authorization:
202
+ - 04085b0849221261646d696e40766361702e6d65063a0645546c2b070101dc4e22196ec60283e0258107d4a7d98f66644938607fb049
203
+ Accept:
204
+ - "*/*"
205
+ response:
206
+ status:
207
+ code: 403
208
+ message: Forbidden
209
+ headers:
210
+ Server:
211
+ - nginx/0.7.65
212
+ Date:
213
+ - Fri, 02 Dec 2011 01:09:52 GMT
214
+ Content-Type:
215
+ - application/json; charset=utf-8
216
+ Transfer-Encoding:
217
+ - chunked
218
+ Connection:
219
+ - keep-alive
220
+ Keep-Alive:
221
+ - timeout=20
222
+ Cache-Control:
223
+ - no-cache
224
+ X-Ua-Compatible:
225
+ - IE=Edge
226
+ body: "{\"code\":201,\"description\":\"User not found\"}"
227
+ http_version:
228
+ recorded_at: Fri, 02 Dec 2011 01:09:51 GMT
229
+ - request:
230
+ method: delete
231
+ uri: http://api.vcap.me:80/users/fakeuser@vcap.me
232
+ body: ""
233
+ headers:
234
+ User-Agent:
235
+ - cloudfoundry-client-0.1.0
236
+ Authorization:
237
+ - 04085b0849221261646d696e40766361702e6d65063a0645546c2b070101dc4e22196ec60283e0258107d4a7d98f66644938607fb049
238
+ Accept:
239
+ - "*/*"
240
+ response:
241
+ status:
242
+ code: 204
243
+ message: No Content
244
+ headers:
245
+ Server:
246
+ - nginx/0.7.65
247
+ Date:
248
+ - Fri, 02 Dec 2011 01:09:52 GMT
249
+ Connection:
250
+ - keep-alive
251
+ Keep-Alive:
252
+ - timeout=20
253
+ Cache-Control:
254
+ - no-cache
255
+ X-Ua-Compatible:
256
+ - IE=Edge
257
+ body: ""
258
+ http_version:
259
+ recorded_at: Fri, 02 Dec 2011 01:09:51 GMT
260
+ - request:
261
+ method: delete
262
+ uri: http://api.vcap.me:80/users/fakeuser1@vcap.me
263
+ body: ""
264
+ headers:
265
+ User-Agent:
266
+ - cloudfoundry-client-0.1.0
267
+ Authorization:
268
+ - 04085b0849221261646d696e40766361702e6d65063a0645546c2b070101dc4e22196ec60283e0258107d4a7d98f66644938607fb049
269
+ Accept:
270
+ - "*/*"
271
+ response:
272
+ status:
273
+ code: 204
274
+ message: No Content
275
+ headers:
276
+ Server:
277
+ - nginx/0.7.65
278
+ Date:
279
+ - Fri, 02 Dec 2011 01:09:53 GMT
280
+ Connection:
281
+ - keep-alive
282
+ Keep-Alive:
283
+ - timeout=20
284
+ Cache-Control:
285
+ - no-cache
286
+ X-Ua-Compatible:
287
+ - IE=Edge
288
+ body: ""
289
+ http_version:
290
+ recorded_at: Fri, 02 Dec 2011 01:09:51 GMT
291
+ - request:
292
+ method: delete
293
+ uri: http://api.vcap.me:80/users/fakeuser2@vcap.me
294
+ body: ""
295
+ headers:
296
+ User-Agent:
297
+ - cloudfoundry-client-0.1.0
298
+ Authorization:
299
+ - 04085b0849221261646d696e40766361702e6d65063a0645546c2b070101dc4e22196ec60283e0258107d4a7d98f66644938607fb049
300
+ Accept:
301
+ - "*/*"
302
+ response:
303
+ status:
304
+ code: 204
305
+ message: No Content
306
+ headers:
307
+ Server:
308
+ - nginx/0.7.65
309
+ Date:
310
+ - Fri, 02 Dec 2011 01:09:53 GMT
311
+ Connection:
312
+ - keep-alive
313
+ Keep-Alive:
314
+ - timeout=20
315
+ Cache-Control:
316
+ - no-cache
317
+ X-Ua-Compatible:
318
+ - IE=Edge
319
+ body: ""
320
+ http_version:
321
+ recorded_at: Fri, 02 Dec 2011 01:09:52 GMT
322
+ - request:
323
+ method: get
324
+ uri: http://api.vcap.me:80/info
325
+ body: ""
326
+ headers:
327
+ User-Agent:
328
+ - cloudfoundry-client-0.1.0
329
+ Authorization:
330
+ - 04085b0849221261646d696e40766361702e6d65063a0645546c2b070101dc4e22196ec60283e0258107d4a7d98f66644938607fb049
331
+ Accept:
332
+ - application/json
333
+ Content-Type:
334
+ - application/json
335
+ Accept-Encoding:
336
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
337
+ response:
338
+ status:
339
+ code: 200
340
+ message: OK
341
+ headers:
342
+ Server:
343
+ - nginx/0.7.65
344
+ Date:
345
+ - Fri, 02 Dec 2011 01:09:53 GMT
346
+ Content-Type:
347
+ - application/json; charset=utf-8
348
+ Transfer-Encoding:
349
+ - chunked
350
+ Connection:
351
+ - keep-alive
352
+ Keep-Alive:
353
+ - timeout=20
354
+ Etag:
355
+ - "\"14474b6291887f823279b1168c3c5063\""
356
+ Cache-Control:
357
+ - max-age=0, private, must-revalidate
358
+ X-Ua-Compatible:
359
+ - IE=Edge
360
+ body: "{\"name\":\"vcap\",\"build\":2222,\"support\":\"http://support.cloudfoundry.com\",\"version\":\"0.999\",\"description\":\"VMware's Cloud Application Platform\",\"allow_debug\":true,\"user\":\"admin@vcap.me\",\"limits\":{\"memory\":32768,\"app_uris\":16,\"services\":32,\"apps\":200},\"usage\":{\"memory\":0,\"apps\":0,\"services\":0},\"frameworks\":{\"grails\":{\"name\":\"grails\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"spring\":{\"name\":\"spring\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"sinatra\":{\"name\":\"sinatra\",\"runtimes\":[{\"name\":\"ruby18\",\"version\":\"1.8.7\",\"description\":\"Ruby 1.8.7\"},{\"name\":\"ruby19\",\"version\":\"1.9.2p180\",\"description\":\"Ruby 1.9.2\"}],\"appservers\":[{\"name\":\"thin\",\"description\":\"Thin\"}],\"detection\":[{\"*.rb\":\"require 'sinatra'|require \\\"sinatra\\\"\"},{\"config/environment.rb\":false}]},\"java_web\":{\"name\":\"java_web\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"php\":{\"name\":\"php\",\"runtimes\":[{\"name\":\"php\",\"version\":\"5.3\",\"description\":\"PHP 5\"}],\"appservers\":[{\"name\":\"apache\",\"description\":\"Apache\"}],\"detection\":[{\"*.php\":true}]},\"otp_rebar\":{\"name\":\"otp_rebar\",\"runtimes\":[{\"name\":\"erlangR14B02\",\"version\":\"R14B02\",\"description\":\"Erlang R14B02\"}],\"appservers\":[],\"detection\":[{\"releases/*/*.rel\":\".\"}]},\"lift\":{\"name\":\"lift\",\"runtimes\":[{\"name\":\"java\",\"version\":\"1.6\",\"description\":\"Java 6\"}],\"appservers\":[{\"name\":\"tomcat\",\"description\":\"Tomcat\"}],\"detection\":[{\"*.war\":true}]},\"rails3\":{\"name\":\"rails3\",\"runtimes\":[{\"name\":\"ruby18\",\"version\":\"1.8.7\",\"description\":\"Ruby 1.8.7\"},{\"name\":\"ruby19\",\"version\":\"1.9.2p180\",\"description\":\"Ruby 1.9.2\"}],\"appservers\":[{\"name\":\"thin\",\"description\":\"Thin\"}],\"detection\":[{\"config/application.rb\":true},{\"config/environment.rb\":true}]},\"django\":{\"name\":\"django\",\"runtimes\":[{\"name\":\"python26\",\"version\":\"2.6.5\",\"description\":\"Python 2.6.5\"}],\"appservers\":[],\"detection\":[{\"*.py\":\".\"}]},\"node\":{\"name\":\"node\",\"runtimes\":[{\"name\":\"node\",\"version\":\"0.4.5\",\"description\":\"Node.js\"}],\"appservers\":[],\"detection\":[{\"*.js\":\".\"}]},\"wsgi\":{\"name\":\"wsgi\",\"runtimes\":[{\"name\":\"python26\",\"version\":\"2.6.5\",\"description\":\"Python 2.6.5\"}],\"appservers\":[],\"detection\":[{\"*.py\":\".\"}]}}}"
361
+ http_version:
362
+ recorded_at: Fri, 02 Dec 2011 01:09:52 GMT
363
+ recorded_with: VCR 2.0.0.beta2