junoser 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -10835,7 +10835,20 @@ rule(:configuration) do
10835
10835
  "interval" arg /* Interval at which data should be recorded */,
10836
10836
  "duration" arg /* Duration to continue recording of data */
10837
10837
  )
10838
- )
10838
+ ),
10839
+ "af-mode" /* Enable 802.3af */,
10840
+ "high-power" /* Enable fourpair high power interface upto 60W */,
10841
+ "ultrahigh-power" /* Enable fourpair ultra high power interface upto 95W */
10842
+ )
10843
+ ),
10844
+ "fpc" enum(("all" | "fpc-slot-number")) ( /* FPC slot number */
10845
+ c(
10846
+ "management" ( /* PoE management mode */
10847
+ ("static" | "class")
10848
+ ),
10849
+ "guard-band" arg /* Guard band for PoE */,
10850
+ "maximum-power" arg /* Maximum FPC power limit */,
10851
+ "lldp-priority" /* PoE controller LLDP priority */
10839
10852
  )
10840
10853
  )
10841
10854
  )
@@ -6729,10 +6729,10 @@ module Junoser
6729
6729
  str("auto-negotiate-10-100")
6730
6730
  )
6731
6731
  ).as(:oneline),
6732
- str("ethernet-10m"),
6733
- str("ethernet-100m"),
6734
- str("ethernet-1g"),
6735
- str("ethernet-10g")
6732
+ str("10m"),
6733
+ str("100m"),
6734
+ str("1g"),
6735
+ str("10g")
6736
6736
  )
6737
6737
  )
6738
6738
  ),
@@ -10905,7 +10905,7 @@ module Junoser
10905
10905
  str("fast-poe"),
10906
10906
  str("perpetual-poe"),
10907
10907
  a(str("interface"), str("all") | str("all-extended") | arg,
10908
- c(
10908
+ sc(
10909
10909
  str("disable"),
10910
10910
  b(str("priority"),
10911
10911
  (str("low") | str("high"))
@@ -10917,9 +10917,22 @@ module Junoser
10917
10917
  a(str("interval"), arg),
10918
10918
  a(str("duration"), arg)
10919
10919
  )
10920
- )
10920
+ ),
10921
+ str("af-mode"),
10922
+ str("high-power"),
10923
+ str("ultrahigh-power")
10921
10924
  )
10922
- )
10925
+ ).as(:oneline),
10926
+ a(str("fpc"), enum(str("all") | str("fpc-slot-number")),
10927
+ sc(
10928
+ b(str("management"),
10929
+ (str("static") | str("class"))
10930
+ ),
10931
+ a(str("guard-band"), arg),
10932
+ a(str("maximum-power"), arg),
10933
+ str("lldp-priority")
10934
+ )
10935
+ ).as(:oneline)
10923
10936
  )
10924
10937
  ),
10925
10938
  b(str("dynamic-profiles"),
@@ -32128,10 +32141,10 @@ module Junoser
32128
32141
  str("auto-negotiate-10-100")
32129
32142
  )
32130
32143
  ).as(:oneline),
32131
- str("ethernet-10m"),
32132
- str("ethernet-100m"),
32133
- str("ethernet-1g"),
32134
- str("ethernet-10g")
32144
+ str("10m"),
32145
+ str("100m"),
32146
+ str("1g"),
32147
+ str("10g")
32135
32148
  )
32136
32149
  )
32137
32150
  ),
@@ -47896,10 +47909,10 @@ module Junoser
47896
47909
  str("auto-negotiate-10-100")
47897
47910
  )
47898
47911
  ).as(:oneline),
47899
- str("ethernet-10m"),
47900
- str("ethernet-100m"),
47901
- str("ethernet-1g"),
47902
- str("ethernet-10g")
47912
+ str("10m"),
47913
+ str("100m"),
47914
+ str("1g"),
47915
+ str("10g")
47903
47916
  )
47904
47917
  )
47905
47918
  ),
@@ -51526,10 +51539,10 @@ module Junoser
51526
51539
  str("auto-negotiate-10-100")
51527
51540
  )
51528
51541
  ).as(:oneline),
51529
- str("ethernet-10m"),
51530
- str("ethernet-100m"),
51531
- str("ethernet-1g"),
51532
- str("ethernet-10g")
51542
+ str("10m"),
51543
+ str("100m"),
51544
+ str("1g"),
51545
+ str("10g")
51533
51546
  )
51534
51547
  )
51535
51548
  ),
@@ -110790,7 +110803,8 @@ module Junoser
110790
110803
  c(
110791
110804
  a(str("threshold"), arg)
110792
110805
  )
110793
- )
110806
+ ),
110807
+ str("single-hop")
110794
110808
  )
110795
110809
  ),
110796
110810
  a(str("authentication-key"), arg)
data/lib/junoser/ruler.rb CHANGED
@@ -138,7 +138,7 @@ module Junoser
138
138
  str.gsub!(/"snmp"(.*\s*.*)"snmptrap"/) { %["snmptrap"#{$1}"snmp"] }
139
139
  str.gsub!(/"ospf"(.*\s*.*)"ospf3"/) { %["ospf3"#{$1}"ospf"] }
140
140
  str.gsub! '"tls1" | "tls11" | "tls12"', '"tls11" | "tls12" | "tls1"'
141
- str.gsub!(/("group1" \| "group2" \| "group5") \| ([^)]+)/) { "#{$2} | #{$1}"}
141
+ str.gsub!(/("group1" \| "group2" \| "group5") \| ([^)]+)/) { "#{$2} | #{$1}" }
142
142
 
143
143
  %w[ccc ethernet-over-atm tcc vpls bridge].each do |encap|
144
144
  str.gsub!(/"ethernet"(.*)"ethernet-#{encap}"/) { %["ethernet-#{encap}"#{$1}"ethernet"] }
@@ -226,7 +226,7 @@ module Junoser
226
226
  str.gsub! '"system-name" arg', '"name" (quote | arg)'
227
227
 
228
228
  # Fix .xsd: argument of "system license keys key" can be quoted
229
- str.gsub!(/^(rule\(:license_object\) do.*?"key") arg/m) { "#{$1} (quote | arg)"}
229
+ str.gsub!(/^(rule\(:license_object\) do.*?"key") arg/m) { "#{$1} (quote | arg)" }
230
230
 
231
231
  # Fix .xsd: "prefix-limit teardown"
232
232
  str.gsub!(/^(\s*)"teardown" (\(.*?as\(:oneline\)\s*\)\s*\))/m) do
@@ -237,6 +237,20 @@ module Junoser
237
237
  str.gsub! '"400g" | "oc', '"400g" | "800g" | "oc'
238
238
  str.gsub! '"400G"', '"400G" | "800G"'
239
239
 
240
+ # Fix .xsd: "poe"
241
+ str.gsub!(/^(\s*"interface" \("all" \| "all-extended" \| arg\) \(\s*)c\(/) { "#{$1}sc(" }
242
+ str.gsub!(/^(\s*)\)(,\s*"fpc" enum\(\("all" \| "fpc-slot-number"\)\) \(\s*)c\((.*"lldp-priority"\s*\)\s*\))/m) do
243
+ "#{$1}).as(:oneline)#{$2}sc(#{$3}.as(:oneline)"
244
+ end
245
+
246
+ # Fix .xsd: support "set protocols iccp peer xxx liveness-detection single-hop"
247
+ str.gsub!(/(^rule\(:peer_group\) do.*?\n(\s*)"detection-time" \(\s*c\(\s*"threshold" arg\s*\)\s*\))/m) do
248
+ "#{$1},\n#{format('"single-hop"', $2)}"
249
+ end
250
+
251
+ # Fix .xsd: support "set interfaces xxx ether-options speed"
252
+ str.gsub! '"ethernet-1', '"1'
253
+
240
254
  str
241
255
  end
242
256
 
@@ -1,3 +1,3 @@
1
1
  module Junoser
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: junoser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shintaro Kojima
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-01 00:00:00.000000000 Z
11
+ date: 2022-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parslet
@@ -101,6 +101,7 @@ files:
101
101
  - bin/console
102
102
  - bin/setup
103
103
  - commitlint.config.js
104
+ - example/ex-18.1R3-S6.1.xsd
104
105
  - example/get-schema.xml
105
106
  - example/junos-18.1R3-S9.rb
106
107
  - example/mx-19.3R3-S1.3.rb