Cisco License Manager 2.1 Perl API Guide
ch07parg.fm

Table Of Contents

License Line Management Functions

annotate_license_lines

deploy_license_lines

get_license_lines_by_license

get_license_lines_on_device

list_expired_license_lines

list_expiring_license_lines

read_license_lines

write_license_lines


License Line Management Functions


This chapter provides information about the following license line management functions:

annotate_license_lines

deploy_license_lines

get_license_lines_by_license

get_license_lines_on_device

list_expired_license_lines

list_expiring_license_lines

read_license_lines

write_license_lines

annotate_license_lines

Synopsis

annotate_license_lines ($token, [@licline_ids], [@annotation]) 

Description

This function allows you to annotate a license line with comments.

This function blocks until the call completes. It returns a Cisco::CLM::Common::IDStatus object containing the staus of the operation.

Input Parameters

Parameter
Type
Value
Description

token

UserToken, mandatory

A token that represents your authorization pass, which is obtained after you invoke the login function and are authenticated by the back-end server.

licline_ids

LicenseLine, mandatory

ID is a string containing up to 256 ASCII characters in the range from x21 to x7A

ID of license line objects.

annotation

Array of string, mandatory

Text string up to 99 characters

Text of the annotation for each license line.


Return

The function returns a Cisco::CLM::Common::IDStatus on completion.

Error and Exception

If a system error prevents the operation from completing, a RemoteException is thrown.

deploy_license_lines

Synopsis

deploy_license_lines ($token, [@licline_ids])

Description

This function deploys the given license lines to their target devices.

This function blocks until the call completes. It returns a Cisco::CLM::Common::IDStatus object containing the staus of the operation.

Input Parameters

Parameter
Type
Value
Description

token

UserToken, mandatory

A token that represents your authorization pass, which is obtained after you invoke the login function and are authenticated by the back-end server.

licline_ids

Array of string, mandatory

ID is a string containing up to 256 ASCII characters in the range from x21 to x7A

An array of license line ID


Return

The function returns a Cisco::CLM::Common::IDStatus on completion.

Error and Exception

If a system error prevents the operation from completing, a RemoteException is thrown.

get_license_lines_by_license

Synopsis

get_license_lines_by_license($token, $lic_id)

Description

This function retrieves license lines, which are contained in the given license.

Input Parameters

Parameter
Type
Value
Description

token

UserToken, mandatory

A token that represents your authorization pass, which is obtained after you invoke the login function and are authenticated by the back-end server.

lic_id

String, mandatory

The license ID.


Return

This function returns a Cisco::CLM::Common::LicLineStatus object.

Error and Exception

If a system error prevents the operation from completing, a RemoteException is thrown.

When an error occurs for an element in the input array, the error code and error message are contained in the returned status object.

get_license_lines_on_device

Synopsis

get_license_lines_on_device ($token, $dev_id) 

Description

This function retrieves license lines that are contained in the given device ID.

Input Parameters

Parameter
Type
Value
Description

token

UserToken, mandatory

A token that represents your authorization pass, which is obtained after you invoke the login function and are authenticated by the back-end server.

dev_id

String, mandatory

The device ID.


Return

This function returns a Cisco::CLM::Common::LicLineStatus object.

Error and Exception

If a system error prevents the operation from completing, a RemoteException is thrown.

When an error occurs for an element in the input array, information about the error is contained in the returned status object.

list_expired_license_lines

Synopsis

list_expired_license_lines ($token)

Description

This function returns a list of license lines that have expired.

Input Parameters

Parameter
Type
Value
Description

token

UserToken, mandatory

A token that represents your authorization pass, which is obtained after you invoke the login function and are authenticated by the back-end server.


Return

The function returns an array of Cisco::CLM::Common::ExpiredLicense objects.

The following code shows how to get the ExpiredLicenseLines from the ExpiredLicense objects.

			my $expired_license = $lic_manager->list_expired_license_lines($token);
			my @array = @{$expired_license} if defined $expired_license;

			foreach my $x (@array){
				print "\n deviceId: ".$x->get_device_id;
				print "\n LicLineId: ".$x->get_lic_line_id;
           }

Error and Exception

If a system error prevents the operation from completing, a RemoteException is thrown.

This function returns an array of ExpiredLicense objects. It returns null when an error occurs.

list_expiring_license_lines

Synopsis

list_expiring_license_lines ($token, $days_to_expire) 

Description

This function returns a list of license lines will expire in the given number of (days_to_expire) days .

Input Parameters

Parameter
Type
Value
Description

token

UserToken, mandatory

A token that represents your authorization pass, which is obtained after you invoke the login function and are authenticated by the back-end server.

days_to_expire

int,

mandatory

0 - 65535

Specify days to the expiration of licenses.


Return

The function returns an array of Cisco::CLM::Common::ExpiredLicense objects.

Error and Exception

If a system error prevents the operation from completing, a RemoteException is thrown.

read_license_lines

Synopsis

read_license_lines ($token, [@licline_ids]) 

Description

This function retrieves an array of Cisco::CLM::Common::LicenseLine objects from the inventory using the given license line IDs.

Input Parameters

Parameter
Type
Value
Description

token

UserToken, mandatory

A token that represents your authorization pass, which is obtained after you invoke the login function and are authenticated by the back-end server.

licline_ids

Array of string, mandatory

ID is a string containing up to 256 ASCII characters in the range from x21 to x7A

An array of license line IDs.


Return

This function returns a Cisco::CLM::Common::LicLineStatus object.

Error and Exception

If a system error prevents the operation from completing, a RemoteException is thrown.

When an error occurs for an element in the input array, information about the error is contained in the returned status object.

write_license_lines

Synopsis

write_license_lines ($token, [@liclines])

Description

This function writes the given license line objects into the inventory. The input license line objects can be existing instances of Cisco::CLM::Common::LicenseLine retrieved from the inventory by the read_license_lines function.

Input Parameters

Parameter
Type
Value
Description

token

UserToken, mandatory

A token that represents your authorization pass, which is obtained after you invoke the login function and are authenticated by the back-end server.

liclines

Array of LicenseLine mandatory

ID is a string containing up to 256 ASCII characters in the range from x21 to x7A

An array of license line objects.


Return

This function returns a Cisco::CLM::Common::IDStatus object.

Error and Exception

If a system error prevents the operation from completing, a RemoteException is thrown.

When an error occurs for an element in the input array, information about the error is contained in the returned status object.