knife-azure 1.1.4 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/README.md +37 -0
- data/lib/azure/ag.rb +97 -0
- data/lib/azure/connection.rb +25 -7
- data/lib/azure/deploy.rb +8 -4
- data/lib/azure/host.rb +7 -4
- data/lib/azure/rest.rb +32 -8
- data/lib/azure/role.rb +85 -55
- data/lib/azure/storageaccount.rb +4 -2
- data/lib/azure/utility.rb +12 -0
- data/lib/azure/vnet.rb +89 -0
- data/lib/chef/knife/azure_ag_create.rb +76 -0
- data/lib/chef/knife/azure_ag_list.rb +51 -0
- data/lib/chef/knife/azure_base.rb +9 -0
- data/lib/chef/knife/azure_server_create.rb +61 -31
- data/lib/chef/knife/azure_server_delete.rb +8 -1
- data/lib/chef/knife/{azure_server_describe.rb → azure_server_show.rb} +22 -14
- data/lib/chef/knife/azure_vnet_create.rb +77 -0
- data/lib/chef/knife/azure_vnet_list.rb +52 -0
- data/lib/knife-azure/version.rb +1 -1
- metadata +28 -43
@@ -0,0 +1,77 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Jeff Mendoza (jeffmendoza@live.com)
|
3
|
+
# Copyright:: Copyright (c) 2013 Opscode, Inc.
|
4
|
+
# License:: Apache License, Version 2.0
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require File.expand_path('../azure_base', __FILE__)
|
20
|
+
|
21
|
+
class Chef
|
22
|
+
class Knife
|
23
|
+
class AzureVnetCreate < Knife
|
24
|
+
include Knife::AzureBase
|
25
|
+
|
26
|
+
banner 'knife azure vnet create (options)'
|
27
|
+
|
28
|
+
option :azure_network_name,
|
29
|
+
:short => '-n NETWORK_NAME',
|
30
|
+
:long => '--azure-network-name NETWORK_NAME',
|
31
|
+
:description =>
|
32
|
+
'Specifies the name of the virtual network to create.'
|
33
|
+
|
34
|
+
option :azure_affinity_group,
|
35
|
+
:short => '-a GROUP',
|
36
|
+
:long => '--azure-affinity-group GROUP',
|
37
|
+
:description =>
|
38
|
+
'Specifies the affinity group to associate with the vnet.'
|
39
|
+
|
40
|
+
option :azure_address_space,
|
41
|
+
:long => '--azure-address-space CIDR',
|
42
|
+
:description =>
|
43
|
+
'Specifies the address space of the vnet using CIDR notation.'
|
44
|
+
|
45
|
+
def run
|
46
|
+
$stdout.sync = true
|
47
|
+
|
48
|
+
Chef::Log.info('validating...')
|
49
|
+
validate!([:azure_subscription_id,
|
50
|
+
:azure_mgmt_cert,
|
51
|
+
:azure_api_host_name,
|
52
|
+
:azure_network_name,
|
53
|
+
:azure_affinity_group,
|
54
|
+
:azure_address_space])
|
55
|
+
|
56
|
+
params = {
|
57
|
+
azure_vnet_name: locate_config_value(:azure_network_name),
|
58
|
+
azure_ag_name: locate_config_value(:azure_affinity_group),
|
59
|
+
azure_address_space: locate_config_value(:azure_address_space),
|
60
|
+
}
|
61
|
+
|
62
|
+
rsp = connection.vnets.create(params)
|
63
|
+
print "\n"
|
64
|
+
if rsp.at_css('Status').nil?
|
65
|
+
if rsp.at_css('Code').nil? || rsp.at_css('Message').nil?
|
66
|
+
puts 'Unknown Error. try -VV'
|
67
|
+
else
|
68
|
+
puts "#{rsp.at_css('Code').content}: "\
|
69
|
+
"#{rsp.at_css('Message').content}"
|
70
|
+
end
|
71
|
+
else
|
72
|
+
puts "Creation status: #{rsp.at_css('Status').content}"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Jeff Mendoza (jeffmendoza@live.com)
|
3
|
+
# Copyright:: Copyright (c) 2013 Opscode, Inc.
|
4
|
+
# License:: Apache License, Version 2.0
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require File.expand_path('../azure_base', __FILE__)
|
20
|
+
|
21
|
+
class Chef
|
22
|
+
class Knife
|
23
|
+
class AzureVnetList < Knife
|
24
|
+
include Knife::AzureBase
|
25
|
+
|
26
|
+
deps { require 'highline' }
|
27
|
+
|
28
|
+
banner 'knife azure vnet list (options)'
|
29
|
+
|
30
|
+
def hl
|
31
|
+
@highline ||= HighLine.new
|
32
|
+
end
|
33
|
+
|
34
|
+
def run
|
35
|
+
$stdout.sync = true
|
36
|
+
|
37
|
+
validate!
|
38
|
+
|
39
|
+
cols = ['Name', 'Affinity Group', 'State']
|
40
|
+
the_list = cols.map { |col| ui.color(col, :bold) }
|
41
|
+
connection.vnets.all.each do |vnet|
|
42
|
+
%w(name affinity_group state).each do |attr|
|
43
|
+
the_list << vnet.send(attr).to_s
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
puts "\n"
|
48
|
+
puts hl.list(the_list, :uneven_columns_across, cols.size)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
data/lib/knife-azure/version.rb
CHANGED
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-azure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Barry Davis
|
@@ -10,28 +9,11 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 2014-02-04 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
16
|
-
name: chef
|
17
|
-
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
|
-
requirements:
|
20
|
-
- - ! '>='
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 0.10.0
|
23
|
-
type: :runtime
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
|
-
requirements:
|
28
|
-
- - ! '>='
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
version: 0.10.0
|
31
14
|
- !ruby/object:Gem::Dependency
|
32
15
|
name: rdoc
|
33
16
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
17
|
requirements:
|
36
18
|
- - ~>
|
37
19
|
- !ruby/object:Gem::Version
|
@@ -39,7 +21,6 @@ dependencies:
|
|
39
21
|
type: :runtime
|
40
22
|
prerelease: false
|
41
23
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
24
|
requirements:
|
44
25
|
- - ~>
|
45
26
|
- !ruby/object:Gem::Version
|
@@ -47,7 +28,6 @@ dependencies:
|
|
47
28
|
- !ruby/object:Gem::Dependency
|
48
29
|
name: bundler
|
49
30
|
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
31
|
requirements:
|
52
32
|
- - ! '>='
|
53
33
|
- !ruby/object:Gem::Version
|
@@ -55,7 +35,6 @@ dependencies:
|
|
55
35
|
type: :runtime
|
56
36
|
prerelease: false
|
57
37
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
38
|
requirements:
|
60
39
|
- - ! '>='
|
61
40
|
- !ruby/object:Gem::Version
|
@@ -63,7 +42,6 @@ dependencies:
|
|
63
42
|
- !ruby/object:Gem::Dependency
|
64
43
|
name: rubygems-bundler
|
65
44
|
requirement: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
45
|
requirements:
|
68
46
|
- - ~>
|
69
47
|
- !ruby/object:Gem::Version
|
@@ -71,7 +49,6 @@ dependencies:
|
|
71
49
|
type: :runtime
|
72
50
|
prerelease: false
|
73
51
|
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
52
|
requirements:
|
76
53
|
- - ~>
|
77
54
|
- !ruby/object:Gem::Version
|
@@ -79,7 +56,6 @@ dependencies:
|
|
79
56
|
- !ruby/object:Gem::Dependency
|
80
57
|
name: equivalent-xml
|
81
58
|
requirement: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
59
|
requirements:
|
84
60
|
- - ~>
|
85
61
|
- !ruby/object:Gem::Version
|
@@ -87,7 +63,6 @@ dependencies:
|
|
87
63
|
type: :runtime
|
88
64
|
prerelease: false
|
89
65
|
version_requirements: !ruby/object:Gem::Requirement
|
90
|
-
none: false
|
91
66
|
requirements:
|
92
67
|
- - ~>
|
93
68
|
- !ruby/object:Gem::Version
|
@@ -95,7 +70,6 @@ dependencies:
|
|
95
70
|
- !ruby/object:Gem::Dependency
|
96
71
|
name: nokogiri
|
97
72
|
requirement: !ruby/object:Gem::Requirement
|
98
|
-
none: false
|
99
73
|
requirements:
|
100
74
|
- - ! '>='
|
101
75
|
- !ruby/object:Gem::Version
|
@@ -103,7 +77,6 @@ dependencies:
|
|
103
77
|
type: :runtime
|
104
78
|
prerelease: false
|
105
79
|
version_requirements: !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
107
80
|
requirements:
|
108
81
|
- - ! '>='
|
109
82
|
- !ruby/object:Gem::Version
|
@@ -111,23 +84,34 @@ dependencies:
|
|
111
84
|
- !ruby/object:Gem::Dependency
|
112
85
|
name: knife-windows
|
113
86
|
requirement: !ruby/object:Gem::Requirement
|
114
|
-
none: false
|
115
87
|
requirements:
|
116
88
|
- - ! '>='
|
117
89
|
- !ruby/object:Gem::Version
|
118
|
-
version:
|
90
|
+
version: 0.5.14
|
119
91
|
type: :runtime
|
120
92
|
prerelease: false
|
121
93
|
version_requirements: !ruby/object:Gem::Requirement
|
122
|
-
none: false
|
123
94
|
requirements:
|
124
95
|
- - ! '>='
|
125
96
|
- !ruby/object:Gem::Version
|
126
|
-
version:
|
97
|
+
version: 0.5.14
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: chef
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ! '>='
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: 11.8.2
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ! '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: 11.8.2
|
127
112
|
- !ruby/object:Gem::Dependency
|
128
113
|
name: mixlib-config
|
129
114
|
requirement: !ruby/object:Gem::Requirement
|
130
|
-
none: false
|
131
115
|
requirements:
|
132
116
|
- - ~>
|
133
117
|
- !ruby/object:Gem::Version
|
@@ -135,7 +119,6 @@ dependencies:
|
|
135
119
|
type: :development
|
136
120
|
prerelease: false
|
137
121
|
version_requirements: !ruby/object:Gem::Requirement
|
138
|
-
none: false
|
139
122
|
requirements:
|
140
123
|
- - ~>
|
141
124
|
- !ruby/object:Gem::Version
|
@@ -150,6 +133,7 @@ extra_rdoc_files:
|
|
150
133
|
files:
|
151
134
|
- LICENSE
|
152
135
|
- README.md
|
136
|
+
- lib/azure/ag.rb
|
153
137
|
- lib/azure/certificate.rb
|
154
138
|
- lib/azure/connection.rb
|
155
139
|
- lib/azure/deploy.rb
|
@@ -160,39 +144,40 @@ files:
|
|
160
144
|
- lib/azure/role.rb
|
161
145
|
- lib/azure/storageaccount.rb
|
162
146
|
- lib/azure/utility.rb
|
147
|
+
- lib/azure/vnet.rb
|
148
|
+
- lib/chef/knife/azure_ag_create.rb
|
149
|
+
- lib/chef/knife/azure_ag_list.rb
|
163
150
|
- lib/chef/knife/azure_base.rb
|
164
151
|
- lib/chef/knife/azure_image_list.rb
|
165
152
|
- lib/chef/knife/azure_server_create.rb
|
166
153
|
- lib/chef/knife/azure_server_delete.rb
|
167
|
-
- lib/chef/knife/azure_server_describe.rb
|
168
154
|
- lib/chef/knife/azure_server_list.rb
|
155
|
+
- lib/chef/knife/azure_server_show.rb
|
156
|
+
- lib/chef/knife/azure_vnet_create.rb
|
157
|
+
- lib/chef/knife/azure_vnet_list.rb
|
169
158
|
- lib/knife-azure/version.rb
|
170
159
|
homepage: http://github.com/opscode/knife-azure
|
171
160
|
licenses:
|
172
161
|
- Apache 2.0
|
162
|
+
metadata: {}
|
173
163
|
post_install_message:
|
174
164
|
rdoc_options: []
|
175
165
|
require_paths:
|
176
166
|
- lib
|
177
167
|
required_ruby_version: !ruby/object:Gem::Requirement
|
178
|
-
none: false
|
179
168
|
requirements:
|
180
169
|
- - ! '>='
|
181
170
|
- !ruby/object:Gem::Version
|
182
171
|
version: '0'
|
183
|
-
segments:
|
184
|
-
- 0
|
185
|
-
hash: 3086093418549266567
|
186
172
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
187
|
-
none: false
|
188
173
|
requirements:
|
189
174
|
- - ! '>='
|
190
175
|
- !ruby/object:Gem::Version
|
191
176
|
version: '0'
|
192
177
|
requirements: []
|
193
178
|
rubyforge_project:
|
194
|
-
rubygems_version: 1.
|
179
|
+
rubygems_version: 2.1.11
|
195
180
|
signing_key:
|
196
|
-
specification_version:
|
181
|
+
specification_version: 4
|
197
182
|
summary: A plugin to Opscode knife for creating instances on the Microsoft Azure platform
|
198
183
|
test_files: []
|