lenovo-rbapi 0.0.1 → 0.0.2

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +84 -76
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3fc4f268227846d053298925f33b12c71f52068f5fdc784aff2ead47d8c60974
4
- data.tar.gz: 6ea37824a3dfe81aa071ea038a2798df130954d60526430fe6000a02c41ee7b4
3
+ metadata.gz: 667259711ddfa036e529c429db4ae5fcf06a4574ffea0398e2d1edf0e9dc619c
4
+ data.tar.gz: 5d11b22f8e97e64612ab04e0df18bbd4e6366e09f986199732c502121aa162cc
5
5
  SHA512:
6
- metadata.gz: ab352ca7fc229add45f71958a3f039ab9c1e3532848a6aa0f8ce30af81f750966fc6402ff079dacf61a08040a714b1d1b1da512a3b852ad1853c8dd5f5f08697
7
- data.tar.gz: a6567500337371878f24d35a33a92677afe831bd244dd12b31e714a465cd457e18c9144a8fbd28d44bf03d3cebad4815a816b079fa3d185cc842d63b800d353d
6
+ metadata.gz: bbfb514565c1d94585d5d333e9f845d24e841774260e33163722d2213d7901ad5114fda216a0cd4e7a23d8d82f35281aa10bdcfd240f083f0dbab7df94dee601
7
+ data.tar.gz: 7c55b018645c51a1a76f944eab648677c8cd4c8a6ca38bac9a4af9543a7853c2673711548987be4af3eb8e2754ad0d966fc5b393af66dffe63f7a107efb32a15
data/README.md CHANGED
@@ -1,76 +1,84 @@
1
- # Lenovo CNOS Ruby API Library
2
-
3
- #### Table of Contents
4
- 1. Overview
5
- 2. Requirements
6
- 3. CNOS Ruby APIs
7
- 3.1 Using Ruby APIs
8
- 4. License
9
-
10
- 1. Overview
11
- The Ruby Client for CNOS API provides a native Ruby implementation for programming
12
- Lenovo CNOS network devices using Ruby. The Ruby client provides the ability to
13
- build native applications in Ruby that can communicate with CNOS remotely over
14
- a HTTP/S transport (off-box).
15
-
16
- The Ruby API implemenation also provides an API layer for building native Ruby
17
- objects that allow for configuration and management of Lenovo CNOS switches.
18
-
19
- The libray is freely provided to the open source community for building applications
20
- using CNOS REST API infrastrcuture. Support is provided as best effort through
21
- Github iusses.
22
-
23
- 2. Requirements
24
- * Lenovo CNOS 10.4 or later
25
- * Ruby 2.2.3 or later
26
-
27
- 3. CNOS Ruby APIs
28
- The CNOS Ruby Client was designed to be easy to use and develop plugins or tools
29
- that interface with the Lenovo CNOS switches.
30
-
31
- 3.1 Using the API
32
-
33
- 3.1.1 Switch Configutation file
34
- This configuration file is used to define the configuration options or model for
35
- switches (switch.yml or any xxx.yml)
36
-
37
- transport : 'http' #transport (HTTP/HTTPs)
38
- port : '8090' #HTTP(s) port number (8090 - HTTP, 443 - HTTPs)
39
- ip : 'switch ip address' #Switch IP address
40
- user : '<username>' #Switch Credentials
41
- password : '<password>'
42
-
43
- 3.1.2 Creating connection and sending configurations
44
- Below demonstrates a basic connection using the API.
45
- For more examples, please see the examples folder.
46
-
47
- #import the libraries
48
- require 'cnos-rbapi/connect'
49
- require 'cnos-rbapi/vlan'
50
-
51
- #create connection to the node using the configuration file
52
- conn = Connect.new(param)
53
-
54
- where param is a dictionary formed either from the config file or hardcoded
55
- with the following key value pairs
56
-
57
- transport => 'http' #transport (HTTP/HTTPs)
58
- port => '8090' #HTTP(s) port number (8090 - HTTP, 443 - HTTPs)
59
- ip => 'switch ip address' #Switch IP address
60
- user => '<username>' #Switch Credentials
61
- password => '<password>'
62
-
63
- #Use VLAN APIs to retrieve VLAN information
64
- Vlan.get_all_vlan(conn)
65
-
66
- #Use VLAN APIs to create/update and delete VLANs
67
- params = {"vlan_name" => "test", "vlan_id" => 10, "admin_state" => "up"}
68
- resp = Vlan.create_vlan(conn, params)
69
-
70
- resp = Vlan.get_vlan_prop(conn, 10)
71
-
72
- params = {"vlan_name" => "test", "admin_state" => "up"}
73
- resp = Vlan.update_vlan(conn, 10, params)
74
-
75
- Vlan.delete_vlan(conn, 10)
76
-
1
+ # Lenovo CNOS Ruby API Library
2
+
3
+ ## Overview
4
+ The Ruby Client for CNOS API provides a native Ruby implementation for programming
5
+ Lenovo CNOS network devices using Ruby. The Ruby client provides the ability to
6
+ build native applications in Ruby that can communicate with CNOS remotely over
7
+ a HTTP/S transport (off-box).
8
+
9
+ The Ruby API implemenation also provides an API layer for building native Ruby
10
+ objects that allow for configuration and management of Lenovo CNOS switches.
11
+
12
+ The library is freely provided to the open source community for building applications
13
+ using CNOS REST API infrastrcuture. Support is provided as best effort through
14
+ Github iusses.
15
+
16
+ ## Requirements
17
+ * Lenovo CNOS 10.4 or later
18
+ * Ruby 2.2.3 or later
19
+
20
+ ## CNOS Ruby APIs
21
+ The CNOS Ruby Client was designed to be easy to use and develop plugins or tools
22
+ that interface with the Lenovo CNOS switches.
23
+
24
+ ### Using the API
25
+ #### Switch Configutation file
26
+ This configuration file is used to define the configuration options or model for switches (switch.yml or any xxx.yml)
27
+
28
+ ##### transport (HTTP/HTTPs)
29
+ transport : 'http'
30
+
31
+ ##### HTTP(s) port number (8090 - HTTP, 443 - HTTPs)
32
+ port : '8090'
33
+
34
+ ##### Switch IP address
35
+ ip : 'switch ip address'
36
+
37
+ ##### Switch Credentials
38
+ user : 'username'
39
+
40
+ password : 'password'
41
+
42
+ #### Creating connection and sending configurations
43
+ Below demonstrates a basic connection using the API. For more examples, please see the examples folder.
44
+
45
+ #import the libraries
46
+
47
+ require 'cnos-rbapi/connect'
48
+
49
+ require 'cnos-rbapi/vlan'
50
+
51
+ ##### create connection to the node using the configuration file
52
+ conn = Connect.new(param)
53
+
54
+ where param is a dictionary formed either from the config file or hardcoded
55
+ with the following key value pairs
56
+
57
+ ##### transport (HTTP/HTTPs)
58
+ transport => 'http'
59
+
60
+ ##### HTTP(s) port number (8090 - HTTP, 443 - HTTPs)
61
+ port => '8090'  
62
+
63
+ ##### Switch IP address
64
+ ip => 'switch ip address'
65
+
66
+ ##### Switch Credentials
67
+ user => 'username'  
68
+ password => 'password'
69
+
70
+ ##### Use VLAN APIs to retrieve VLAN information
71
+ Vlan.get_all_vlan(conn)
72
+
73
+ params = {"vlan_name" => "test", "vlan_id" => 10, "admin_state" => "up"}
74
+
75
+ ##### Use VLAN APIs to create/update and delete VLANs
76
+ resp = Vlan.create_vlan(conn, params)
77
+
78
+ resp = Vlan.get_vlan_prop(conn, 10)
79
+
80
+ params = {"vlan_name" => "test", "admin_state" => "up"}
81
+
82
+ resp = Vlan.update_vlan(conn, 10, params)
83
+
84
+ Vlan.delete_vlan(conn, 10)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lenovo-rbapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Coleen Quadros
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-01-04 00:00:00.000000000 Z
12
+ date: 2018-01-08 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Lib for CNOS REST API's using Ruby
15
15
  email: