ucslib 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +4 -1
- data/lib/ucslib/provision.rb +35 -7
- 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.6 has been released **
|
10
|
+
|
11
|
+
0.1.6:
|
12
|
+
Set syslog server implemented in provisioner
|
10
13
|
|
11
14
|
0.1.5:
|
12
15
|
Moved update boot policy to Update instead of manage
|
data/lib/ucslib/provision.rb
CHANGED
@@ -166,15 +166,15 @@ class UCSProvision
|
|
166
166
|
org = JSON.parse(json)['org']
|
167
167
|
|
168
168
|
xml_builder = Nokogiri::XML::Builder.new do |xml|
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
169
|
+
xml.configConfMos('cookie' => "#{@cookie}", 'inHierarchical' => 'true'){
|
170
|
+
xml.inConfigs{
|
171
|
+
xml.pair('key' => "org-root/org-#{org}/local-disk-config-#{org}-localdisk"){
|
172
|
+
xml.storageLocalDiskConfigPolicy('descr' => '', 'dn' => "org-root/org-#{org}/local-disk-config-#{org}-localdisk",
|
173
|
+
'mode' => "#{local_disk_policy}", 'name' => "#{org}-localdisk", 'protectConfig' => 'yes',
|
174
|
+
'status' => 'created')
|
175
|
+
}
|
175
176
|
}
|
176
177
|
}
|
177
|
-
}
|
178
178
|
end
|
179
179
|
|
180
180
|
#Create xml
|
@@ -189,6 +189,34 @@ class UCSProvision
|
|
189
189
|
|
190
190
|
end
|
191
191
|
|
192
|
+
def set_syslog_server(json)
|
193
|
+
|
194
|
+
syslog_server = JSON.parse(json)['syslog_server']
|
195
|
+
facility = JSON.parse(json)['facility']
|
196
|
+
severity = JSON.parse(json)['severity']
|
197
|
+
|
198
|
+
xml_builder = Nokogiri::XML::Builder.new do |xml|
|
199
|
+
xml.configConfMos('cookie' => "#{@cookie}", 'inHierarchical' => 'false'){
|
200
|
+
xml.inConfigs{
|
201
|
+
xml.pair('key' => "sys/svc-ext/syslog/client-primary"){
|
202
|
+
xml.commSyslogClient('adminState' => 'enabled', 'dn' => 'sys/svc-ext/syslog/client-primary',
|
203
|
+
'forwardingFacility' => "#{facility}", 'hostname' => "#{syslog_server}",
|
204
|
+
'severity' => "#{severity}")
|
205
|
+
}
|
206
|
+
}
|
207
|
+
}
|
208
|
+
end
|
209
|
+
#Create xml
|
210
|
+
set_syslog_server_xml = xml_builder.to_xml.to_s
|
211
|
+
|
212
|
+
#Post
|
213
|
+
begin
|
214
|
+
RestClient.post(@url, set_syslog_server_xml, :content_type => 'text/xml').body
|
215
|
+
rescue Exception => e
|
216
|
+
raise "Error #{e}"
|
217
|
+
end
|
218
|
+
|
219
|
+
end
|
192
220
|
|
193
221
|
def set_server_port(json)
|
194
222
|
|
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.6
|
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-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|