Cisco-UCS

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


0.50	Mon 30 Nov 2015 <ltp@cpan.org>
	- Use different versioning scheme because some package managers were found to
	  misorder versions using a single decimal value.
	- Changed Makefile.PL back to ExtUtils::MakMaker from inc::Module::Install.

0.4	Thu 26 Nov 2015 <ltp@cpan.org>
	- Release 0.04 - fixed VERSION in all modules.

0.37	Wed 25 Nov 2015 <ltp@cpan.org>
	- Updated _backup() sub for changes with later versions of UCSM.
	- Added Cisco::UCS::Interconnect::Stats.
	- Code and documentation tidy up.

0.33	Fri May 17 2013 <ltp@cpan.org>
	- Added Cisco::UCS::Blade::PowerBudget
	- Added Cisco::UCS::Chassis::Stats
	- Updated Cisco::UCS::Blade to add new method for retreiving power budget stats.
	- Updated Cisco::UCS::Chassis to add new method for retreiving environmental stats..

0.32	Wed May 15 2013 <ltp@cpan.org>

README  view on Meta::CPAN

                    print "Chassis $chassis->{id} serial number: $chassis->{serial}\n";
            }

    Returns an array of Cisco::UCS::Chassis objects representing all chassis
    present within the cluster.

    Note that this method is named get_chassiss (spelt with two sets of
    double-s's) as there exists no English language collective plural for
    the word chassis.

   full_state_backup
    This method generates a new "full state" type backup for the target UCS
    cluster. Internally, this method is implemented as a wrapper method
    around the private backup method. Required parameters for this method:

    backup_proto
       The protocol to use for transferring the backup from the target UCS
       cluster to the backup host. Must be one of: ftp, tftp, scp or sftp.

    backup_host
       The host to which the backup will be transferred.

    backup_target
       The fully qualified name of the file to which the backup is to be
       saved on the backup host. This should include the full directory path
       and the target filename.

    backup_username
       The username to be used for creation of the backup file on the backup
       host. This username should have write/modify file system access to
       the backup target location on the backup host using the protocol
       specified in the backup-proto attribute.

    backup_passwd
       The plaintext password of the user specified for the backup_username
       attribute.

   all_config_backup
    This method generates a new "all configuration" backup for the target
    UCS cluster. Internally, this method is implemented as a wrapper method
    around the private backup method. For the required parameters for this
    method, please refer to the documentation of the full_state_backup
    method.

   system_config_backup
    This method generates a new "system configuration" backup for the target
    UCS cluster. Internally, this method is implemented as a wrapper method
    around the private backup method. For the required parameters for this
    method, please refer to the documentation of the full_state_backup
    method.

   logical_config_backup
    This method generates a new "logical configuration" backup for the
    target UCS cluster. Internally, this method is implemented as a wrapper
    method around the private backup method. For the required parameters for
    this method, please refer to the documentation of the full_state_backup
    method.

NOTES
  Caching Methods
    Several methods in the module return cached objects that have been
    previously retrieved by querying UCSM, this is done to improve the
    performance of methods where a cached copy is satisfactory for the
    intended purpose. The trade off for the speed and lower resource
    requirement is that the cached copy is not guaranteed to be an
    up-to-date representation of the current state of the object.

README.md  view on Meta::CPAN

	foreach my $chassis (@chassis) {
		print "Chassis $chassis->{id} serial number: $chassis->{serial}\n";
	}

Returns an array of Cisco::UCS::Chassis objects representing all chassis 
present within the cluster.

Note that this method is named get\_chassiss (spelt with two sets of double-s's)
as there exists no English language collective plural for the word chassis.

### full\_state\_backup

This method generates a new "full state" type backup for the target UCS 
cluster.  Internally, this method is implemented as a wrapper method around the
private backup method.  Required parameters for this method:

- backup\_proto 

    The protocol to use for transferring the backup from the target UCS cluster to 
    the backup host.  Must be one of: ftp, tftp, scp or sftp.

- backup\_host

    The host to which the backup will be transferred.

- backup\_target

    The fully qualified name of the file to which the backup is to be saved on the 
    backup host.  This should include the full directory path and the target 
    filename.

- backup\_username

    The username to be used for creation of the backup file on the backup host.  
    This username should have write/modify file system access to the backup target 
    location on the backup host using the protocol specified in the backup-proto 
    attribute.

- backup\_passwd

    The plaintext password of the user specified for the backup\_username attribute.

### all\_config\_backup

This method generates a new "all configuration" backup for the target UCS 
cluster.  Internally, this method is implemented as a wrapper method around the
private backup method.  For the required parameters for this method, please 
refer to the documentation of the __full\_state\_backup__ method.

### system\_config\_backup

This method generates a new "system configuration" backup for the target UCS 
cluster.  Internally, this method is implemented as a wrapper method around the
private backup method.  For the required parameters for this method, please 
refer to the documentation of the __full\_state\_backup__ method.

### logical\_config\_backup

This method generates a new "logical configuration" backup for the target UCS 
cluster.  Internally, this method is implemented as a wrapper method around the
private backup method.  For the required parameters for this method, please 
refer to the documentation of the __full\_state\_backup__ method.

## NOTES

## Caching Methods

Several methods in the module return cached objects that have been previously 
retrieved by querying UCSM, this is done to improve the performance of methods 
where a cached copy is satisfactory for the intended purpose.  The trade off 
for the speed and lower resource requirement is that the cached copy is not 
guaranteed to be an up-to-date representation of the current state of the 

lib/Cisco/UCS.pm  view on Meta::CPAN

	my ( $self, $id ) = @_;

	return $self->_get_child_objects(
				id    => $id, 
				type  => 'equipmentChassis', 
				class => 'Cisco::UCS::Chassis', 
				attr  => 'chassis'
			);
}

sub full_state_backup {
	my ( $self, %args ) = @_;

	$args{backup_type} = 'full-state';

	return ( $self->_backup( %args ) );
}
sub all_config_backup {
	my ( $self, %args ) = @_;

	$args{backup_type} = 'config-all';

	return ( $self->_backup( %args ) );
}

sub system_config_backup {
	my ( $self, %args ) = @_;

	$args{backup_type} = 'config-system';

	return ( $self->_backup( %args ) );
}

sub logical_config_backup {
	my ( $self, %args ) = @_;

	$args{backup_type} = 'config-logical';

	return ( $self->_backup( %args ) );
}

sub _backup {
	my ( $self, %args ) = @_;

	unless( defined $args{backup_type} 	and
		defined $args{backup_proto}	and
		defined $args{backup_host}	and
		defined $args{backup_target}	and
		defined $args{backup_passwd}	and
		defined $args{backup_username} ) 
	{
		$self->{error} = 'Bad argument list';
		return
	}

	$args{admin_state} = ( 
		defined $args{admin_state} 
			? $args{admin_state} 
			: 'enabled' 
	);

	$args{preserve_pooled_values} = ( 
		defined $args{preserve_pooled_values} 
			? $args{preserve_pooled_values} 
			: 'yes' 
	);

	unless ( $args{backup_type} =~ /(config-all|full-state|config-system|config-logical)/i ) {
		$self->{error} = "Bad backup type ($args{backup_type})";
		return
	}

	unless ( $args{backup_proto} =~ /^((t|s)?ftp)|(scp)$/i ) {
		$self->{error} = "Bad backup proto' ($args{backup_proto})";
		return
	}

	my $address	= $self->get_cluster_status->{address};

	my $data = <<"XML";
<configConfMos cookie="$self->{cookie}" inHierarchical="false">
  <inConfigs>
    <pair key="sys">
      <topSystem address="$address" dn="sys" name="$self->{cluster}">
        <mgmtBackup adminState="$args{admin_state}" descr="" preservePooledValues="$args{preserve_pooled_values}" 
          proto="$args{backup_proto}" pwd="$args{backup_passwd}" remoteFile="$args{backup_target}" 
          rn="backup-$args{backup_host}" type="$args{backup_type}" 
          user="$args{backup_username}" policyOwner="local">
        </mgmtBackup>
      </topSystem>
    </pair>
  </inConfigs>
</configConfMos>
XML

	my $xml = $self->_ucsm_request( $data ) or return;

	if ( defined $xml->{'errorCode'} ) {

lib/Cisco/UCS.pm  view on Meta::CPAN

	foreach my $chassis (@chassis) {
		print "Chassis $chassis->{id} serial number: $chassis->{serial}\n";
	}

Returns an array of Cisco::UCS::Chassis objects representing all chassis 
present within the cluster.

Note that this method is named get_chassiss (spelt with two sets of double-s's)
as there exists no English language collective plural for the word chassis.

=head3 full_state_backup

This method generates a new "full state" type backup for the target UCS 
cluster.  Internally, this method is implemented as a wrapper method around the
private backup method.  Required parameters for this method:

=over 3

=item backup_proto 

The protocol to use for transferring the backup from the target UCS cluster to 
the backup host.  Must be one of: ftp, tftp, scp or sftp.

=item backup_host

The host to which the backup will be transferred.

=item backup_target

The fully qualified name of the file to which the backup is to be saved on the 
backup host.  This should include the full directory path and the target 
filename.

=item backup_username

The username to be used for creation of the backup file on the backup host.  
This username should have write/modify file system access to the backup target 
location on the backup host using the protocol specified in the backup-proto 
attribute.

=item backup_passwd

The plaintext password of the user specified for the backup_username attribute.

=back

=head3 all_config_backup

This method generates a new "all configuration" backup for the target UCS 
cluster.  Internally, this method is implemented as a wrapper method around the
private backup method.  For the required parameters for this method, please 
refer to the documentation of the B<full_state_backup> method.

=head3 system_config_backup

This method generates a new "system configuration" backup for the target UCS 
cluster.  Internally, this method is implemented as a wrapper method around the
private backup method.  For the required parameters for this method, please 
refer to the documentation of the B<full_state_backup> method.

=head3 logical_config_backup

This method generates a new "logical configuration" backup for the target UCS 
cluster.  Internally, this method is implemented as a wrapper method around the
private backup method.  For the required parameters for this method, please 
refer to the documentation of the B<full_state_backup> method.

=head1 NOTES

=head2 Caching Methods

Several methods in the module return cached objects that have been previously 
retrieved by querying UCSM, this is done to improve the performance of methods 
where a cached copy is satisfactory for the intended purpose.  The trade off 
for the speed and lower resource requirement is that the cached copy is not 
guaranteed to be an up-to-date representation of the current state of the 



( run in 1.726 second using v1.01-cache-2.11-cpan-49f99fa48dc )