NAME
PDK::Device::Cisco::Nxos - A module for interacting with Cisco Nexus (NX-OS) devices
SYNOPSIS
use PDK::Device::Cisco::Nxos;
my $device = PDK::Device::Cisco::Nxos->new(
host => '192.168.1.1',
username => 'admin',
password => 'password'
);
$device->login();
my $result = $device->ftpConfig('hostname', 'ftp.example.com', 'ftpuser', 'ftppass');
DESCRIPTION
PDK::Device::Cisco::Nxos is a Moose-based module that extends PDK::Device::Cisco to provide specific functionality for Cisco Nexus (NX-OS) devices. It includes methods for backing up device configurations via FTP.
INHERITANCE
This module inherits from PDK::Device::Cisco.
METHODS
ftpConfig($hostname, $server, $username, $password)
Backs up the device configuration via FTP.
Parameters: =over 4 =item * $hostname
- Optional hostname for the backup file =item * $server
- FTP server address =item * $username
- FTP username =item * $password
- FTP password =back
Returns: A hash reference with keys: =over 4 =item * success
- Boolean indicating if the operation was successful =item * config
- The result of the FTP backup operation =back
Example: my $result = $device->ftpConfig('switch1', 'ftp.example.com', 'ftpuser', 'ftppass'); if ($result->{success}) { print "Backup successful: $result->{config}\n"; }
Note: This method uses the 'default' VRF for FTP connection. In actual IDC environments, you might need to use the 'management' VRF.
ENVIRONMENT VARIABLES
This module uses the following environment variables if they are set:
- PDK_FTP_SERVER
-
The default FTP server to use for configuration backups.
- PDK_FTP_USERNAME
-
The default username for FTP authentication.
- PDK_FTP_PASSWORD
-
The default password for FTP authentication.
DEPENDENCIES
This module requires the following Perl modules:
AUTHOR
WENWU YAN <968828@gmail.com>
LICENSE AND COPYRIGHT
Copyright (C) 2024 WENWU YAN
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.