|
1 | | -# ONTAP REST Python Client Library Examples |
2 | | - |
3 | | -The repository folder **python_client_library** contains samples scripts you can refer to understand how the ONTAP REST API can be accessed through the Python client library. |
4 | | - |
5 | | -# Preparation |
6 | | - |
7 | | -Before running the example scripts, make sure the following packages are installed: |
8 | | - |
9 | | -* python 3.5 or later |
10 | | -* requests 2.21.0 or later |
11 | | -* marshmallow 3.2.1 or later |
12 | | - |
13 | | -See the [PyPI netapp-ontap](https://pypi.org/project/netapp-ontap/) package web page for more information. |
14 | | - |
15 | | -**Note: ** |
16 | | -If you are using ONTAP 9.6 "netapp_ontap" Python client library module, make sure to replace `from netapp_ontap import NetAppRestError` header with `from netapp_ontap.error import NetAppRestError` header. |
17 | | - |
18 | | - |
19 | | -# Summary of the Python client library scripts |
20 | | - |
21 | | -The following table summaries the scripts used to access the ONTAP REST API using the Python client library. Make sure to run each of the scripts with the appropriate parameters. |
22 | | - |
23 | | -# Day 0 Scripts: |
24 | | -| Script | Description | |
25 | | -|:------------------------------------|:-------------| |
26 | | -| aggregate_operations.py | Demonstrates aggregate creation, deletion, updation and listing using ONTAP REST API Python Client Library. | |
27 | | -| cert_auth.py | Creates or updates user account to enable certificate based authentication for that account. | |
28 | | -| interface_operations.py | Demonstrates interface creation, deletion, updation and listing using ONTAP REST API Python Client Library. | |
29 | | -| license_operations.py | Demonstrates license creation, deletion and listing using ONTAP REST API Python Client Library. | |
30 | | - |
31 | | -# Day 1 Scripts: |
32 | | -| Script | Description | |
33 | | -|:------------------------------------|:-------------| |
34 | | -| account_operations.py | Demonstrates user account creation, deletion, updation and listing using ONTAP REST API Python Client Library. | |
35 | | -| cifs_setup.py | Demonstrates how CIFS shares can be setup using ONTAP REST API Python Client Library. It creates a volume and then creates a share on the volume. | |
36 | | -| initiator_operations.py | Demonstrates initiator creation, deletion, updation and listing using ONTAP REST API Python Client Library. | |
37 | | -| iscsi_setup.py | Demonstrates how ISCSI luns can be setup using ONTAP REST API Python Client Library. It creates a lun within a volume and creates a new initiator group. The script, then, maps the lun to the initiator group. | |
38 | | -| nfs_setup.py | Demonstrates NFS Setup using ONTAP REST API Python Client Library. The script creates an export-policy and a volume and then, sets up a mount. | |
39 | | -| snapshot_operations.py | Demonstrates snapshot operations like snapshot creation, deletion, updation and listing using ONTAP REST API Python Client Library. | |
40 | | -| svm_operations.py | Demonstrates SVM operations like SVM creation, deletion, updation and listing using ONTAP REST API Python Client Library. | |
41 | | - |
42 | | -# Day 2 Scripts: |
43 | | -| Script | Description | |
44 | | -|:------------------------------------|:-------------| |
45 | | -| create_clone.py | Demonstrates clone creation using ONTAP REST API Python Client Library on the specified volume. | |
46 | | -| create_snapshot.py | Demonstrates snapshot creation using ONTAP REST API Python Client Library on the specified volume. | |
47 | | -| events.py | Demonstrates listing of config, events, filters, destinations using ONTAP REST API Python Client Library. | |
48 | | -| list_aggregates.py | Lists all the aggregates in a cluster using ONTAP REST API Python Client Library. | |
49 | | -| list_clones.py | Lists all the clones in a cluster using ONTAP REST API Python Client Library. | |
50 | | -| list_snapshots.py | Lists all the snapshots in the specified volume using ONTAP REST API Python Client Library. | |
51 | | -| list_volumes.py | Lists all the volumes in a SVM using ONTAP REST API Python Client Library. | |
52 | | -| list_vserver.py | Lists all the SVMs in a cluster using ONTAP REST API Python Client Library. | |
53 | | -| lun_operations.py | Demonstrates lun creation, deletion, updation and listing using ONTAP REST API Python Client Library. | |
54 | | -| qtree_operations.py | Demonstrates qtree operations like qtree creation, updation, deletion and listing using ONTAP REST API Python Client Library. | |
55 | | -| quota_operations.py | Demonstrates quota operations like quota creation, updation, deletion and listing using ONTAP REST API Python Client Library. | |
56 | | -| snapmirror_operations.py | Demonstrates SnapMirror operations like SnapMirror relationship creation, deletion, updation and listing using ONTAP REST API Python Client Library. | |
57 | | -| volume_batch_delete.py | Demonstrates volume batch delete operations using ONTAP REST API Python Client Library. | |
58 | | -| volume_batch_patch.py | Demonstrates volume batch update operations using ONTAP REST API Python Client Library. | |
59 | | -| volume_operations.py | Demonstrates volume operations like volume creation, deletion, updation, cloning and listing using ONTAP REST API Python Client Library. | |
| 1 | +# ONTAP REST Python Client Library Examples |
| 2 | + |
| 3 | +The repository folder **python_client_library** contains samples scripts you can refer to understand how the ONTAP REST API can be accessed through the Python client library. |
| 4 | + |
| 5 | +# Preparation |
| 6 | + |
| 7 | +Before running the example scripts, make sure the following packages are installed: |
| 8 | + |
| 9 | +* python 3.5 or later |
| 10 | +* requests 2.21.0 or later |
| 11 | +* marshmallow 3.2.1 or later |
| 12 | + |
| 13 | +See the [PyPI netapp-ontap](https://pypi.org/project/netapp-ontap/) package web page for more information. |
| 14 | + |
| 15 | +**Note: ** |
| 16 | +If you are using ONTAP 9.6 "netapp_ontap" Python client library module, make sure to replace `from netapp_ontap import NetAppRestError` header with `from netapp_ontap.error import NetAppRestError` header. |
| 17 | + |
| 18 | + |
| 19 | +# Summary of the Python client library scripts |
| 20 | + |
| 21 | +The following table summaries the scripts used to access the ONTAP REST API using the Python client library. Make sure to run each of the scripts with the appropriate parameters. |
| 22 | + |
| 23 | +# Day 0 Scripts: |
| 24 | +| Script | Description | |
| 25 | +|:------------------------------------|:-------------| |
| 26 | +| aggregate_operations.py | Demonstrates aggregate creation, deletion, updation and listing using ONTAP REST API Python Client Library. | |
| 27 | +| cert_auth.py | Creates or updates user account to enable certificate based authentication for that account. | |
| 28 | +| interface_operations.py | Demonstrates interface creation, deletion, updation and listing using ONTAP REST API Python Client Library. | |
| 29 | +| license_operations.py | Demonstrates license creation, deletion and listing using ONTAP REST API Python Client Library. | |
| 30 | + |
| 31 | +# Day 1 Scripts: |
| 32 | +| Script | Description | |
| 33 | +|:------------------------------------|:-------------| |
| 34 | +| account_operations.py | Demonstrates user account creation, deletion, updation and listing using ONTAP REST API Python Client Library. | |
| 35 | +| cifs_setup.py | Demonstrates how CIFS shares can be setup using ONTAP REST API Python Client Library. It creates a volume and then creates a share on the volume. | |
| 36 | +| initiator_operations.py | Demonstrates initiator creation, deletion, updation and listing using ONTAP REST API Python Client Library. | |
| 37 | +| iscsi_setup.py | Demonstrates how ISCSI luns can be setup using ONTAP REST API Python Client Library. It creates a lun within a volume and creates a new initiator group. The script, then, maps the lun to the initiator group. | |
| 38 | +| nfs_setup.py | Demonstrates NFS Setup using ONTAP REST API Python Client Library. The script creates an export-policy and a volume and then, sets up a mount. | |
| 39 | +| snapshot_operations.py | Demonstrates snapshot operations like snapshot creation, deletion, updation and listing using ONTAP REST API Python Client Library. | |
| 40 | +| svm_operations.py | Demonstrates SVM operations like SVM creation, deletion, updation and listing using ONTAP REST API Python Client Library. | |
| 41 | + |
| 42 | +# Day 2 Scripts: |
| 43 | +| Script | Description | |
| 44 | +|:------------------------------------|:-------------| |
| 45 | +| create_clone.py | Demonstrates clone creation using ONTAP REST API Python Client Library on the specified volume. | |
| 46 | +| create_snapshot.py | Demonstrates snapshot creation using ONTAP REST API Python Client Library on the specified volume. | |
| 47 | +| events.py | Demonstrates listing of config, events, filters, destinations using ONTAP REST API Python Client Library. | |
| 48 | +| list_aggregates.py | Lists all the aggregates in a cluster using ONTAP REST API Python Client Library. | |
| 49 | +| list_clones.py | Lists all the clones in a cluster using ONTAP REST API Python Client Library. | |
| 50 | +| list_snapshots.py | Lists all the snapshots in the specified volume using ONTAP REST API Python Client Library. | |
| 51 | +| list_volumes.py | Lists all the volumes in a SVM using ONTAP REST API Python Client Library. | |
| 52 | +| list_vserver.py | Lists all the SVMs in a cluster using ONTAP REST API Python Client Library. | |
| 53 | +| lun_operations.py | Demonstrates lun creation, deletion, updation and listing using ONTAP REST API Python Client Library. | |
| 54 | +| qtree_operations.py | Demonstrates qtree operations like qtree creation, updation, deletion and listing using ONTAP REST API Python Client Library. | |
| 55 | +| quota_operations.py | Demonstrates quota operations like quota creation, updation, deletion and listing using ONTAP REST API Python Client Library. | |
| 56 | +| snapmirror_operations.py | Demonstrates SnapMirror operations like SnapMirror relationship creation, deletion, updation and listing using ONTAP REST API Python Client Library. | |
| 57 | +| volume_batch_delete.py | Demonstrates volume batch delete operations using ONTAP REST API Python Client Library. | |
| 58 | +| volume_batch_patch.py | Demonstrates volume batch update operations using ONTAP REST API Python Client Library. | |
| 59 | +| volume_operations.py | Demonstrates volume operations like volume creation, deletion, updation, cloning and listing using ONTAP REST API Python Client Library. | |
0 commit comments