Skip to content

Commit caa0550

Browse files
committed
Initial Commit
1 parent ecae309 commit caa0550

File tree

78 files changed

+12983
-12421
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+12983
-12421
lines changed

CONTRIBUTING.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# Contributing to NetApp's REST Examples
2-
3-
Adding new example scripts, improving documentation, fixing bugs, or writing tutorials are all examples of
4-
helpful contributions.
5-
6-
Bug fixes and script additions can be initiated through GitHub pull requests. You can read about how to create a
7-
pull request [here](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork)
8-
When making code contributions to the repository, we ask that you follow the [PEP 8](https://www.python.org/dev/peps/pep-0008)
9-
coding standard.
10-
11-
This repository requires that you certify yourself under the terms of the [Developer Certificate of Origin](https://developercertificate.org/).
12-
Be sure to sign off your commits using the `-s` flag or adding `Signed-off-By: Name<Email>` in the commit message.
13-
14-
### Example
15-
```bash
16-
git commit -s -m 'Informative commit message'
17-
```
18-
For more information on how you could contribute, refer the [ONTAP REST API Contribution](https://github.com/NetApp/ontap-rest-python/wiki/contributing_to_ontaprestapi) documentation.
1+
# Contributing to NetApp's REST Examples
2+
3+
Adding new example scripts, improving documentation, fixing bugs, or writing tutorials are all examples of
4+
helpful contributions.
5+
6+
Bug fixes and script additions can be initiated through GitHub pull requests. You can read about how to create a
7+
pull request [here](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork)
8+
When making code contributions to the repository, we ask that you follow the [PEP 8](https://www.python.org/dev/peps/pep-0008)
9+
coding standard.
10+
11+
This repository requires that you certify yourself under the terms of the [Developer Certificate of Origin](https://developercertificate.org/).
12+
Be sure to sign off your commits using the `-s` flag or adding `Signed-off-By: Name<Email>` in the commit message.
13+
14+
### Example
15+
```bash
16+
git commit -s -m 'Informative commit message'
17+
```
18+
For more information on how you could contribute, refer the [ONTAP REST API Contribution](https://github.com/NetApp/ontap-rest-python/wiki/contributing_to_ontaprestapi) documentation.

LICENSE

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
BSD 3-Clause License
2-
3-
Copyright (c) 2020, NetApp
4-
All rights reserved.
5-
6-
Redistribution and use in source and binary forms, with or without
7-
modification, are permitted provided that the following conditions are met:
8-
9-
1. Redistributions of source code must retain the above copyright notice, this
10-
list of conditions and the following disclaimer.
11-
12-
2. Redistributions in binary form must reproduce the above copyright notice,
13-
this list of conditions and the following disclaimer in the documentation
14-
and/or other materials provided with the distribution.
15-
16-
3. Neither the name of the copyright holder nor the names of its
17-
contributors may be used to endorse or promote products derived from
18-
this software without specific prior written permission.
19-
20-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2020, NetApp
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6 KB
Binary file not shown.
Lines changed: 108 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,108 @@
1-
ONTAPI Usage Reporting Tool
2-
---------------------
3-
4-
* Introduction
5-
* Requirements
6-
* Usage
7-
* Support
8-
9-
INTRODUCTION
10-
------------
11-
In order to help our professional services, Customers and Partners to help them identify the ONTAPI(ZAPI) usage in their cluster environment, ONTAPI Usage Reporting tool has been developed covering 3 different usecases. These scripts are python-based.
12-
13-
The scripts provided in this wheel file are,
14-
15-
Script | Description
16-
------------- | -------------
17-
**apache_scraper.py** | Apache log scraper to find ONTAPIs (ZAPIs) called against ONTAP nodes
18-
**session_stats.py** | Command line script to pull session statistics data from ONTAP
19-
**zapi_to_rest.py** | Script to find REST details of ZAPI and attributes passed
20-
21-
22-
REQUIREMENTS
23-
-------------
24-
25-
Python3.7 or higher is required to run the scripts. If there are compatibility issues with the the included packages, All versions offered can be found below:
26-
27-
* numpy - https://pypi.org/project/numpy/#files
28-
29-
* pandas - https://pypi.org/project/pandas/#files
30-
31-
* python-dateutil - https://pypi.org/project/python-dateutil/#files
32-
33-
* pytz - https://pypi.org/project/pytz/#files
34-
35-
* requests - https://pypi.org/project/requests/#files
36-
37-
* six - https://pypi.org/project/six/#files
38-
39-
INSTALLATION
40-
------------
41-
Download the wheel file and input the command to install the wheel file: **pip install netapp_ztools-1.0.0-py3-none-any**
42-
- The above command installs all the required dependencies.
43-
- Visit the python_folder\Lib\site-packages\netapp_ztools\ to see the installed scripts,
44-
45-
![image](https://user-images.githubusercontent.com/61284863/153841819-c974006b-e52a-4287-950a-00b6b7278d4c.png)
46-
47-
48-
USAGE
49-
-----
50-
51-
#### Script_1: python apache_scraper.py -h ####
52-
53-
- **Description:** Apache log scraper to find ONTAPIs (ZAPIs) called against ONTAP nodes
54-
55-
- **usage:** - apache_scraper.py [-h] [-unique] [-start START] [-end END] [-date DATE] [-node NODE] [-write-csv] [-verbose] log
56-
57-
- positional arguments:
58-
- log&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Absolute path of apache_access.log file copied from an ONTAP node
59-
60-
- optional arguments:
61-
- -h,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;help show this help message and exit
62-
- -unique&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Filter unique ZAPIs only
63-
- -start START&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start time to inspect logs, formatted as H:M:S
64-
- -end END&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End time to inspect logs, formatted as H:M:S
65-
- -date DATE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Date of filtered results if a multiday run
66-
- -node NODE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Node to search
67-
- -write-csv, -w&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes to a csv file
68-
- -verbose, -v
69-
![image](https://user-images.githubusercontent.com/61284863/153816578-0842a8b0-97d9-4a1c-90f3-358ecc5f589c.png)
70-
71-
72-
#### Script_2: python session_stats.py -h ####
73-
74-
- **Description:** Command line script to pull session statistics data from ONTAP
75-
76-
- **usage:** session_stats.py [-h] [-username USERNAME] [-password PASSWORD] [-scope SCOPE] [-sort-by SORT_BY] [--verbose] [-write-csv] hosts
77-
78-
- positional arguments:
79-
hosts&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Comma separated list of IP addresses or FQDN of ONTAP node(s)
80-
81-
- optional arguments:
82-
- -h, --help&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;show this help message and exit
83-
- -username&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;USERNAME
84-
- -password&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PASSWORD
85-
- -scope&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SCOPE{cluster|node}
86-
- -sort-by&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SORT_BY {application|location|request|user|vserver}
87-
- --verbose, -v
88-
- -write-csv, -w
89-
90-
The CLI equivalent of the session_stats.py commands is: **security session request-statistics show-by-{application|location|request|user|vserver}**
91-
![image](https://user-images.githubusercontent.com/61284863/153852694-9ba389a9-6d1a-4849-8d2e-4dd6c90a4060.png)
92-
93-
94-
#### Script_3: python zapi_to_rest.py -h ####
95-
96-
- **Description:** Tools to find REST details of ZAPI and attributes passed
97-
98-
- **usage:** zapi_to_rest.py [-h] [-attrs ATTRS] zapi
99-
100-
- positional arguments:
101-
- zapi&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ZAPI
102-
103-
- optional arguments:
104-
- -h, --help&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;show this help message and exit
105-
- -attrs ATTRS, -a ATTRS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;comma separated list of attributes to map REST field equivalents
106-
- --version VERSION&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specify target ONTAP version { 9_10_1 | 9_9_1 | 9_8 }
107-
108-
![image](https://user-images.githubusercontent.com/61284863/153816352-4b1fc5c0-ffe0-4356-9823-9ed3c6b51099.png)
109-
110-
111-
SUPPORT
112-
-----------
113-
114-
For questions and for addressing bugs, please reach out to ng-ontap-restapi-queries@netapp.com
1+
ONTAPI Usage Reporting Tool
2+
---------------------
3+
4+
* Introduction
5+
* Requirements
6+
* Usage
7+
* Support
8+
9+
INTRODUCTION
10+
------------
11+
In order to help our professional services, Customers and Partners to help them identify the ONTAPI usage in their cluster environment, ONTAPI Usage Reporting tool has been developed covering 3 different usecases.
12+
These scripts are python-based.
13+
14+
The scripts provided in this wheel file:
15+
16+
Script | Description
17+
------------- | -------------
18+
**apache_scraper.py** | Apache log scraper to find ONTAPIs (ZAPIs) called against ONTAP nodes
19+
**session_stats.py** | Command line script to pull session statistics data from ONTAP
20+
**zapi_to_rest.py** | Script to find REST details of ZAPI and attributes passed
21+
22+
23+
REQUIREMENTS
24+
-------------
25+
26+
Python3.7 or higher is required to run the scripts. If there are compatibility issues with the the included packages, All versions offered can be found below:
27+
28+
* numpy - https://pypi.org/project/numpy/#files
29+
30+
* pandas - https://pypi.org/project/pandas/#files
31+
32+
* python-dateutil - https://pypi.org/project/python-dateutil/#files
33+
34+
* pytz - https://pypi.org/project/pytz/#files
35+
36+
* requests - https://pypi.org/project/requests/#files
37+
38+
* six - https://pypi.org/project/six/#files
39+
40+
Command to install the wheel file: **pip install netapp_ztools-1.0.0-py3-none-any**
41+
42+
USAGE
43+
-----
44+
45+
#### Script_1: python apache_scraper.py -h ####
46+
47+
- **Description:** Apache log scraper to find ONTAPIs (ZAPIs) called against ONTAP nodes
48+
49+
- **usage:** - apache_scraper.py [-h] [-unique] [-start START] [-end END] [-date DATE] [-node NODE] [-write-csv] [-verbose] log
50+
51+
- positional arguments:
52+
- log&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Absolute path of apache_access.log file copied from an ONTAP node
53+
54+
- optional arguments:
55+
- -h,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;help show this help message and exit
56+
- -unique&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Filter unique ZAPIs only
57+
- -start START&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start time to inspect logs, formatted as H:M:S
58+
- -end END&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End time to inspect logs, formatted as H:M:S
59+
- -date DATE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Date of filtered results if a multiday run
60+
- -node NODE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Node to search
61+
- -write-csv, -w&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes to a csv file
62+
- -verbose, -v
63+
![image](https://user-images.githubusercontent.com/61284863/153816578-0842a8b0-97d9-4a1c-90f3-358ecc5f589c.png)
64+
65+
66+
#### Script_2: python session_stats.py -h ####
67+
68+
- **Description:** Command line script to pull session statistics data from ONTAP
69+
70+
- **usage:** session_stats.py [-h] [-username USERNAME] [-password PASSWORD] [-scope SCOPE] [-sort-by SORT_BY] [--verbose] [-write-csv] hosts
71+
72+
- positional arguments:
73+
hosts&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Comma separated list of IP addresses or FQDN of ONTAP node(s)
74+
75+
- optional arguments:
76+
- -h, --help&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;show this help message and exit
77+
- -username&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;USERNAME
78+
- -password&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PASSWORD
79+
- -scope&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SCOPE{cluster|node}
80+
- -sort-by&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SORT_BY {application|location|request|user|vserver}
81+
- --verbose, -v
82+
- -write-csv, -w
83+
84+
The CLI equivalent of the session_stats.py commands is: **security session request-statistics show-by-{application|location|request|user|vserver}**
85+
86+
![image](https://user-images.githubusercontent.com/61284863/153811433-5b087671-eaf2-48dc-9a53-1f8007223f8f.png)
87+
88+
#### Script_3: python zapi_to_rest.py -h ####
89+
--------------------------------
90+
- **Description:** Tools to find REST details of ZAPI and attributes passed
91+
92+
- **usage:** zapi_to_rest.py [-h] [-attrs ATTRS] zapi
93+
94+
- positional arguments:
95+
- zapi&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ZAPI
96+
97+
- optional arguments:
98+
- -h, --help&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;show this help message and exit
99+
- -attrs ATTRS, -a ATTRS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;comma separated list of attributes to map REST field equivalents
100+
- --version VERSION&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specify target ONTAP version { 9_10_1 | 9_9_1 | 9_8 }
101+
102+
![image](https://user-images.githubusercontent.com/61284863/153816352-4b1fc5c0-ffe0-4356-9823-9ed3c6b51099.png)
103+
104+
105+
SUPPORT
106+
-----------
107+
108+
These scripts were developed by the CSI team at NetApp. For questions and for addressing bugs, please reach out to ng-ontap-rest-queries@netapp.com

ONTAPI-Usage-Reporting-Tool/netapp_ztools-1.0.0-py3-none-any.whl renamed to ONTAPI-Usage-Reporting-Tool/netapp_ztools-1.1.0-py3-none-any.whl

26.6 MB
Binary file not shown.

0 commit comments

Comments
 (0)