lenovo-rbapi 0.0.2 → 0.0.3
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.
- checksums.yaml +5 -5
- data/README.md +84 -84
- data/lib/cnos-rbapi.rb +19 -11
- data/lib/cnos-rbapi/arp.rb +16 -17
- data/lib/cnos-rbapi/connect.rb +12 -12
- data/lib/cnos-rbapi/igmp.rb +15 -16
- data/lib/cnos-rbapi/ip_intf.rb +14 -15
- data/lib/cnos-rbapi/lacp.rb +13 -14
- data/lib/cnos-rbapi/lag.rb +18 -19
- data/lib/cnos-rbapi/lldp.rb +19 -20
- data/lib/cnos-rbapi/mstp.rb +20 -21
- data/lib/cnos-rbapi/rest_utils.rb +10 -11
- data/lib/cnos-rbapi/stp.rb +14 -15
- data/lib/cnos-rbapi/system.rb +32 -33
- data/lib/cnos-rbapi/telemetry.rb +23 -24
- data/lib/cnos-rbapi/vlag.rb +24 -25
- data/lib/cnos-rbapi/vlan.rb +16 -17
- data/lib/cnos-rbapi/vlan_intf.rb +14 -15
- data/lib/cnos-rbapi/vrrp.rb +17 -18
- data/test/jupiter.yml +6 -0
- data/test/mars.yml +6 -0
- data/test/mytest.rb +3 -0
- data/test/neptune.yml +6 -0
- data/test/voyager.yml +6 -0
- metadata +14 -7
- data/lib/cnos-rbapi/valn_intf.rb +0 -0
data/lib/cnos-rbapi/vlan.rb
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
##
|
2
|
-
## Copyright (
|
2
|
+
## Copyright (C) 2017 Lenovo, Inc.
|
3
|
+
## Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
## you may not use this file except in compliance with the License.
|
5
|
+
## You may obtain a copy of the License at
|
6
|
+
## http://www.apache.org/licenses/LICENSE-2.0
|
3
7
|
##
|
4
|
-
##
|
5
|
-
## under the
|
6
|
-
##
|
7
|
-
##
|
8
|
-
##
|
9
|
-
##
|
10
|
-
## https://opensource.org/licenses/BSD-3-Clause
|
11
|
-
##
|
12
|
-
## THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
13
|
-
## WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
8
|
+
## Unless required by applicable law or agreed to in writing, software
|
9
|
+
## distributed under the License is distributed on an "AS IS" BASIS,
|
10
|
+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
11
|
+
## See the License for the specific language governing permissions and
|
12
|
+
## limitations under the License.
|
14
13
|
##
|
15
14
|
require 'rest-client'
|
16
15
|
require 'json'
|
@@ -26,7 +25,7 @@ require_relative 'rest_utils'
|
|
26
25
|
#
|
27
26
|
|
28
27
|
class Vlan
|
29
|
-
|
28
|
+
@@cfg = '/nos/api/cfg/vlan'
|
30
29
|
|
31
30
|
# This API gets properties of all VLANS.
|
32
31
|
#
|
@@ -36,7 +35,7 @@ class Vlan
|
|
36
35
|
#
|
37
36
|
# return: JSON response
|
38
37
|
def self.get_all_vlan(conn)
|
39
|
-
url = form_url(conn,
|
38
|
+
url = form_url(conn, @@cfg)
|
40
39
|
hdr = form_hdr(conn)
|
41
40
|
Rest.get(conn, url, hdr)
|
42
41
|
end
|
@@ -60,7 +59,7 @@ class Vlan
|
|
60
59
|
#
|
61
60
|
# return: JSON response
|
62
61
|
def self.create_vlan(conn, params)
|
63
|
-
url = form_url(conn,
|
62
|
+
url = form_url(conn, @@cfg)
|
64
63
|
hdr = form_hdr(conn)
|
65
64
|
params = params.to_json
|
66
65
|
Rest.post(conn, url, hdr, params)
|
@@ -76,7 +75,7 @@ class Vlan
|
|
76
75
|
#
|
77
76
|
# return: JSON response
|
78
77
|
def self.get_vlan_prop(conn, vlan_id)
|
79
|
-
url = form_url(conn,
|
78
|
+
url = form_url(conn, @@cfg + '/' + vlan_id.to_s)
|
80
79
|
hdr = form_hdr(conn)
|
81
80
|
Rest.get(conn, url, hdr)
|
82
81
|
end
|
@@ -99,7 +98,7 @@ class Vlan
|
|
99
98
|
#
|
100
99
|
# return: JSON response
|
101
100
|
def self.update_vlan(conn, vlan_id, params)
|
102
|
-
url = form_url(conn,
|
101
|
+
url = form_url(conn, @@cfg + '/' + vlan_id.to_s)
|
103
102
|
hdr = form_hdr(conn)
|
104
103
|
params = params.to_json
|
105
104
|
Rest.put(conn, url, hdr, params)
|
@@ -116,7 +115,7 @@ class Vlan
|
|
116
115
|
#
|
117
116
|
# return:
|
118
117
|
def self.delete_vlan(conn, vlan_id)
|
119
|
-
url = form_url(conn,
|
118
|
+
url = form_url(conn, @@cfg + '/' + vlan_id.to_s)
|
120
119
|
hdr = form_hdr(conn)
|
121
120
|
Rest.delete(conn, url, hdr)
|
122
121
|
end
|
data/lib/cnos-rbapi/vlan_intf.rb
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
##
|
2
|
-
## Copyright (
|
2
|
+
## Copyright (C) 2017 Lenovo, Inc.
|
3
|
+
## Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
## you may not use this file except in compliance with the License.
|
5
|
+
## You may obtain a copy of the License at
|
6
|
+
## http://www.apache.org/licenses/LICENSE-2.0
|
3
7
|
##
|
4
|
-
##
|
5
|
-
## under the
|
6
|
-
##
|
7
|
-
##
|
8
|
-
##
|
9
|
-
##
|
10
|
-
## https://opensource.org/licenses/BSD-3-Clause
|
11
|
-
##
|
12
|
-
## THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
13
|
-
## WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
8
|
+
## Unless required by applicable law or agreed to in writing, software
|
9
|
+
## distributed under the License is distributed on an "AS IS" BASIS,
|
10
|
+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
11
|
+
## See the License for the specific language governing permissions and
|
12
|
+
## limitations under the License.
|
14
13
|
##
|
15
14
|
require 'rest-client'
|
16
15
|
require 'json'
|
@@ -24,7 +23,7 @@ require_relative 'rest_utils'
|
|
24
23
|
|
25
24
|
|
26
25
|
class VlanIntf
|
27
|
-
|
26
|
+
@@cfg = '/nos/api/cfg/vlan_interface'
|
28
27
|
# This API gets VLAN properties of all Ethernet interfaces.
|
29
28
|
#
|
30
29
|
#
|
@@ -33,7 +32,7 @@ class VlanIntf
|
|
33
32
|
#
|
34
33
|
# return: JSON response
|
35
34
|
def self.get_all_vlan_intf(conn)
|
36
|
-
url = form_url(conn,
|
35
|
+
url = form_url(conn, @@cfg)
|
37
36
|
hdr = form_hdr(conn)
|
38
37
|
Rest.get(conn, url, hdr)
|
39
38
|
end
|
@@ -49,7 +48,7 @@ class VlanIntf
|
|
49
48
|
def self.get_vlan_prop_intf(conn, vlan_intf)
|
50
49
|
temp = vlan_intf.dup
|
51
50
|
temp.sub! '/', '%2F'
|
52
|
-
url = form_url(conn,
|
51
|
+
url = form_url(conn, @@cfg + '/' + temp)
|
53
52
|
hdr = form_hdr(conn)
|
54
53
|
Rest.get(conn, url, hdr)
|
55
54
|
end
|
@@ -80,7 +79,7 @@ class VlanIntf
|
|
80
79
|
def self.update_vlan_intf(conn, vlan_intf, params)
|
81
80
|
temp = vlan_intf.dup
|
82
81
|
temp.sub! '/', '%2F'
|
83
|
-
url = form_url(conn,
|
82
|
+
url = form_url(conn, @@cfg + '/' + temp)
|
84
83
|
hdr = form_hdr(conn)
|
85
84
|
params = params.to_json
|
86
85
|
Rest.put(conn, url, hdr, params)
|
data/lib/cnos-rbapi/vrrp.rb
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
##
|
2
|
-
## Copyright (
|
2
|
+
## Copyright (C) 2017 Lenovo, Inc.
|
3
|
+
## Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
## you may not use this file except in compliance with the License.
|
5
|
+
## You may obtain a copy of the License at
|
6
|
+
## http://www.apache.org/licenses/LICENSE-2.0
|
3
7
|
##
|
4
|
-
##
|
5
|
-
## under the
|
6
|
-
##
|
7
|
-
##
|
8
|
-
##
|
9
|
-
##
|
10
|
-
## https://opensource.org/licenses/BSD-3-Clause
|
11
|
-
##
|
12
|
-
## THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
13
|
-
## WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
8
|
+
## Unless required by applicable law or agreed to in writing, software
|
9
|
+
## distributed under the License is distributed on an "AS IS" BASIS,
|
10
|
+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
11
|
+
## See the License for the specific language governing permissions and
|
12
|
+
## limitations under the License.
|
14
13
|
##
|
15
14
|
require 'rest-client'
|
16
15
|
require 'json'
|
@@ -24,7 +23,7 @@ require_relative 'rest_utils'
|
|
24
23
|
##
|
25
24
|
|
26
25
|
class Vrrp
|
27
|
-
|
26
|
+
@@cfg = '/nos/api/cfg/vrrp'
|
28
27
|
# This API gets properties of all VRRP VRs of all interfaces.
|
29
28
|
#
|
30
29
|
#
|
@@ -33,7 +32,7 @@ class Vrrp
|
|
33
32
|
#
|
34
33
|
# return: JSON response
|
35
34
|
def self.get_vrrp_prop_all(conn)
|
36
|
-
url = form_url(conn,
|
35
|
+
url = form_url(conn, @@cfg)
|
37
36
|
hdr = form_hdr(conn)
|
38
37
|
Rest.get(conn, url, hdr)
|
39
38
|
end
|
@@ -49,7 +48,7 @@ class Vrrp
|
|
49
48
|
def self.get_vrrp_intf(conn, intf)
|
50
49
|
temp = intf.dup
|
51
50
|
temp.sub! '/', '%2F'
|
52
|
-
url = form_url(conn,
|
51
|
+
url = form_url(conn, @@cfg + '/' + temp)
|
53
52
|
hdr = form_hdr(conn)
|
54
53
|
Rest.get(conn, url, hdr)
|
55
54
|
end
|
@@ -100,7 +99,7 @@ class Vrrp
|
|
100
99
|
def self.create_vrrp_intf(conn, intf, params)
|
101
100
|
temp = intf.dup
|
102
101
|
temp.sub! '/', '%2F'
|
103
|
-
url = form_url(conn,
|
102
|
+
url = form_url(conn, @@cfg + '/' + temp)
|
104
103
|
hdr = form_hdr(conn)
|
105
104
|
params = params.to_json
|
106
105
|
Rest.post(conn, url, hdr, params)
|
@@ -118,7 +117,7 @@ class Vrrp
|
|
118
117
|
def self.get_vrrp_intf_vrid(conn, intf, vrid)
|
119
118
|
temp = intf.dup
|
120
119
|
temp.sub! '/', '%2F'
|
121
|
-
url = form_url(conn,
|
120
|
+
url = form_url(conn, @@cfg + '/' + temp + '/' + vrid.to_s)
|
122
121
|
hdr = form_hdr(conn)
|
123
122
|
Rest.get(conn, url, hdr)
|
124
123
|
end
|
@@ -172,7 +171,7 @@ class Vrrp
|
|
172
171
|
def self.update_vrrp_intf_vrid(conn, intf, vrid, params)
|
173
172
|
temp = intf.dup
|
174
173
|
temp.sub! '/', '%2F'
|
175
|
-
url = form_url(conn,
|
174
|
+
url = form_url(conn, @@cfg + '/' + temp + '/' + vrid.to_s)
|
176
175
|
hdr = form_hdr(conn)
|
177
176
|
params = params.to_json
|
178
177
|
Rest.put(conn, url, hdr, params)
|
@@ -190,7 +189,7 @@ class Vrrp
|
|
190
189
|
def self.del_vrrp_intf_vrid(conn, intf, vrid)
|
191
190
|
temp = intf.dup
|
192
191
|
temp.sub! '/', '%2F'
|
193
|
-
url = form_url(conn,
|
192
|
+
url = form_url(conn, @@cfg + '/' + temp + '/' + vrid.to_s)
|
194
193
|
hdr = form_hdr(conn)
|
195
194
|
Rest.delete(conn, url, hdr)
|
196
195
|
end
|
data/test/jupiter.yml
ADDED
data/test/mars.yml
ADDED
data/test/mytest.rb
ADDED
data/test/neptune.yml
ADDED
data/test/voyager.yml
ADDED
metadata
CHANGED
@@ -1,20 +1,22 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lenovo-rbapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Coleen Quadros
|
8
8
|
- Arun Lankalapalli
|
9
|
+
- Anil Kumar M
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date: 2018-01-
|
13
|
+
date: 2018-01-23 00:00:00.000000000 Z
|
13
14
|
dependencies: []
|
14
|
-
description: Lib for
|
15
|
+
description: Lib for REST API's using Ruby
|
15
16
|
email:
|
16
17
|
- cquadros@lenovo.com
|
17
18
|
- alankalapall@lenovo.com
|
19
|
+
- amuraleedhar@lenovo.com
|
18
20
|
executables: []
|
19
21
|
extensions: []
|
20
22
|
extra_rdoc_files:
|
@@ -36,13 +38,17 @@ files:
|
|
36
38
|
- lib/cnos-rbapi/stp.rb
|
37
39
|
- lib/cnos-rbapi/system.rb
|
38
40
|
- lib/cnos-rbapi/telemetry.rb
|
39
|
-
- lib/cnos-rbapi/valn_intf.rb
|
40
41
|
- lib/cnos-rbapi/vlag.rb
|
41
42
|
- lib/cnos-rbapi/vlan.rb
|
42
43
|
- lib/cnos-rbapi/vlan_intf.rb
|
43
44
|
- lib/cnos-rbapi/vrrp.rb
|
45
|
+
- test/jupiter.yml
|
46
|
+
- test/mars.yml
|
47
|
+
- test/mytest.rb
|
48
|
+
- test/neptune.yml
|
44
49
|
- test/rbapi_test.rb
|
45
|
-
|
50
|
+
- test/voyager.yml
|
51
|
+
homepage: http://rubygems.org/gems/lenovo-cnos-rbapi
|
46
52
|
licenses:
|
47
53
|
- BSD-3-Clause
|
48
54
|
metadata: {}
|
@@ -50,6 +56,7 @@ post_install_message:
|
|
50
56
|
rdoc_options: []
|
51
57
|
require_paths:
|
52
58
|
- lib
|
59
|
+
- lib/cnos-rbapi
|
53
60
|
required_ruby_version: !ruby/object:Gem::Requirement
|
54
61
|
requirements:
|
55
62
|
- - ">="
|
@@ -62,8 +69,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
69
|
version: '0'
|
63
70
|
requirements: []
|
64
71
|
rubyforge_project:
|
65
|
-
rubygems_version: 2.
|
72
|
+
rubygems_version: 2.6.12
|
66
73
|
signing_key:
|
67
74
|
specification_version: 4
|
68
|
-
summary: Library Implementation for
|
75
|
+
summary: Library Implementation for REST APIs
|
69
76
|
test_files: []
|
data/lib/cnos-rbapi/valn_intf.rb
DELETED
File without changes
|