cloudassault 0.0.1 → 0.0.2
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.
- data/CHANGES +6 -0
- data/README +1 -2
- data/lib/cloudassault/client.rb +10 -1
- data/lib/cloudassault/version.rb +1 -1
- data/spec/client_spec.rb +8 -0
- metadata +2 -1
data/CHANGES
ADDED
data/README
CHANGED
data/lib/cloudassault/client.rb
CHANGED
@@ -43,7 +43,16 @@ class CloudAssault::Client
|
|
43
43
|
url = @base_url + "users/#{@user_id}/jobs"
|
44
44
|
CloudAssault.logger.debug "GET Request: #{url} ;; Headers: #{build_headers.inspect}" if CloudAssault.logger
|
45
45
|
r = RestClient.get url, build_headers
|
46
|
-
JSON.parse(r.body)
|
46
|
+
JSON.parse(r.body, :symbolize_names => true)
|
47
|
+
end
|
48
|
+
|
49
|
+
def simple_load_test(id)
|
50
|
+
load_root if @user_id.nil?
|
51
|
+
|
52
|
+
url = @base_url + "simple_load_tests/#{id}"
|
53
|
+
CloudAssault.logger.debug "GET Request: #{url} ;; Headers: #{build_headers.inspect}" if CloudAssault.logger
|
54
|
+
r = RestClient.get url, build_headers
|
55
|
+
JSON.parse(r.body, :symbolize_names => true)
|
47
56
|
end
|
48
57
|
|
49
58
|
def estimate_simple_load_test(name, desc, url, connections, minutes)
|
data/lib/cloudassault/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -40,6 +40,14 @@ describe CloudAssault::Client do
|
|
40
40
|
tests.length.should == 3
|
41
41
|
end
|
42
42
|
|
43
|
+
it "should get a simple load test by id" do
|
44
|
+
stub_request(:get, "https://#{CloudAssault.API_KEY}:@www.cloudassault.com/simple_load_tests/1").with(:headers => {'Accept' => 'application/json'}).to_return(:body => '{"canceled_at":null,"completed_at":"2011-09-17T03:04:28Z","cost":null,"description":"test","id":1,"name":"test test","job_type":"SimpleLoadTest","links":[{"href":"http://cloudassault.com/simple_load_tests/1","rel":"simple_load_test"}]}', :status => 200, :headers => {'Content-Type' => 'application/json'})
|
45
|
+
|
46
|
+
test = @client.simple_load_test(1)
|
47
|
+
test[:id].should == 1
|
48
|
+
test[:name].should == 'test test'
|
49
|
+
end
|
50
|
+
|
43
51
|
it "should allow estimation of tests" do
|
44
52
|
stub_request(:post, "https://#{CloudAssault.API_KEY}:@www.cloudassault.com/simple_load_tests/estimate")
|
45
53
|
.with(:body => '{"simple_load_test":{"url":"https://www.cloudassault.com/","concurrent_connections":15,"duration_in_minutes":5,"job_attributes":{"name":"Test CloudAssault","description":"description"}}}', :headers => {'Accept' => 'application/json', 'Content-Type' => 'application/json'})
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: cloudassault
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Adam Schepis
|
@@ -68,6 +68,7 @@ extra_rdoc_files: []
|
|
68
68
|
|
69
69
|
files:
|
70
70
|
- .gitignore
|
71
|
+
- CHANGES
|
71
72
|
- Gemfile
|
72
73
|
- README
|
73
74
|
- Rakefile
|