smartdc 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +7 -7
- data/README.md +5 -5
- data/VERSION +1 -1
- data/bin/sdc-addmachinemetadata +2 -2
- data/bin/sdc-addmachinetag +2 -2
- data/bin/sdc-createinstrumentation +1 -2
- data/bin/sdc-createkey +1 -2
- data/bin/sdc-createmachine +5 -5
- data/bin/sdc-createmachinesnapshot +1 -2
- data/bin/sdc-deleteinstrumentation +4 -2
- data/bin/sdc-deletekey +4 -2
- data/bin/sdc-deletemachine +4 -2
- data/bin/sdc-deletemachinemetadata +4 -2
- data/bin/sdc-deletemachinesnapshot +4 -3
- data/bin/sdc-deletemachinetag +4 -2
- data/bin/sdc-describeanalytics +1 -2
- data/bin/sdc-getdatacenter +1 -2
- data/bin/sdc-getdataset +1 -2
- data/bin/sdc-getinstrumentation +1 -2
- data/bin/sdc-getkey +1 -2
- data/bin/sdc-getmachine +3 -2
- data/bin/sdc-getmachinemetadata +4 -3
- data/bin/sdc-getmachinesnapshot +1 -2
- data/bin/sdc-getmachinetag +1 -2
- data/bin/sdc-getpackage +1 -2
- data/bin/sdc-listdatacenters +1 -2
- data/bin/sdc-listdatasets +1 -2
- data/bin/sdc-listinstrumentations +1 -2
- data/bin/sdc-listkeys +1 -2
- data/bin/sdc-listmachines +1 -2
- data/bin/sdc-listmachinesnapshots +1 -2
- data/bin/sdc-listmachinetags +1 -2
- data/bin/sdc-listpackages +1 -2
- data/bin/sdc-rebootmachine +4 -2
- data/bin/sdc-resizemachine +5 -3
- data/bin/sdc-setup +7 -3
- data/bin/sdc-startmachine +4 -2
- data/bin/sdc-startmachinefromsnapshot +4 -3
- data/bin/sdc-stopmachine +4 -2
- data/lib/smartdc.rb +1 -0
- data/lib/smartdc/api/analytics/instrumentations.rb +1 -2
- data/lib/smartdc/api/keys.rb +0 -1
- data/lib/smartdc/api/machine/metadata.rb +1 -2
- data/lib/smartdc/api/machine/snapshots.rb +1 -3
- data/lib/smartdc/api/machine/tags.rb +1 -2
- data/lib/smartdc/api/machines.rb +0 -5
- data/lib/smartdc/client.rb +4 -0
- data/lib/smartdc/error.rb +35 -0
- data/lib/smartdc/request.rb +13 -10
- data/lib/smartdc/response/mashify.rb +29 -0
- data/lib/smartdc/response/parse_json.rb +26 -0
- data/lib/smartdc/response/raise_error.rb +38 -0
- data/smartdc.gemspec +25 -23
- data/spec/smartdc/api/analytics_spec.rb +1 -1
- data/spec/smartdc/api/keys_spec.rb +1 -1
- data/spec/smartdc/api/machine/metadata_spec.rb +21 -4
- data/spec/smartdc/api/machine/snapshots_spec.rb +17 -5
- data/spec/smartdc/api/machine/tags_spec.rb +21 -4
- data/spec/smartdc/api/machines_spec.rb +19 -23
- data/spec/smartdc/request_spec.rb +3 -2
- data/spec/spec_helper.rb +7 -1
- metadata +33 -31
- data/lib/faraday/response/mashify.rb +0 -26
- data/lib/faraday/response/parse_json.rb +0 -22
data/Gemfile
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
3
|
group :development do
|
4
|
-
gem "rspec", "~> 2.
|
4
|
+
gem "rspec", "~> 2.8.0"
|
5
5
|
gem "bundler", "~> 1.0.0"
|
6
|
-
gem "jeweler", "~> 1.
|
7
|
-
gem "rcov", "
|
6
|
+
gem "jeweler", "~> 1.8.3"
|
7
|
+
gem "rcov", "~> 0.9.11"
|
8
8
|
gem "uuid", "~> 2.3.4"
|
9
9
|
end
|
10
10
|
|
11
11
|
group :runtime do
|
12
|
-
gem "faraday", "~> 0.7.
|
12
|
+
gem "faraday", "~> 0.7.6"
|
13
13
|
gem "hashie", "~> 1.2.0"
|
14
|
-
gem "multi_json", "~> 1.0
|
15
|
-
gem "multipart-post", "~> 1.1.
|
16
|
-
end
|
14
|
+
gem "multi_json", "~> 1.1.0"
|
15
|
+
gem "multipart-post", "~> 1.1.4"
|
16
|
+
end
|
data/README.md
CHANGED
@@ -65,23 +65,23 @@ Connect and Machine find.
|
|
65
65
|
end
|
66
66
|
|
67
67
|
|
68
|
-
|
68
|
+
Format of the return value.
|
69
69
|
|
70
70
|
client = Smartdc.new(config)
|
71
71
|
|
72
72
|
# Type of a variable to mash. (Default)
|
73
|
-
client.
|
73
|
+
client.format = 'mash'
|
74
74
|
puts client.datacenters.find #=> #<Hashie::Mash example="example.com">
|
75
75
|
|
76
76
|
# Type of a variable to hash.
|
77
|
-
client.
|
77
|
+
client.format = 'hash'
|
78
78
|
puts client.datacenters.find #=> {"example"=>"https://example.com"}
|
79
79
|
|
80
80
|
# Type of a variable to json.
|
81
|
-
client.
|
81
|
+
client.format = 'json'
|
82
82
|
puts client.datacenters.find #=> {"example": "https://example.com"}
|
83
83
|
|
84
84
|
|
85
85
|
## Copyright
|
86
86
|
|
87
|
-
Copyright (c)
|
87
|
+
Copyright (c) 2012 ogom. See LICENSE.md for further details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/bin/sdc-addmachinemetadata
CHANGED
data/bin/sdc-addmachinetag
CHANGED
data/bin/sdc-createkey
CHANGED
data/bin/sdc-createmachine
CHANGED
@@ -10,12 +10,11 @@ OptionParser.new do |opts|
|
|
10
10
|
opts.on('-p', '--package NAME', 'Name of the package to use on provisioning.') {|v| options[:package] = v }
|
11
11
|
opts.on('-h','--help') do
|
12
12
|
puts opts
|
13
|
-
print 'Datasets(urn):'
|
13
|
+
print "\n" + 'Datasets(urn):'
|
14
14
|
fixture('datasets').each do |dataset|
|
15
15
|
print ' ' + dataset['urn']
|
16
16
|
end
|
17
|
-
|
18
|
-
print 'Packages(name):'
|
17
|
+
print "\n\n" + 'Packages(name):'
|
19
18
|
fixture('packages').each do |packages|
|
20
19
|
print ' ' + packages['name']
|
21
20
|
end
|
@@ -32,8 +31,9 @@ OptionParser.new do |opts|
|
|
32
31
|
end
|
33
32
|
|
34
33
|
begin
|
35
|
-
client.request.return_variable = 'json'
|
36
34
|
puts client.machines.create options
|
37
|
-
rescue => e
|
35
|
+
rescue Smartdc::Error::Conflict => e
|
38
36
|
puts e
|
37
|
+
rescue => e
|
38
|
+
puts e.inspect
|
39
39
|
end
|
@@ -4,7 +4,9 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
4
4
|
require 'cli_helper'
|
5
5
|
|
6
6
|
begin
|
7
|
-
|
7
|
+
client.analytics.instrumentations(ARGV[0]).delete
|
8
8
|
rescue => e
|
9
|
-
puts e
|
9
|
+
puts e.inspect
|
10
|
+
else
|
11
|
+
puts "Success"
|
10
12
|
end
|
data/bin/sdc-deletekey
CHANGED
data/bin/sdc-deletemachine
CHANGED
@@ -21,8 +21,9 @@ OptionParser.new do |opts|
|
|
21
21
|
end
|
22
22
|
|
23
23
|
begin
|
24
|
-
client.
|
25
|
-
puts client.machines(ARGV[0]).snapshots(options[:name]).delete
|
24
|
+
client.machines(ARGV[0]).snapshots(options[:name]).delete
|
26
25
|
rescue => e
|
27
|
-
puts e
|
26
|
+
puts e.inspect
|
27
|
+
else
|
28
|
+
puts "Success"
|
28
29
|
end
|
data/bin/sdc-deletemachinetag
CHANGED
data/bin/sdc-describeanalytics
CHANGED
data/bin/sdc-getdatacenter
CHANGED
data/bin/sdc-getdataset
CHANGED
data/bin/sdc-getinstrumentation
CHANGED
@@ -21,12 +21,11 @@ OptionParser.new do |opts|
|
|
21
21
|
end
|
22
22
|
|
23
23
|
begin
|
24
|
-
client.request.return_variable = 'json'
|
25
24
|
if options[:value]
|
26
25
|
puts client.analytics.instrumentations(ARGV[0]).value
|
27
26
|
else
|
28
27
|
puts client.analytics.instrumentations(ARGV[0]).read
|
29
28
|
end
|
30
29
|
rescue => e
|
31
|
-
puts e
|
30
|
+
puts e.inspect
|
32
31
|
end
|
data/bin/sdc-getkey
CHANGED
data/bin/sdc-getmachine
CHANGED
@@ -4,8 +4,9 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
4
4
|
require 'cli_helper'
|
5
5
|
|
6
6
|
begin
|
7
|
-
client.request.return_variable = 'json'
|
8
7
|
puts client.machines(ARGV[0]).read
|
9
|
-
rescue => e
|
8
|
+
rescue Smartdc::Error::NotFound => e
|
10
9
|
puts e
|
10
|
+
rescue => e
|
11
|
+
puts e.inspect
|
11
12
|
end
|
data/bin/sdc-getmachinemetadata
CHANGED
@@ -3,9 +3,10 @@
|
|
3
3
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
4
4
|
require 'cli_helper'
|
5
5
|
|
6
|
+
|
7
|
+
|
6
8
|
begin
|
7
|
-
client.
|
8
|
-
puts client.machines(ARGV[0]).metadata.find
|
9
|
+
puts client.machines(ARGV[0]).metadata.find
|
9
10
|
rescue => e
|
10
|
-
puts e
|
11
|
+
puts e.inspect
|
11
12
|
end
|
data/bin/sdc-getmachinesnapshot
CHANGED
data/bin/sdc-getmachinetag
CHANGED
data/bin/sdc-getpackage
CHANGED
data/bin/sdc-listdatacenters
CHANGED
data/bin/sdc-listdatasets
CHANGED
data/bin/sdc-listkeys
CHANGED
data/bin/sdc-listmachines
CHANGED
data/bin/sdc-listmachinetags
CHANGED
data/bin/sdc-listpackages
CHANGED
data/bin/sdc-rebootmachine
CHANGED
data/bin/sdc-resizemachine
CHANGED
@@ -9,7 +9,7 @@ OptionParser.new do |opts|
|
|
9
9
|
opts.on('-p', '--package NAME', 'Name of the package to use on provisioning.') {|v| options[:package] = v }
|
10
10
|
opts.on('-h','--help') do
|
11
11
|
puts opts
|
12
|
-
print 'Packages(name):'
|
12
|
+
print "\n" + 'Packages(name):'
|
13
13
|
fixture('packages').each do |packages|
|
14
14
|
print ' ' + packages['name']
|
15
15
|
end
|
@@ -26,7 +26,9 @@ OptionParser.new do |opts|
|
|
26
26
|
end
|
27
27
|
|
28
28
|
begin
|
29
|
-
|
29
|
+
client.machines(ARGV[0]).resize options
|
30
30
|
rescue => e
|
31
|
-
puts e
|
31
|
+
puts e.inspect
|
32
|
+
else
|
33
|
+
puts "Success"
|
32
34
|
end
|