ucslib 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +4 -1
- data/lib/ucslib/provision.rb +17 -14
- data/lib/ucslib/version.rb +1 -1
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -6,7 +6,10 @@ To see an example of how ucslib is being used, checkout the ucs and ucs-solo Che
|
|
6
6
|
|
7
7
|
In addition there is a knife plugin that use ucslib as well - https://github.com/velankanisys/knife-ucs
|
8
8
|
|
9
|
-
** Version 0.1.
|
9
|
+
** Version 0.1.7 has been released **
|
10
|
+
|
11
|
+
0.1.7
|
12
|
+
Multi-chassis server pool creation
|
10
13
|
|
11
14
|
0.1.6:
|
12
15
|
Set syslog server implemented in provisioner
|
data/lib/ucslib/provision.rb
CHANGED
@@ -1080,32 +1080,35 @@ class UCSProvision
|
|
1080
1080
|
end
|
1081
1081
|
|
1082
1082
|
end
|
1083
|
-
|
1083
|
+
|
1084
1084
|
def set_server_pool(json)
|
1085
1085
|
server_pool_name = JSON.parse(json)['server_pool_name'].to_s
|
1086
1086
|
server_pool_description = JSON.parse(json)['server_pool_description']
|
1087
|
-
|
1087
|
+
server_pool_chassis_ids = JSON.parse(json)['server_pool_chassis_ids'].to_s.split(',')
|
1088
1088
|
server_pool_blades = JSON.parse(json)['server_pool_blades'].to_s.split(',')
|
1089
1089
|
org = JSON.parse(json)['org'].to_s
|
1090
|
-
|
1090
|
+
|
1091
1091
|
xml_builder = Nokogiri::XML::Builder.new do |xml|
|
1092
1092
|
xml.configConfMos('cookie' => "#{@ucs_cookie}", 'inHierarchical' => 'true'){
|
1093
1093
|
xml.inConfigs{
|
1094
1094
|
xml.pair('key' => "org-root/org-#{org}/compute-pool-#{server_pool_name}"){
|
1095
1095
|
xml.computePool('descr' => "#{server_pool_description}", 'dn' => "org-root/org-#{org}/compute-pool-#{server_pool_name}",
|
1096
1096
|
'name' => "#{server_pool_name}", 'status' => 'created'){
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1097
|
+
server_pool_chassis_ids.each do |chassis_id|
|
1098
|
+
@current_chassis_id = chassis_id
|
1099
|
+
server_pool_blades.each do |slot_id|
|
1100
|
+
xml.computePooledSlot('chassisId' => "#{@current_chassis_id}",
|
1101
|
+
'rn' => "blade-#{@current_chassis_id}-#{slot_id}", 'slotId' => "#{slot_id}")
|
1102
|
+
end
|
1100
1103
|
end
|
1101
1104
|
}
|
1102
1105
|
}
|
1103
1106
|
}
|
1104
1107
|
}
|
1105
1108
|
end
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
+
|
1110
|
+
|
1111
|
+
|
1109
1112
|
# xml_builder = Nokogiri::XML::Builder.new do |xml|
|
1110
1113
|
# xml.configConfMos('cookie' => "#{@ucs_cookie}", 'inHierarchical' => 'true'){
|
1111
1114
|
# xml.inConfigs{
|
@@ -1122,19 +1125,19 @@ class UCSProvision
|
|
1122
1125
|
# }
|
1123
1126
|
# }
|
1124
1127
|
# end
|
1125
|
-
|
1126
|
-
|
1128
|
+
|
1129
|
+
|
1127
1130
|
#Create XML
|
1128
|
-
|
1131
|
+
|
1129
1132
|
set_server_pool_xml = xml_builder.to_xml.to_s
|
1130
|
-
|
1133
|
+
|
1131
1134
|
#Post
|
1132
1135
|
begin
|
1133
1136
|
RestClient.post(@url, set_server_pool_xml, :content_type => 'text/xml').body
|
1134
1137
|
rescue Exception => e
|
1135
1138
|
raise "Error #{e}"
|
1136
1139
|
end
|
1137
|
-
|
1140
|
+
|
1138
1141
|
end
|
1139
1142
|
|
1140
1143
|
end
|
data/lib/ucslib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ucslib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|