Cisco-UCS

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN


Parameters are:

- cluster

    The common name of the target cluster.  This name should be resolvable on the 
    host from which the script is run.

- username

    The username to use for the connection.  This username needs to have the 
    correct RBAC role for the operations that one intends to perform.

- passwd

    The plaintext password of the username specified for the __username__ attribute 
    for the connection.

- port

    The port on which to connect to the UCSM XML API on the target cluster.  This 
    parameter is optional and will default to 443 if not provided.

- proto

    The protocol with which to connect to the UCSM XML API on the target cluster.  
    This value is optional hould be one of 'http' or 'https' and will default to 
    'https' if not provided.

### login ()

	$ucs->login;
	print "Authentication token is $ucs->cookie\n";

Creates a connection to the XML API interface of a USCM management instance.  
If sucessful, the attributes of the UCSM management instance are inherited by 
the object.  Most important of these parameters is 'cookie' representing the 
authetication token that uniquely identifies the connection and which is 
subsequently passed transparently on all further communications.

The default time-out value for a token is 10 minutes, therefore if you intend 
to create a long-running session you should periodically call refresh.

### refresh ()

	$ucs->refresh;

Resets the expiry time limit of the existing authentication token to the 
default timeout period of 10m.  Usually not necessary for short-lived 
connections.

### logout ()

	$ucs->logout;

Expires the current authentication token.  This method should always be called 
on completion of a script to expire the authentication token and free the 
current session for use by others.  The UCS XML API has a maximum number of 
available connections, and a maximum number of sessions per user.  In order to 
ensure that the session remain available (especially if using common 
credentials), you should always call this method on completion of a script, as 
an argument to die, or in any eval where a script may fail and exit before 
logging out;

### cookie ()

	print $ucs->cookie;

Returns the value of the authentication token.

### cluster ()

	print $ucs->cluster;

Returns the value of cluster as given in the constructor.

### dn ()

	print $ucs->dn;

Returns the distinguished name that specifies the base scope of the Cisco::UCS 
object.

### get\_error\_id ( $ID )

	my %error = $ucs->get_error_id($id);

	while (my($key,$value) = each %error) {
		print "$key:\t$value\n";
	}
	

__This method is deprecated, please use the equivalent get\_error method__.

Returns a hash containing the UCSM event detail for the given error id.  This 
method takes a single argument; the UCSM error\_id of the desired error.

### error ( $id )

	my $error = $ucs->get_error($id);
	print $error->id . ":" . $error->desc . "\n";

Returns a Cisco::UCS::Fault object representing the specified error.  Note 
that this is a caching method and will return a cached object that has been 
retrieved on previous queries should on be available.

If you require a fresh object, consider using the equivalent non-caching 
__get\_error__ method below.

## get\_error ( $ID )

Returns a Cisco::UCS::Fault object representing the specified error.  Note 
that this is a non-caching method and that the UCSM will always be queried 
for information.  Consequently this method may be more expensive than the 
equivalent caching method __error__ described above.

### get\_errors ()

	map {
		print '-'x50,"\n";
		print "ID		: " . $_->id . "\n";



( run in 0.786 second using v1.01-cache-2.11-cpan-39bf76dae61 )