knife-cloudstack-fog 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.rdoc +142 -142
- data/lib/chef/knife/cloudstack_base.rb +101 -101
- data/lib/chef/knife/cloudstack_diskoffering_list.rb +57 -57
- data/lib/chef/knife/cloudstack_keypair_create.rb +102 -102
- data/lib/chef/knife/cloudstack_keypair_delete.rb +49 -49
- data/lib/chef/knife/cloudstack_keypair_list.rb +53 -53
- data/lib/chef/knife/cloudstack_network_create.rb +147 -147
- data/lib/chef/knife/cloudstack_network_delete.rb +53 -53
- data/lib/chef/knife/cloudstack_network_list.rb +67 -67
- data/lib/chef/knife/cloudstack_networkoffering_list.rb +74 -74
- data/lib/chef/knife/cloudstack_publicip_create.rb +90 -90
- data/lib/chef/knife/cloudstack_publicip_list.rb +57 -57
- data/lib/chef/knife/cloudstack_securitygroup_list.rb +124 -124
- data/lib/chef/knife/cloudstack_server_create.rb +513 -501
- data/lib/chef/knife/cloudstack_server_delete.rb +53 -53
- data/lib/chef/knife/cloudstack_server_destroy.rb +53 -53
- data/lib/chef/knife/cloudstack_server_list.rb +135 -135
- data/lib/chef/knife/cloudstack_server_start.rb +78 -75
- data/lib/chef/knife/cloudstack_server_stop.rb +83 -78
- data/lib/chef/knife/cloudstack_serviceoffering_list.rb +61 -61
- data/lib/chef/knife/cloudstack_template_list.rb +127 -127
- data/lib/chef/knife/cloudstack_volumes_list.rb +78 -78
- data/lib/chef/knife/cloudstack_zone_list.rb +63 -63
- data/lib/knife-cloudstack-fog/version.rb +5 -5
- metadata +14 -22
@@ -1,78 +1,78 @@
|
|
1
|
-
# Author:: Jeff Moody (<jmoody@datapipe.com>)
|
2
|
-
# Copyright:: Copyright (c) 2012 Datapipe
|
3
|
-
# License:: Apache License, Version 2.0
|
4
|
-
#
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
-
# you may not use this file except in compliance with the License.
|
7
|
-
# You may obtain a copy of the License at
|
8
|
-
#
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
#
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
# See the License for the specific language governing permissions and
|
15
|
-
# limitations under the License.
|
16
|
-
#
|
17
|
-
|
18
|
-
|
19
|
-
require 'chef/knife/cloudstack_base'
|
20
|
-
|
21
|
-
class Chef
|
22
|
-
class Knife
|
23
|
-
class CloudstackVolumeList < Knife
|
24
|
-
|
25
|
-
include Knife::CloudstackBase
|
26
|
-
|
27
|
-
banner "knife cloudstack volume list"
|
28
|
-
|
29
|
-
def run
|
30
|
-
$stdout.sync = true
|
31
|
-
|
32
|
-
validate!
|
33
|
-
|
34
|
-
volume_list = [
|
35
|
-
ui.color('ID', :bold),
|
36
|
-
ui.color('Name', :bold),
|
37
|
-
ui.color('Size (in GB)', :bold),
|
38
|
-
ui.color('Type', :bold),
|
39
|
-
ui.color('Virtual Machine', :bold),
|
40
|
-
ui.color('State', :bold)
|
41
|
-
]
|
42
|
-
|
43
|
-
response = connection.list_volumes['listvolumesresponse']
|
44
|
-
|
45
|
-
if volumes = response['volume']
|
46
|
-
volumes.each do |volume|
|
47
|
-
volume_list << volume['id'].to_s
|
48
|
-
volume_list << volume['name'].to_s
|
49
|
-
volume_size = volume['size']
|
50
|
-
volume_size = (volume_size/1024/1024/1024)
|
51
|
-
volume_list << volume_size.to_s
|
52
|
-
volume_list << volume['type']
|
53
|
-
if (volume['vmdisplayname'].nil?)
|
54
|
-
volume_list << ' '
|
55
|
-
else
|
56
|
-
volume_list << volume['vmdisplayname']
|
57
|
-
end
|
58
|
-
|
59
|
-
volume_list << begin
|
60
|
-
state = volume['state'].to_s.downcase
|
61
|
-
case state
|
62
|
-
when 'allocated'
|
63
|
-
ui.color(state, :red)
|
64
|
-
when 'pending'
|
65
|
-
ui.color(state, :yellow)
|
66
|
-
else
|
67
|
-
ui.color(state, :green)
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
puts ui.list(volume_list, :uneven_columns_across, 6)
|
72
|
-
end
|
73
|
-
|
74
|
-
end
|
75
|
-
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
1
|
+
# Author:: Jeff Moody (<jmoody@datapipe.com>)
|
2
|
+
# Copyright:: Copyright (c) 2012 Datapipe
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
|
18
|
+
|
19
|
+
require 'chef/knife/cloudstack_base'
|
20
|
+
|
21
|
+
class Chef
|
22
|
+
class Knife
|
23
|
+
class CloudstackVolumeList < Knife
|
24
|
+
|
25
|
+
include Knife::CloudstackBase
|
26
|
+
|
27
|
+
banner "knife cloudstack volume list"
|
28
|
+
|
29
|
+
def run
|
30
|
+
$stdout.sync = true
|
31
|
+
|
32
|
+
validate!
|
33
|
+
|
34
|
+
volume_list = [
|
35
|
+
ui.color('ID', :bold),
|
36
|
+
ui.color('Name', :bold),
|
37
|
+
ui.color('Size (in GB)', :bold),
|
38
|
+
ui.color('Type', :bold),
|
39
|
+
ui.color('Virtual Machine', :bold),
|
40
|
+
ui.color('State', :bold)
|
41
|
+
]
|
42
|
+
|
43
|
+
response = connection.list_volumes['listvolumesresponse']
|
44
|
+
|
45
|
+
if volumes = response['volume']
|
46
|
+
volumes.each do |volume|
|
47
|
+
volume_list << volume['id'].to_s
|
48
|
+
volume_list << volume['name'].to_s
|
49
|
+
volume_size = volume['size']
|
50
|
+
volume_size = (volume_size/1024/1024/1024)
|
51
|
+
volume_list << volume_size.to_s
|
52
|
+
volume_list << volume['type']
|
53
|
+
if (volume['vmdisplayname'].nil?)
|
54
|
+
volume_list << ' '
|
55
|
+
else
|
56
|
+
volume_list << volume['vmdisplayname']
|
57
|
+
end
|
58
|
+
|
59
|
+
volume_list << begin
|
60
|
+
state = volume['state'].to_s.downcase
|
61
|
+
case state
|
62
|
+
when 'allocated'
|
63
|
+
ui.color(state, :red)
|
64
|
+
when 'pending'
|
65
|
+
ui.color(state, :yellow)
|
66
|
+
else
|
67
|
+
ui.color(state, :green)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
puts ui.list(volume_list, :uneven_columns_across, 6)
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -1,63 +1,63 @@
|
|
1
|
-
# Author:: Jeff Moody (<jmoody@datapipe.com>)
|
2
|
-
# Copyright:: Copyright (c) 2012 Datapipe
|
3
|
-
# License:: Apache License, Version 2.0
|
4
|
-
#
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
-
# you may not use this file except in compliance with the License.
|
7
|
-
# You may obtain a copy of the License at
|
8
|
-
#
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
#
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
# See the License for the specific language governing permissions and
|
15
|
-
# limitations under the License.
|
16
|
-
#
|
17
|
-
|
18
|
-
|
19
|
-
require 'chef/knife/cloudstack_base'
|
20
|
-
|
21
|
-
class Chef
|
22
|
-
class Knife
|
23
|
-
class CloudstackZoneList < Knife
|
24
|
-
|
25
|
-
include Knife::CloudstackBase
|
26
|
-
|
27
|
-
banner "knife cloudstack zone list"
|
28
|
-
|
29
|
-
def run
|
30
|
-
$stdout.sync = true
|
31
|
-
|
32
|
-
validate!
|
33
|
-
|
34
|
-
zone_list = [
|
35
|
-
ui.color('ID', :bold),
|
36
|
-
ui.color('Name', :bold),
|
37
|
-
ui.color('Network Type', :bold),
|
38
|
-
ui.color('Security Groups?', :bold)
|
39
|
-
]
|
40
|
-
response = connection.list_zones['listzonesresponse']
|
41
|
-
if zones = response['zone']
|
42
|
-
zones.each do |zone|
|
43
|
-
zone_list << zone['id'].to_s
|
44
|
-
zone_list << zone['name'].to_s
|
45
|
-
zone_list << zone['networktype'].to_s
|
46
|
-
zone_list << begin
|
47
|
-
state = zone['securitygroupsenabled'].to_s.downcase
|
48
|
-
case state
|
49
|
-
when 'false'
|
50
|
-
ui.color('No', :red)
|
51
|
-
else
|
52
|
-
ui.color('Yes', :green)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
puts ui.list(zone_list, :columns_across, 4)
|
58
|
-
|
59
|
-
end
|
60
|
-
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
1
|
+
# Author:: Jeff Moody (<jmoody@datapipe.com>)
|
2
|
+
# Copyright:: Copyright (c) 2012 Datapipe
|
3
|
+
# License:: Apache License, Version 2.0
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
|
18
|
+
|
19
|
+
require 'chef/knife/cloudstack_base'
|
20
|
+
|
21
|
+
class Chef
|
22
|
+
class Knife
|
23
|
+
class CloudstackZoneList < Knife
|
24
|
+
|
25
|
+
include Knife::CloudstackBase
|
26
|
+
|
27
|
+
banner "knife cloudstack zone list"
|
28
|
+
|
29
|
+
def run
|
30
|
+
$stdout.sync = true
|
31
|
+
|
32
|
+
validate!
|
33
|
+
|
34
|
+
zone_list = [
|
35
|
+
ui.color('ID', :bold),
|
36
|
+
ui.color('Name', :bold),
|
37
|
+
ui.color('Network Type', :bold),
|
38
|
+
ui.color('Security Groups?', :bold)
|
39
|
+
]
|
40
|
+
response = connection.list_zones['listzonesresponse']
|
41
|
+
if zones = response['zone']
|
42
|
+
zones.each do |zone|
|
43
|
+
zone_list << zone['id'].to_s
|
44
|
+
zone_list << zone['name'].to_s
|
45
|
+
zone_list << zone['networktype'].to_s
|
46
|
+
zone_list << begin
|
47
|
+
state = zone['securitygroupsenabled'].to_s.downcase
|
48
|
+
case state
|
49
|
+
when 'false'
|
50
|
+
ui.color('No', :red)
|
51
|
+
else
|
52
|
+
ui.color('Yes', :green)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
puts ui.list(zone_list, :columns_across, 4)
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
module Knife
|
2
|
-
module Cloudstack
|
3
|
-
VERSION = "0.5.
|
4
|
-
MAJOR, MINOR, TINY = VERSION.split('.')
|
5
|
-
end
|
1
|
+
module Knife
|
2
|
+
module Cloudstack
|
3
|
+
VERSION = "0.5.1"
|
4
|
+
MAJOR, MINOR, TINY = VERSION.split('.')
|
5
|
+
end
|
6
6
|
end
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-cloudstack-fog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
5
|
-
prerelease:
|
4
|
+
version: 0.5.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Chirag Jog (chiragjog)
|
@@ -13,54 +12,48 @@ authors:
|
|
13
12
|
autorequire:
|
14
13
|
bindir: bin
|
15
14
|
cert_chain: []
|
16
|
-
date: 2013-
|
15
|
+
date: 2013-12-30 00:00:00.000000000 Z
|
17
16
|
dependencies:
|
18
17
|
- !ruby/object:Gem::Dependency
|
19
18
|
name: fog
|
20
19
|
requirement: !ruby/object:Gem::Requirement
|
21
|
-
none: false
|
22
20
|
requirements:
|
23
|
-
- -
|
21
|
+
- - '>='
|
24
22
|
- !ruby/object:Gem::Version
|
25
23
|
version: 1.10.0
|
26
24
|
type: :runtime
|
27
25
|
prerelease: false
|
28
26
|
version_requirements: !ruby/object:Gem::Requirement
|
29
|
-
none: false
|
30
27
|
requirements:
|
31
|
-
- -
|
28
|
+
- - '>='
|
32
29
|
- !ruby/object:Gem::Version
|
33
30
|
version: 1.10.0
|
34
31
|
- !ruby/object:Gem::Dependency
|
35
32
|
name: chef
|
36
33
|
requirement: !ruby/object:Gem::Requirement
|
37
|
-
none: false
|
38
34
|
requirements:
|
39
|
-
- -
|
35
|
+
- - '>='
|
40
36
|
- !ruby/object:Gem::Version
|
41
37
|
version: 11.2.0
|
42
38
|
type: :runtime
|
43
39
|
prerelease: false
|
44
40
|
version_requirements: !ruby/object:Gem::Requirement
|
45
|
-
none: false
|
46
41
|
requirements:
|
47
|
-
- -
|
42
|
+
- - '>='
|
48
43
|
- !ruby/object:Gem::Version
|
49
44
|
version: 11.2.0
|
50
45
|
- !ruby/object:Gem::Dependency
|
51
46
|
name: rake
|
52
47
|
requirement: !ruby/object:Gem::Requirement
|
53
|
-
none: false
|
54
48
|
requirements:
|
55
|
-
- -
|
49
|
+
- - '>='
|
56
50
|
- !ruby/object:Gem::Version
|
57
51
|
version: '0'
|
58
52
|
type: :runtime
|
59
53
|
prerelease: false
|
60
54
|
version_requirements: !ruby/object:Gem::Requirement
|
61
|
-
none: false
|
62
55
|
requirements:
|
63
|
-
- -
|
56
|
+
- - '>='
|
64
57
|
- !ruby/object:Gem::Version
|
65
58
|
version: '0'
|
66
59
|
description: Support for the Chef Knife command, leveraging FOG, for the Apache CloudStack
|
@@ -82,10 +75,10 @@ files:
|
|
82
75
|
- lib/chef/knife/cloudstack_keypair_create.rb
|
83
76
|
- lib/chef/knife/cloudstack_keypair_delete.rb
|
84
77
|
- lib/chef/knife/cloudstack_keypair_list.rb
|
85
|
-
- lib/chef/knife/cloudstack_networkoffering_list.rb
|
86
78
|
- lib/chef/knife/cloudstack_network_create.rb
|
87
79
|
- lib/chef/knife/cloudstack_network_delete.rb
|
88
80
|
- lib/chef/knife/cloudstack_network_list.rb
|
81
|
+
- lib/chef/knife/cloudstack_networkoffering_list.rb
|
89
82
|
- lib/chef/knife/cloudstack_portforwardingrule_list.rb
|
90
83
|
- lib/chef/knife/cloudstack_publicip_create.rb
|
91
84
|
- lib/chef/knife/cloudstack_publicip_list.rb
|
@@ -106,26 +99,25 @@ files:
|
|
106
99
|
homepage: https://github.com/fifthecho/knife-cloudstack-fog
|
107
100
|
licenses:
|
108
101
|
- Apache 2.0
|
102
|
+
metadata: {}
|
109
103
|
post_install_message:
|
110
104
|
rdoc_options: []
|
111
105
|
require_paths:
|
112
106
|
- lib
|
113
107
|
required_ruby_version: !ruby/object:Gem::Requirement
|
114
|
-
none: false
|
115
108
|
requirements:
|
116
|
-
- -
|
109
|
+
- - '>='
|
117
110
|
- !ruby/object:Gem::Version
|
118
111
|
version: '0'
|
119
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
-
none: false
|
121
113
|
requirements:
|
122
|
-
- -
|
114
|
+
- - '>='
|
123
115
|
- !ruby/object:Gem::Version
|
124
116
|
version: '0'
|
125
117
|
requirements: []
|
126
118
|
rubyforge_project:
|
127
|
-
rubygems_version:
|
119
|
+
rubygems_version: 2.0.14
|
128
120
|
signing_key:
|
129
|
-
specification_version:
|
121
|
+
specification_version: 4
|
130
122
|
summary: Cloudstack Compute Support for Chef's Knife Command
|
131
123
|
test_files: []
|