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 ADDED
@@ -0,0 +1,6 @@
1
+ v0.0.2
2
+ - added 'simple_load_test' API to get a simple load test (running or completed)
3
+ - fixed an issue where jobs() did not symbolize hash keys in response.
4
+
5
+ v0.0.1
6
+ - Initial release!
data/README CHANGED
@@ -2,5 +2,4 @@ CloudAssault Ruby Client
2
2
 
3
3
  The CloudAssault Ruby client is an API binding for ruby that can be used to make calls against the CloudAssault infrastructure.
4
4
 
5
- https://www.cloudassault.com
6
-
5
+ https://www.cloudassault.com
@@ -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)
@@ -1,5 +1,5 @@
1
1
  module CloudAssault
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
 
4
4
  def self.version_string
5
5
  "CloudAssault version #{CloudAssault::VERSION}"
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.1
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