brocade_api_client 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rubocop.yml +13 -0
- data/.travis.yml +9 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +82 -0
- data/LICENSE +234 -0
- data/README.md +248 -0
- data/Rakefile +38 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/brocade_api_client.gemspec +45 -0
- data/lib/BrocadeAPIClient/apiversion.rb +47 -0
- data/lib/BrocadeAPIClient/client.rb +533 -0
- data/lib/BrocadeAPIClient/events.rb +35 -0
- data/lib/BrocadeAPIClient/exceptions.rb +79 -0
- data/lib/BrocadeAPIClient/fabrics.rb +28 -0
- data/lib/BrocadeAPIClient/httpclient.rb +149 -0
- data/lib/BrocadeAPIClient/ports.rb +52 -0
- data/lib/BrocadeAPIClient/static.rb +16 -0
- data/lib/BrocadeAPIClient/switches.rb +29 -0
- data/lib/BrocadeAPIClient/version.rb +13 -0
- data/lib/BrocadeAPIClient/zones.rb +183 -0
- data/lib/brocade_api_client.rb +19 -0
- metadata +176 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 230ae8a895a84e1e8f52517279ccd4900916f18fef0bc9cf7964638a0e592e1e
|
4
|
+
data.tar.gz: e0de429a4d41b9943515a7d938aecfe98350a0facf9b1bb2c66d70eca036d2b4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9c6cafb39b3a6ebea61b253d52edc394b8d0428e17b34b1f9b2d6da6d449da55bf85364cc03b9ccdd36bd0108d34bf0f3d38475119f6feae86abacd552029e0a
|
7
|
+
data.tar.gz: e05c80a57e051f4e922dd992cfec5f28dbecd9da5a45da369794c45af655249ff3a1a9a830a70b75aa8aee548c845ce0165b82731ad0d8048e096037d8e71690
|
data/.rubocop.yml
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
brocade_api_client (0.1.0)
|
5
|
+
httparty (~> 0.16.4)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
addressable (2.6.0)
|
11
|
+
public_suffix (>= 2.0.2, < 4.0)
|
12
|
+
ast (2.4.0)
|
13
|
+
crack (0.4.3)
|
14
|
+
safe_yaml (~> 1.0.0)
|
15
|
+
diff-lcs (1.3)
|
16
|
+
hashdiff (0.4.0)
|
17
|
+
httparty (0.16.4)
|
18
|
+
mime-types (~> 3.0)
|
19
|
+
multi_xml (>= 0.5.2)
|
20
|
+
jaro_winkler (1.5.2)
|
21
|
+
mime-types (3.2.2)
|
22
|
+
mime-types-data (~> 3.2015)
|
23
|
+
mime-types-data (3.2019.0331)
|
24
|
+
multi_xml (0.6.0)
|
25
|
+
mustermann (1.0.3)
|
26
|
+
parallel (1.17.0)
|
27
|
+
parser (2.6.3.0)
|
28
|
+
ast (~> 2.4.0)
|
29
|
+
public_suffix (3.0.3)
|
30
|
+
rack (2.0.7)
|
31
|
+
rack-protection (2.0.5)
|
32
|
+
rack
|
33
|
+
rainbow (3.0.0)
|
34
|
+
rake (10.5.0)
|
35
|
+
rspec (3.8.0)
|
36
|
+
rspec-core (~> 3.8.0)
|
37
|
+
rspec-expectations (~> 3.8.0)
|
38
|
+
rspec-mocks (~> 3.8.0)
|
39
|
+
rspec-core (3.8.0)
|
40
|
+
rspec-support (~> 3.8.0)
|
41
|
+
rspec-expectations (3.8.3)
|
42
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
43
|
+
rspec-support (~> 3.8.0)
|
44
|
+
rspec-mocks (3.8.0)
|
45
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
46
|
+
rspec-support (~> 3.8.0)
|
47
|
+
rspec-support (3.8.0)
|
48
|
+
rubocop (0.68.1)
|
49
|
+
jaro_winkler (~> 1.5.1)
|
50
|
+
parallel (~> 1.10)
|
51
|
+
parser (>= 2.5, != 2.5.1.1)
|
52
|
+
rainbow (>= 2.2.2, < 4.0)
|
53
|
+
ruby-progressbar (~> 1.7)
|
54
|
+
unicode-display_width (>= 1.4.0, < 1.6)
|
55
|
+
ruby-progressbar (1.10.1)
|
56
|
+
safe_yaml (1.0.5)
|
57
|
+
sinatra (2.0.5)
|
58
|
+
mustermann (~> 1.0)
|
59
|
+
rack (~> 2.0)
|
60
|
+
rack-protection (= 2.0.5)
|
61
|
+
tilt (~> 2.0)
|
62
|
+
tilt (2.0.9)
|
63
|
+
unicode-display_width (1.5.0)
|
64
|
+
webmock (3.6.0)
|
65
|
+
addressable (>= 2.3.6)
|
66
|
+
crack (>= 0.3.2)
|
67
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
68
|
+
|
69
|
+
PLATFORMS
|
70
|
+
ruby
|
71
|
+
|
72
|
+
DEPENDENCIES
|
73
|
+
brocade_api_client!
|
74
|
+
bundler (~> 1.16)
|
75
|
+
rake (~> 10.0)
|
76
|
+
rspec (~> 3.0)
|
77
|
+
rubocop (~> 0.66)
|
78
|
+
sinatra (~> 2.0, >= 2.0.3)
|
79
|
+
webmock (~> 3.5, >= 3.5.1)
|
80
|
+
|
81
|
+
BUNDLED WITH
|
82
|
+
1.16.4
|
data/LICENSE
ADDED
@@ -0,0 +1,234 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
1. Definitions.
|
11
|
+
|
12
|
+
|
13
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
14
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
15
|
+
|
16
|
+
|
17
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
18
|
+
the copyright owner that is granting the License.
|
19
|
+
|
20
|
+
|
21
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
22
|
+
other entities that control, are controlled by, or are under common
|
23
|
+
control with that entity. For the purposes of this definition,
|
24
|
+
"control" means (i) the power, direct or indirect, to cause the
|
25
|
+
direction or management of such entity, whether by contract or
|
26
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
27
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
28
|
+
|
29
|
+
|
30
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
31
|
+
exercising permissions granted by this License.
|
32
|
+
|
33
|
+
|
34
|
+
"Source" form shall mean the preferred form for making modifications,
|
35
|
+
including but not limited to software source code, documentation
|
36
|
+
source, and configuration files.
|
37
|
+
|
38
|
+
|
39
|
+
"Object" form shall mean any form resulting from mechanical
|
40
|
+
transformation or translation of a Source form, including but
|
41
|
+
not limited to compiled object code, generated documentation,
|
42
|
+
and conversions to other media types.
|
43
|
+
|
44
|
+
|
45
|
+
"Work" shall mean the work of authorship, whether in Source or
|
46
|
+
Object form, made available under the License, as indicated by a
|
47
|
+
copyright notice that is included in or attached to the work
|
48
|
+
(an example is provided in the Appendix below).
|
49
|
+
|
50
|
+
|
51
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
52
|
+
form, that is based on (or derived from) the Work and for which the
|
53
|
+
editorial revisions, annotations, elaborations, or other modifications
|
54
|
+
represent, as a whole, an original work of authorship. For the purposes
|
55
|
+
of this License, Derivative Works shall not include works that remain
|
56
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
57
|
+
the Work and Derivative Works thereof.
|
58
|
+
|
59
|
+
|
60
|
+
"Contribution" shall mean any work of authorship, including
|
61
|
+
the original version of the Work and any modifications or additions
|
62
|
+
to that Work or Derivative Works thereof, that is intentionally
|
63
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
64
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
65
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
66
|
+
means any form of electronic, verbal, or written communication sent
|
67
|
+
to the Licensor or its representatives, including but not limited to
|
68
|
+
communication on electronic mailing lists, source code control systems,
|
69
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
70
|
+
Licensor for the purpose of discussing and improving the Work, but
|
71
|
+
excluding communication that is conspicuously marked or otherwise
|
72
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
73
|
+
|
74
|
+
|
75
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
76
|
+
on behalf of whom a Contribution has been received by Licensor and
|
77
|
+
subsequently incorporated within the Work.
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
82
|
+
this License, each Contributor hereby grants to You a perpetual,
|
83
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
84
|
+
copyright license to reproduce, prepare Derivative Works of,
|
85
|
+
publicly display, publicly perform, sublicense, and distribute the
|
86
|
+
Work and such Derivative Works in Source or Object form.
|
87
|
+
|
88
|
+
|
89
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
90
|
+
this License, each Contributor hereby grants to You a perpetual,
|
91
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
92
|
+
(except as stated in this section) patent license to make, have made,
|
93
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
94
|
+
where such license applies only to those patent claims licensable
|
95
|
+
by such Contributor that are necessarily infringed by their
|
96
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
97
|
+
with the Work to which such Contribution(s) was submitted. If You
|
98
|
+
institute patent litigation against any entity (including a
|
99
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
100
|
+
or a Contribution incorporated within the Work constitutes direct
|
101
|
+
or contributory patent infringement, then any patent licenses
|
102
|
+
granted to You under this License for that Work shall terminate
|
103
|
+
as of the date such litigation is filed.
|
104
|
+
|
105
|
+
|
106
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
107
|
+
Work or Derivative Works thereof in any medium, with or without
|
108
|
+
modifications, and in Source or Object form, provided that You
|
109
|
+
meet the following conditions:
|
110
|
+
|
111
|
+
|
112
|
+
(a) You must give any other recipients of the Work or
|
113
|
+
Derivative Works a copy of this License; and
|
114
|
+
|
115
|
+
|
116
|
+
(b) You must cause any modified files to carry prominent notices
|
117
|
+
stating that You changed the files; and
|
118
|
+
|
119
|
+
|
120
|
+
(c) You must retain, in the Source form of any Derivative Works
|
121
|
+
that You distribute, all copyright, patent, trademark, and
|
122
|
+
attribution notices from the Source form of the Work,
|
123
|
+
excluding those notices that do not pertain to any part of
|
124
|
+
the Derivative Works; and
|
125
|
+
|
126
|
+
|
127
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
128
|
+
distribution, then any Derivative Works that You distribute must
|
129
|
+
include a readable copy of the attribution notices contained
|
130
|
+
within such NOTICE file, excluding those notices that do not
|
131
|
+
pertain to any part of the Derivative Works, in at least one
|
132
|
+
of the following places: within a NOTICE text file distributed
|
133
|
+
as part of the Derivative Works; within the Source form or
|
134
|
+
documentation, if provided along with the Derivative Works; or,
|
135
|
+
within a display generated by the Derivative Works, if and
|
136
|
+
wherever such third-party notices normally appear. The contents
|
137
|
+
of the NOTICE file are for informational purposes only and
|
138
|
+
do not modify the License. You may add Your own attribution
|
139
|
+
notices within Derivative Works that You distribute, alongside
|
140
|
+
or as an addendum to the NOTICE text from the Work, provided
|
141
|
+
that such additional attribution notices cannot be construed
|
142
|
+
as modifying the License.
|
143
|
+
|
144
|
+
|
145
|
+
You may add Your own copyright statement to Your modifications and
|
146
|
+
may provide additional or different license terms and conditions
|
147
|
+
for use, reproduction, or distribution of Your modifications, or
|
148
|
+
for any such Derivative Works as a whole, provided Your use,
|
149
|
+
reproduction, and distribution of the Work otherwise complies with
|
150
|
+
the conditions stated in this License.
|
151
|
+
|
152
|
+
|
153
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
154
|
+
any Contribution intentionally submitted for inclusion in the Work
|
155
|
+
by You to the Licensor shall be under the terms and conditions of
|
156
|
+
this License, without any additional terms or conditions.
|
157
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
158
|
+
the terms of any separate license agreement you may have executed
|
159
|
+
with Licensor regarding such Contributions.
|
160
|
+
|
161
|
+
|
162
|
+
6. Trademarks. This License does not grant permission to use the trade
|
163
|
+
names, trademarks, service marks, or product names of the Licensor,
|
164
|
+
except as required for reasonable and customary use in describing the
|
165
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
166
|
+
|
167
|
+
|
168
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
169
|
+
agreed to in writing, Licensor provides the Work (and each
|
170
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
171
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
172
|
+
implied, including, without limitation, any warranties or conditions
|
173
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
174
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
175
|
+
appropriateness of using or redistributing the Work and assume any
|
176
|
+
risks associated with Your exercise of permissions under this License.
|
177
|
+
|
178
|
+
|
179
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
180
|
+
whether in tort (including negligence), contract, or otherwise,
|
181
|
+
unless required by applicable law (such as deliberate and grossly
|
182
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
183
|
+
liable to You for damages, including any direct, indirect, special,
|
184
|
+
incidental, or consequential damages of any character arising as a
|
185
|
+
result of this License or out of the use or inability to use the
|
186
|
+
Work (including but not limited to damages for loss of goodwill,
|
187
|
+
work stoppage, computer failure or malfunction, or any and all
|
188
|
+
other commercial damages or losses), even if such Contributor
|
189
|
+
has been advised of the possibility of such damages.
|
190
|
+
|
191
|
+
|
192
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
193
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
194
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
195
|
+
or other liability obligations and/or rights consistent with this
|
196
|
+
License. However, in accepting such obligations, You may act only
|
197
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
198
|
+
of any other Contributor, and only if You agree to indemnify,
|
199
|
+
defend, and hold each Contributor harmless for any liability
|
200
|
+
incurred by, or claims asserted against, such Contributor by reason
|
201
|
+
of your accepting any such warranty or additional liability.
|
202
|
+
|
203
|
+
END OF TERMS AND CONDITIONS
|
204
|
+
|
205
|
+
APPENDIX: How to apply the Apache License to your work.
|
206
|
+
|
207
|
+
|
208
|
+
To apply the Apache License to your work, attach the following
|
209
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
210
|
+
replaced with your own identifying information. (Don't include
|
211
|
+
the brackets!) The text should be enclosed in the appropriate
|
212
|
+
comment syntax for the file format. We also recommend that a
|
213
|
+
file or class name and description of purpose be included on the
|
214
|
+
same "printed page" as the copyright notice for easier
|
215
|
+
identification within third-party archives.
|
216
|
+
|
217
|
+
|
218
|
+
Copyright 2016-2017 Hewlett Packard Enterprise
|
219
|
+
|
220
|
+
|
221
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
222
|
+
you may not use this file except in compliance with the License.
|
223
|
+
You may obtain a copy of the License at
|
224
|
+
|
225
|
+
|
226
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
227
|
+
|
228
|
+
|
229
|
+
Unless required by applicable law or agreed to in writing, software
|
230
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
231
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
232
|
+
See the License for the specific language governing permissions and
|
233
|
+
limitations under the License.
|
234
|
+
|
data/README.md
ADDED
@@ -0,0 +1,248 @@
|
|
1
|
+
[![Build Status](https://travis-ci.com/raldi87/brocadeapi_client.svg?token=mkJwysQXyF3sdXnco1UE&branch=master)](https://travis-ci.com/raldi87/brocadeapi_client)
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/brocade_api_client.svg)](https://badge.fury.io/rb/brocade_api_client)
|
3
|
+
|
4
|
+
Brocade Network Advisor API Client for SAN tasks Automation
|
5
|
+
====================
|
6
|
+
This is a Client library that can talk to the Brocade Network Advisor API. The BNA
|
7
|
+
has a REST web service interface which can be queried.
|
8
|
+
This library implements an interface for talking to the Brocade Advisor and help SAN Admins automate SAN tasks.
|
9
|
+
|
10
|
+
Prerequsites
|
11
|
+
============
|
12
|
+
* Brocade Network Advisor
|
13
|
+
* 14.2.0
|
14
|
+
* 14.4.0 for Peer Zoning Support
|
15
|
+
* Ruby - 2.2.x or higher.
|
16
|
+
* Brocade Network Advisor REST API Service must be enabled on the Server.
|
17
|
+
* Different vendors have there own flavor of Brocade Network Advisor which they are named accordingly: HPE Network Advisor, IBM Network Advisor. All are compatible as they are all based on Brocade Network Advisor.
|
18
|
+
|
19
|
+
Features
|
20
|
+
============
|
21
|
+
|
22
|
+
* resourcegroups
|
23
|
+
* fabrics
|
24
|
+
* fabric
|
25
|
+
* fabricswitches
|
26
|
+
* allswitches
|
27
|
+
* allports
|
28
|
+
* change_portstates
|
29
|
+
* change_persistentportstates
|
30
|
+
* set_portname
|
31
|
+
* zoneshow_all
|
32
|
+
* zoneshow_all_active
|
33
|
+
* zoneshow_all_defined
|
34
|
+
* zoneshow_active
|
35
|
+
* zoneshow_defined
|
36
|
+
* zonecreate_standard
|
37
|
+
* zonecreate_peerzone
|
38
|
+
* zonedelete
|
39
|
+
* zoneadd_standard
|
40
|
+
* zoneremove_standard
|
41
|
+
* zoneadd_peerzone
|
42
|
+
* zoneremove_peerzone
|
43
|
+
* zonedbs
|
44
|
+
* alishow
|
45
|
+
* cfgshow
|
46
|
+
* cfgadd
|
47
|
+
* cfgremove
|
48
|
+
* cfgenable
|
49
|
+
* alicreate
|
50
|
+
* aliadd
|
51
|
+
* aliremove
|
52
|
+
* alidelete
|
53
|
+
* trans_start
|
54
|
+
* trans_commit
|
55
|
+
* trans_abort
|
56
|
+
* syslog_events
|
57
|
+
* trap_events
|
58
|
+
* custom_events
|
59
|
+
|
60
|
+
## Installation
|
61
|
+
|
62
|
+
Add this line to your application's Gemfile:
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
gem 'brocade_api_client'
|
66
|
+
```
|
67
|
+
|
68
|
+
And then execute:
|
69
|
+
|
70
|
+
$ bundle
|
71
|
+
|
72
|
+
Or install it yourself as:
|
73
|
+
|
74
|
+
$ gem install brocade_api_client
|
75
|
+
|
76
|
+
## Usage
|
77
|
+
=============
|
78
|
+
```ruby
|
79
|
+
#Create an instance of brocadeapi_client::Client
|
80
|
+
client = BrocadeAPIClient::Client.new('https://BNA_IP/rest')
|
81
|
+
# The Client supports logging and debug mode . Log format is :logstash
|
82
|
+
client = BrocadeAPIClient::Client.new('https://BNA_IP/rest', enable_logger: true, log_file_path: 'test.log'
|
83
|
+
# Also debug mode is supported by the debug parameters on the Client class constructor. By default its set to false.
|
84
|
+
|
85
|
+
#Login using Brocade Network Advisor API credential
|
86
|
+
client.login('BNA_user', 'BNA_password')
|
87
|
+
|
88
|
+
#Call any method from client class
|
89
|
+
client.alishow(FABRICKEY,'alitest_port1')
|
90
|
+
|
91
|
+
#Logout once you have finished all of your operations
|
92
|
+
client.logout
|
93
|
+
|
94
|
+
# For zoning operations (zonecreate/add/remove , alicreate/add/remove and cfgadd/cfgremove)
|
95
|
+
# you must start a transaction before sending a request to the Advisor
|
96
|
+
# After submitting, you must commit your transactions.
|
97
|
+
# Below you can how to create a zone and peerzone
|
98
|
+
# FabricWWN is the seed switch WWN from the fabric on which you want to make the changes.
|
99
|
+
# Using the fabrics and fabric method you can obtain it easily. Keep in mind this WWN might change,
|
100
|
+
# so you might want to use the methods first tobtain de fabric WWN
|
101
|
+
|
102
|
+
client.trans_start('FabricWWN')
|
103
|
+
# Alicreate supports unlimited number of arguments as WWN
|
104
|
+
client.alicreate('FabricWWN', 'test_alias', '10:00:00:10:9b:52:a8:0b')
|
105
|
+
# Zonecreate supports unlimited number of arguments as zonealiases
|
106
|
+
client.zonecreate_standard('FabricWWN', 'test_zone', 'test_alias', 'testalias')
|
107
|
+
# cfgadd method supports unlimited number to added as arguments/cfgremove is similar
|
108
|
+
client.cfgadd('FabricWWN','test_config','test_zone')
|
109
|
+
client.trans_commit('FabricWWN')
|
110
|
+
# To enable the modification
|
111
|
+
client.cfgenable('FabrickWWN')
|
112
|
+
|
113
|
+
# For Peerzoning use:
|
114
|
+
# The array support unlimited number of WWN that should be part of the zone
|
115
|
+
client.zonecreate_peerzone('FabricWWN', 'test_zone', principal: [ WWN ARRAY ], members: [WWN ARRAY])
|
116
|
+
|
117
|
+
# List all fabrics
|
118
|
+
client.fabrics
|
119
|
+
|
120
|
+
# List fabric description(including seed switch WWN)
|
121
|
+
client.fabric('FabricName')
|
122
|
+
|
123
|
+
# List all active zones in a Fabric
|
124
|
+
client.zoneshow_all_active('FabricWWN')
|
125
|
+
|
126
|
+
# List all defined zones in Fabric
|
127
|
+
client.zoneshow_all_defined('FabricWWN')
|
128
|
+
|
129
|
+
# List a specific active zones information
|
130
|
+
client.zoneshow_active('FabricWWN','zonename')
|
131
|
+
|
132
|
+
# List a specific define zones information
|
133
|
+
client.zoneshow_define('FabricWWN','zonename')
|
134
|
+
|
135
|
+
# Show aliases in fabric or for info for a specific alias
|
136
|
+
client.alishow('FabricWWN')
|
137
|
+
client.alishow('FabricWWN','aliasname')
|
138
|
+
|
139
|
+
# Set port name(PortWWN can be retrieved from allports method)
|
140
|
+
client.set_portname('FabricWWN','PortWWN','test_porname')
|
141
|
+
|
142
|
+
# Get all ports
|
143
|
+
client.allports
|
144
|
+
|
145
|
+
# Get all switches
|
146
|
+
client.allswitches
|
147
|
+
|
148
|
+
# Get all switchs from a specified Fabric
|
149
|
+
client.fabricswitches('FabricWWN')
|
150
|
+
|
151
|
+
# Change port state in a switch(non-persistent)
|
152
|
+
# Method support unlimited number or portwwns after disale|enable
|
153
|
+
client.change_portstates('FabricWWN', 'enable', 'PortWWN1', 'PortWWN2')
|
154
|
+
|
155
|
+
# Change port state in a switch(persistent)
|
156
|
+
# Method support unlimited number or portwwns after disale|enable
|
157
|
+
client.change_persistentportstates('FabricWWN', 'enable', 'PortWWN1', 'PortWWN2')
|
158
|
+
|
159
|
+
# Delete zones
|
160
|
+
# supports unlimited number of zones as arguments
|
161
|
+
client.zonedelete('FabricWWN', 'zone1','zone2')
|
162
|
+
|
163
|
+
# Delete Aliases
|
164
|
+
client.alidelete('FabricWWN','alias1','alias2')
|
165
|
+
|
166
|
+
# Create Alias
|
167
|
+
client.alicreate('FabricWWN','aliasname','wwn1','wwn2')
|
168
|
+
|
169
|
+
# Add wwn to existing alias
|
170
|
+
client.aliadd('FabricWWN','aliasname','wwn1','wwn2')
|
171
|
+
# Remove wwns from existing alias
|
172
|
+
client.aliremove('FabricWWN','aliasname','wwn1','wwn2')
|
173
|
+
|
174
|
+
# Zone add/remove (standard)
|
175
|
+
# supports unlimited number of arguments as aliases
|
176
|
+
client.zoneremove_standard('10:00:00:27:f8:f7:6b:00', 'test_zone', 'alias1','alias2')
|
177
|
+
client.zoneadd_standard('10:00:00:27:f8:f7:6b:00', 'test_zone', 'alias1','alias2')
|
178
|
+
|
179
|
+
# Zone add/remove (peerzone)
|
180
|
+
# method supports both principal/members as hash keys or only one of them
|
181
|
+
client.zoneadd_peerzone('FabricWWN', 'test_zone', principal: ['wwn1','wwn2'],members: ['wwn1','wwn2'])
|
182
|
+
client.zoneremove_peerzone('FabricWWN', 'test_zone', principal: ['wwn1','wwn2'],members: ['wwn1','wwn2'])
|
183
|
+
client.zoneadd_peerzone('FabricWWN', 'test_zone', principal: ['wwn1','wwn2'])
|
184
|
+
client.zoneremove_peerzone('FabricWWN', 'test_zone', principal: ['wwn1','wwn2'])
|
185
|
+
client.zoneadd_peerzone('FabricWWN', 'test_zone', members: ['wwn1','wwn2'])
|
186
|
+
client.zoneremove_peerzone('FabricWWN', 'test_zone', members: ['wwn1','wwn2'])
|
187
|
+
|
188
|
+
# List latest syslog evets
|
189
|
+
client.syslog_events('999')
|
190
|
+
|
191
|
+
# List latest trap events
|
192
|
+
client.trap_events('999')
|
193
|
+
|
194
|
+
# List custom events
|
195
|
+
# Below method lists latest 10 events from syslog with warning severity
|
196
|
+
client.custom_events('0', '10', 'syslog', 'WARNING')
|
197
|
+
|
198
|
+
# Commit changes to fabric defined configuration
|
199
|
+
client.trans_commit('FabricWWN')
|
200
|
+
|
201
|
+
# Start transaction on defined configuration
|
202
|
+
client.trans_start('FabricWWN')
|
203
|
+
|
204
|
+
# Abort/Rollback transaction
|
205
|
+
client.trans_abort('FabricWWN')
|
206
|
+
|
207
|
+
# Enable defined configuration as an active configuration
|
208
|
+
client.cfgenable('FabricWWN')
|
209
|
+
|
210
|
+
# List zone Databases
|
211
|
+
client.zonedbs('FabricWWN')
|
212
|
+
|
213
|
+
# List fabric configuration
|
214
|
+
# Defined configuration
|
215
|
+
client.cfgshow('FabricWWN','defined')
|
216
|
+
# Active configuration
|
217
|
+
client.cfgshow('FabricWWN','active')
|
218
|
+
# Both active and defined configuration
|
219
|
+
client.cfgshow('FabricWWN','all')
|
220
|
+
```
|
221
|
+
|
222
|
+
## Unit Tests
|
223
|
+
==========
|
224
|
+
|
225
|
+
To run all unit tests:
|
226
|
+
```bash
|
227
|
+
$ rake build:spec
|
228
|
+
```
|
229
|
+
The output of the coverage tests will be placed into the ``test_reports`` dir.
|
230
|
+
|
231
|
+
To run a specific test:
|
232
|
+
```bash
|
233
|
+
$ rspec spec/client_spec.rb
|
234
|
+
```
|
235
|
+
|
236
|
+
## Contributing
|
237
|
+
```
|
238
|
+
1.Fork it
|
239
|
+
2.Create your feature branch (git checkout -b my-new-feature)
|
240
|
+
3.Commit your changes (git commit -am 'Added some feature')
|
241
|
+
4.Push to the branch (git push origin my-new-feature)
|
242
|
+
5.Create new Pull Request
|
243
|
+
```
|
244
|
+
|
245
|
+
## License
|
246
|
+
|
247
|
+
This project is licensed under the Apache 2.0 license.
|
248
|
+
|