knife-ucs 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -3
- data/configs/hosfw.json +18 -0
- data/knife-ucs.gemspec +5 -4
- data/lib/chef/knife/ucs_base.rb +12 -0
- data/lib/chef/knife/ucs_blades_list.rb +2 -0
- data/lib/chef/knife/ucs_cpus_list.rb +2 -0
- data/lib/chef/knife/ucs_org_create.rb +5 -3
- data/lib/chef/knife/ucs_org_delete.rb +3 -1
- data/lib/chef/knife/ucs_orgs_list.rb +2 -0
- data/lib/chef/knife/ucs_policy_create.rb +108 -0
- data/lib/chef/knife/ucs_policy_delete.rb +57 -0
- data/lib/chef/knife/ucs_policy_update.rb +107 -0
- data/lib/chef/knife/ucs_pool_create.rb +21 -27
- data/lib/chef/knife/ucs_pool_delete.rb +3 -1
- data/lib/chef/knife/ucs_pool_list.rb +189 -0
- data/lib/chef/knife/ucs_runningfirmware_list.rb +2 -0
- data/lib/chef/knife/ucs_serviceprofile_create.rb +3 -0
- data/lib/chef/knife/ucs_serviceprofile_delete.rb +3 -1
- data/lib/chef/knife/ucs_serviceprofiles_list.rb +2 -0
- data/lib/chef/knife/ucs_set.rb +75 -12
- data/lib/chef/knife/ucs_template_create.rb +174 -0
- data/lib/chef/knife/ucs_template_delete.rb +59 -0
- data/lib/chef/knife/ucs_vlan_create.rb +8 -6
- data/lib/chef/knife/ucs_vlan_delete.rb +5 -4
- data/lib/chef/knife/ucs_vlans_list.rb +2 -0
- data/lib/chef/knife/ucs_vsans_list.rb +2 -0
- data/lib/knife-ucs/version.rb +1 -1
- metadata +51 -11
@@ -0,0 +1,59 @@
|
|
1
|
+
# Author:: Murali Raju (<murali.raju@appliv.com>)
|
2
|
+
# Author:: Velankani Engineering <eng@velankani.net>
|
3
|
+
# Copyright:: Copyright (c) 2012 Murali Raju.
|
4
|
+
# Copyright:: Copyright (c) 2012 Velankani Information Systems, Inc
|
5
|
+
# License:: Apache License, Version 2.0
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
require 'chef/knife/ucs_base'
|
21
|
+
|
22
|
+
class Chef
|
23
|
+
class Knife
|
24
|
+
class UcsTemplateDelete < Knife
|
25
|
+
|
26
|
+
include Knife::UCSBase
|
27
|
+
|
28
|
+
deps do
|
29
|
+
require 'readline'
|
30
|
+
require 'chef/json_compat'
|
31
|
+
require 'chef/knife/bootstrap'
|
32
|
+
Chef::Knife::Bootstrap.load_deps
|
33
|
+
end
|
34
|
+
|
35
|
+
banner "knife ucs template delete (options)"
|
36
|
+
|
37
|
+
attr_accessor :initial_sleep_delay
|
38
|
+
|
39
|
+
option :template,
|
40
|
+
:long => "--template-type TEMPLATE",
|
41
|
+
:description => "The template type <vnic,vhba,serviceprofile>",
|
42
|
+
:proc => Proc.new { |f| Chef::Config[:knife][:template] = f }
|
43
|
+
|
44
|
+
option :name,
|
45
|
+
:long => "--template-name TEMPLATENAME",
|
46
|
+
:description => "The template name",
|
47
|
+
:proc => Proc.new { |f| Chef::Config[:knife][:name] = f }
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
def run
|
52
|
+
$stdout.sync = true
|
53
|
+
|
54
|
+
#complete ucslib methods first
|
55
|
+
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# Author:: Murali Raju (<murali.raju@appliv.com>)
|
2
|
+
# Author:: Velankani Engineering <eng@velankani.net>
|
2
3
|
# Copyright:: Copyright (c) 2012 Murali Raju.
|
4
|
+
# Copyright:: Copyright (c) 2012 Velankani Information Systems, Inc
|
3
5
|
# License:: Apache License, Version 2.0
|
4
6
|
#
|
5
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -35,12 +37,12 @@ class Chef
|
|
35
37
|
attr_accessor :initial_sleep_delay
|
36
38
|
|
37
39
|
option :vlanid,
|
38
|
-
:long => "--
|
40
|
+
:long => "--vlan-id VLANID",
|
39
41
|
:description => "The VLAN ID",
|
40
42
|
:proc => Proc.new { |f| Chef::Config[:knife][:vlanid] = f }
|
41
43
|
|
42
44
|
option :vlanname,
|
43
|
-
:long => "--
|
45
|
+
:long => "--vlan-name VLANNAME",
|
44
46
|
:description => "The VLAN NAME",
|
45
47
|
:proc => Proc.new { |f| Chef::Config[:knife][:vlanname] = f }
|
46
48
|
|
@@ -49,15 +51,15 @@ class Chef
|
|
49
51
|
|
50
52
|
json = {:vlan_id => Chef::Config[:knife][:vlanid], :vlan_name => Chef::Config[:knife][:vlanname] }.to_json
|
51
53
|
|
52
|
-
xml_response = provisioner.
|
54
|
+
xml_response = provisioner.set_vlan(json)
|
53
55
|
xml_doc = Nokogiri::XML(xml_response)
|
56
|
+
|
54
57
|
xml_doc.xpath("configConfMos/outConfigs/pair/fabricVlan").each do |org|
|
55
58
|
puts ''
|
56
|
-
puts "VLAN ID: #{ui.color("#{org.attributes['id']}", :
|
57
|
-
" status: #{ui.color("#{org.attributes['status']}", :
|
59
|
+
puts "VLAN ID: #{ui.color("#{org.attributes['id']}", :blue)} NAME: #{ui.color("#{org.attributes['name']}", :blue)}" +
|
60
|
+
" status: #{ui.color("#{org.attributes['status']}", :red)}"
|
58
61
|
end
|
59
62
|
|
60
|
-
#Ugly...refactor later to parse error with better exception handling. Nokogiri xpath search for elements might be an option
|
61
63
|
xml_doc.xpath("configConfMos").each do |org|
|
62
64
|
puts "#{org.attributes['errorCode']} #{ui.color("#{org.attributes['errorDescr']}", :red)}"
|
63
65
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# Author:: Murali Raju (<murali.raju@appliv.com>)
|
2
|
+
# Author:: Velankani Engineering <eng@velankani.net>
|
2
3
|
# Copyright:: Copyright (c) 2012 Murali Raju.
|
4
|
+
# Copyright:: Copyright (c) 2012 Velankani Information Systems, Inc
|
3
5
|
# License:: Apache License, Version 2.0
|
4
6
|
#
|
5
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -35,12 +37,12 @@ class Chef
|
|
35
37
|
attr_accessor :initial_sleep_delay
|
36
38
|
|
37
39
|
option :vlanid,
|
38
|
-
:long => "--
|
40
|
+
:long => "--vlan-id VLANID",
|
39
41
|
:description => "The VLAN ID",
|
40
42
|
:proc => Proc.new { |f| Chef::Config[:knife][:vlanid] = f }
|
41
43
|
|
42
44
|
option :vlanname,
|
43
|
-
:long => "--
|
45
|
+
:long => "--vlan-name VLANNAME",
|
44
46
|
:description => "The VLAN NAME",
|
45
47
|
:proc => Proc.new { |f| Chef::Config[:knife][:vlanname] = f }
|
46
48
|
|
@@ -54,11 +56,10 @@ class Chef
|
|
54
56
|
|
55
57
|
xml_doc.xpath("configConfMos/outConfigs/pair/fabricVlan").each do |org|
|
56
58
|
puts ''
|
57
|
-
puts "VLAN ID: #{ui.color("#{org.attributes['id']}", :
|
59
|
+
puts "VLAN ID: #{ui.color("#{org.attributes['id']}", :blue)} NAME: #{ui.color("#{org.attributes['name']}", :blue)}" +
|
58
60
|
" status: #{ui.color("#{org.attributes['status']}", :red)}"
|
59
61
|
end
|
60
62
|
|
61
|
-
#Ugly...refactor later to parse error with better exception handling. Nokogiri xpath search for elements might be an option
|
62
63
|
xml_doc.xpath("configConfMos").each do |org|
|
63
64
|
puts "#{org.attributes['errorCode']} #{ui.color("#{org.attributes['errorDescr']}", :red)}"
|
64
65
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# Author:: Murali Raju (<murali.raju@appliv.com>)
|
2
|
+
# Author:: Velankani Engineering <eng@velankani.net>
|
2
3
|
# Copyright:: Copyright (c) 2012 Murali Raju.
|
4
|
+
# Copyright:: Copyright (c) 2012 Velankani Information Systems, Inc
|
3
5
|
# License:: Apache License, Version 2.0
|
4
6
|
#
|
5
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# Author:: Murali Raju (<murali.raju@appliv.com>)
|
2
|
+
# Author:: Velankani Engineering <eng@velankani.net>
|
2
3
|
# Copyright:: Copyright (c) 2012 Murali Raju.
|
4
|
+
# Copyright:: Copyright (c) 2012 Velankani Information Systems, Inc
|
3
5
|
# License:: Apache License, Version 2.0
|
4
6
|
#
|
5
7
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
data/lib/knife-ucs/version.rb
CHANGED
metadata
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-ucs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Murali Raju
|
9
|
+
- Velankani Engineering
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date: 2012-
|
13
|
+
date: 2012-12-13 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: nokogiri
|
16
|
-
requirement:
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
17
18
|
none: false
|
18
19
|
requirements:
|
19
20
|
- - ~>
|
@@ -21,10 +22,15 @@ dependencies:
|
|
21
22
|
version: 1.5.2
|
22
23
|
type: :runtime
|
23
24
|
prerelease: false
|
24
|
-
version_requirements:
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 1.5.2
|
25
31
|
- !ruby/object:Gem::Dependency
|
26
32
|
name: rest-client
|
27
|
-
requirement:
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
28
34
|
none: false
|
29
35
|
requirements:
|
30
36
|
- - ~>
|
@@ -32,21 +38,48 @@ dependencies:
|
|
32
38
|
version: 1.6.7
|
33
39
|
type: :runtime
|
34
40
|
prerelease: false
|
35
|
-
version_requirements:
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ~>
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 1.6.7
|
36
47
|
- !ruby/object:Gem::Dependency
|
37
48
|
name: ucslib
|
38
|
-
requirement:
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
39
50
|
none: false
|
40
51
|
requirements:
|
41
52
|
- - ~>
|
42
53
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.
|
54
|
+
version: 0.1.6
|
44
55
|
type: :runtime
|
45
56
|
prerelease: false
|
46
|
-
version_requirements:
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 0.1.6
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: chef
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ~>
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 10.16.2
|
71
|
+
type: :runtime
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ~>
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 10.16.2
|
47
79
|
description: Cisco UCS Support for Chef's Knife Command
|
48
80
|
email:
|
49
81
|
- murraju@appliv.com
|
82
|
+
- eng@velankani.net
|
50
83
|
executables: []
|
51
84
|
extensions: []
|
52
85
|
extra_rdoc_files:
|
@@ -58,6 +91,7 @@ files:
|
|
58
91
|
- LICENSE
|
59
92
|
- README.md
|
60
93
|
- Rakefile
|
94
|
+
- configs/hosfw.json
|
61
95
|
- knife-ucs.gemspec
|
62
96
|
- lib/chef/knife/ucs_base.rb
|
63
97
|
- lib/chef/knife/ucs_blades_list.rb
|
@@ -65,19 +99,25 @@ files:
|
|
65
99
|
- lib/chef/knife/ucs_org_create.rb
|
66
100
|
- lib/chef/knife/ucs_org_delete.rb
|
67
101
|
- lib/chef/knife/ucs_orgs_list.rb
|
102
|
+
- lib/chef/knife/ucs_policy_create.rb
|
103
|
+
- lib/chef/knife/ucs_policy_delete.rb
|
104
|
+
- lib/chef/knife/ucs_policy_update.rb
|
68
105
|
- lib/chef/knife/ucs_pool_create.rb
|
69
106
|
- lib/chef/knife/ucs_pool_delete.rb
|
107
|
+
- lib/chef/knife/ucs_pool_list.rb
|
70
108
|
- lib/chef/knife/ucs_runningfirmware_list.rb
|
71
109
|
- lib/chef/knife/ucs_serviceprofile_create.rb
|
72
110
|
- lib/chef/knife/ucs_serviceprofile_delete.rb
|
73
111
|
- lib/chef/knife/ucs_serviceprofiles_list.rb
|
74
112
|
- lib/chef/knife/ucs_set.rb
|
113
|
+
- lib/chef/knife/ucs_template_create.rb
|
114
|
+
- lib/chef/knife/ucs_template_delete.rb
|
75
115
|
- lib/chef/knife/ucs_vlan_create.rb
|
76
116
|
- lib/chef/knife/ucs_vlan_delete.rb
|
77
117
|
- lib/chef/knife/ucs_vlans_list.rb
|
78
118
|
- lib/chef/knife/ucs_vsans_list.rb
|
79
119
|
- lib/knife-ucs/version.rb
|
80
|
-
homepage: https://github.com/
|
120
|
+
homepage: https://github.com/velankanisys/knife-ucs
|
81
121
|
licenses: []
|
82
122
|
post_install_message:
|
83
123
|
rdoc_options: []
|
@@ -97,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
137
|
version: '0'
|
98
138
|
requirements: []
|
99
139
|
rubyforge_project:
|
100
|
-
rubygems_version: 1.8.
|
140
|
+
rubygems_version: 1.8.24
|
101
141
|
signing_key:
|
102
142
|
specification_version: 3
|
103
143
|
summary: Cisco UCS Support for Chef's Knife Command
|