Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion netapp_dataops_traditional/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build
netapp_dataops_traditional.egg-info
dist
dist
*.pyc
3 changes: 3 additions & 0 deletions netapp_dataops_traditional/docs/ontap_readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ netapp_dataops_cli.py config

Note: The toolkit requires an ONTAP account with API access. The toolkit will use this account to access the ONTAP API. NetApp recommends using an SVM-level account. Usage of a cluster admin account should be avoided for security reasons.

Note: The toolkit supports custom port numbers for the ONTAP API connection. If not specified during configuration, the default port 443 (HTTPS) will be used. To use a custom port, specify it when creating the config file or add it to your existing `config.json` file as `"port": <port_number>`.

> **Note: Keyring Service Configuration**
>
> The toolkit stores ONTAP credentials securely using your system's keyring service. By default, it uses the service name `netapp:dataops:ontap` to store and retrieve credentials.
Expand All @@ -50,6 +52,7 @@ Note: The toolkit requires an ONTAP account with API access. The toolkit will us
```sh
netapp_dataops_cli.py config
Enter ONTAP management LIF hostname or IP address (Recommendation: Use SVM management interface): 10.61.188.114
Enter ONTAP API port number [443]: 8001
Enter SVM (Storage VM) name: ailab1
Enter SVM NFS data LIF hostname or IP address: 10.61.188.119
Enter default volume type to use when creating new volumes (flexgroup/flexvol) [flexgroup]:
Expand Down
10 changes: 10 additions & 0 deletions netapp_dataops_traditional/netapp_dataops/netapp_dataops_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,16 @@ def createConfig(configDirPath: str = "~/.netapp_dataops", configFilename: str =

# Prompt user to enter config details
config["hostname"] = input("Enter ONTAP management LIF hostname or IP address (Recommendation: Use SVM management interface): ")
# Prompt user to enter port (optional, defaults to 443)
portInput = input("Enter ONTAP API port number [443]: ")
if portInput:
try:
config["port"] = int(portInput)
except ValueError:
logger.error("Invalid port number. Using default port 443.")
config["port"] = 443
else:
config["port"] = 443
config["svm"] = input("Enter SVM (Storage VM) name: ")
config["dataLif"] = input("Enter SVM NFS data LIF hostname or IP address: ")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ def _instantiate_connection(config: dict, connectionType: str = "ONTAP", print_o
ontapClusterAdminUsername = config["username"]
ontapClusterAdminPassword = config["password"]
verifySSLCert = config["verifySSLCert"]
# Port is optional, default to 443 if not specified
ontapClusterPort = int(config.get("port", 443))
except:
if print_output:
_print_invalid_config_error()
Expand All @@ -220,7 +222,8 @@ def _instantiate_connection(config: dict, connectionType: str = "ONTAP", print_o
host=ontapClusterMgmtHostname,
username=ontapClusterAdminUsername,
password=ontapClusterAdminPassword,
verify=verifySSLCert
verify=verifySSLCert,
port=ontapClusterPort
)

else:
Expand Down