The $object data type is the specification of a repository object to be acted upon.

This can be given in one of the formats described in Formats to specify a repository object.

Table 1. Formats to specify a repository object

Format

Description

'class::instance'

This format uses a single string, containing both the class and instance name with two colons between them.

$n =
 $session->countElements("Router::gw1",  "ComposedOf");

'::instance'

This format uses two parameters, where the first contains the class and the second contains the name of the instance.

$n = $session->countElements( "::gw1", "ComposedOf" );

$class, $instance

This format uses two parameters, where the first contains the class and the second contains the name of the instance.

$n = 
 $session->countElements( "Router",
    "gw1", "ComposedOf" );

undef, $instance

This format uses two parameters. The first parameter contains the Perl undef value, to indicate that it is unknown. This causes the API to perform a query to determine that name of the object's class. This syntax can only be used to refer to existing objects.

$n = $session->countElements(undef, "gw1", "ComposedOf");

InCharge::object reference

This format is used whenever an object name is required. It is also possible to pass an InCharge::object reference.

$obj = $session->object( "Router::gw1" );
$n = $session->countElements( $obj,  "ComposedOf" );