cloudstack-cli 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,12 @@
1
+ module CloudstackClient
2
+ class ConnectionHelper
3
+ def self.load_configuration(config_file = File.join(File.dirname(__FILE__), '..', '..', 'config', 'cloudstack.yml'))
4
+ begin
5
+ return YAML::load(IO.read(config_file))
6
+ rescue Exception => e
7
+ puts "Unable to load '#{config_file}' : #{e}".color(:red)
8
+ exit
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,15 @@
1
+ module SshCommand
2
+ require 'net/ssh'
3
+
4
+ def SshCommand.run(connection, *commands)
5
+ ENV['HOME'] = File.dirname(__FILE__) # fixes "non-absolute home" exceptions
6
+ output = ""
7
+ Net::SSH.start(connection[:host], connection[:username], :password => connection[:password]) do |session|
8
+ commands.each do |cmd|
9
+ output = session.exec!("source ~/.bash_profile && " + cmd)
10
+ yield output if block_given?
11
+ end
12
+ end
13
+ output
14
+ end
15
+ end
@@ -0,0 +1,16 @@
1
+ $LOAD_PATH.unshift File.dirname(__FILE__)
2
+
3
+ require 'yaml'
4
+ require 'rainbow'
5
+ require "thor"
6
+ require 'command_line_reporter'
7
+
8
+ require "cloudstack-cli/version"
9
+
10
+ # require subcommands
11
+ Dir[File.dirname(__FILE__) + '/../lib/cloudstack-cli/commands/*.rb'].each do |file|
12
+ require file
13
+ end
14
+
15
+ require "cloudstack-cli/helper"
16
+ require "cloudstack-cli/cli"
@@ -0,0 +1,5 @@
1
+ $LOAD_PATH.unshift File.dirname(__FILE__)
2
+
3
+ require "cloudstack-client/client"
4
+ require "cloudstack-client/helper"
5
+ require "cloudstack-client/ssh_command"
metadata ADDED
@@ -0,0 +1,171 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cloudstack-cli
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - niwo
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-07-19 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rdoc
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 10.0.4
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 10.0.4
46
+ - !ruby/object:Gem::Dependency
47
+ name: thor
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 0.18.1
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 0.18.1
62
+ - !ruby/object:Gem::Dependency
63
+ name: net-ssh
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 2.6.7
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 2.6.7
78
+ - !ruby/object:Gem::Dependency
79
+ name: rainbow
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: 1.1.4
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 1.1.4
94
+ - !ruby/object:Gem::Dependency
95
+ name: command_line_reporter
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ version: 3.2.1
102
+ type: :runtime
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 3.2.1
110
+ description: Cloudstack CLI gives command line access to the CloudStack API commands.
111
+ email:
112
+ - nik.wolfgramm@gmail.com
113
+ executables:
114
+ - cs
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - .gitignore
119
+ - Gemfile
120
+ - Gemfile.lock
121
+ - LICENSE.txt
122
+ - README.md
123
+ - bin/cs
124
+ - cloudstack-cli.gemspec
125
+ - config/cloudstack.example.yml
126
+ - lib/cloudstack-cli/cli.rb
127
+ - lib/cloudstack-cli/commands/account.rb
128
+ - lib/cloudstack-cli/commands/domain.rb
129
+ - lib/cloudstack-cli/commands/load_balancer.rb
130
+ - lib/cloudstack-cli/commands/network.rb
131
+ - lib/cloudstack-cli/commands/offering.rb
132
+ - lib/cloudstack-cli/commands/project.rb
133
+ - lib/cloudstack-cli/commands/publicip.rb
134
+ - lib/cloudstack-cli/commands/router.rb
135
+ - lib/cloudstack-cli/commands/server.rb
136
+ - lib/cloudstack-cli/commands/stack.rb
137
+ - lib/cloudstack-cli/commands/template.rb
138
+ - lib/cloudstack-cli/commands/volume.rb
139
+ - lib/cloudstack-cli/commands/zone.rb
140
+ - lib/cloudstack-cli/helper.rb
141
+ - lib/cloudstack-cli/version.rb
142
+ - lib/cloudstack-client/client.rb
143
+ - lib/cloudstack-client/helper.rb
144
+ - lib/cloudstack-client/ssh_command.rb
145
+ - lib/cloudstack_cli.rb
146
+ - lib/cloudstack_client.rb
147
+ homepage: ''
148
+ licenses: []
149
+ post_install_message:
150
+ rdoc_options: []
151
+ require_paths:
152
+ - lib
153
+ required_ruby_version: !ruby/object:Gem::Requirement
154
+ none: false
155
+ requirements:
156
+ - - ! '>='
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
159
+ required_rubygems_version: !ruby/object:Gem::Requirement
160
+ none: false
161
+ requirements:
162
+ - - ! '>='
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
165
+ requirements: []
166
+ rubyforge_project:
167
+ rubygems_version: 1.8.23
168
+ signing_key:
169
+ specification_version: 3
170
+ summary: cloudstack-cli
171
+ test_files: []