Back to index
Summary
Retrieves the count of objects specified by the provided filter.You must specify the objectType
.
This API is not supported by ectool. |
objectTypeStringrequiredThe type of object to query for. filterArrayoptionalA list of zero or more filter criteria definitions used to define objects to find. firstResultIntegeroptionalThe first result to be retrieved, numbered from 0. maxIdsIntegeroptionalThe maximum number of object IDs to return. viewNameStringoptionalThe name of the view. |
Usage
Perl
$cmdr->countObjects( "test-objectType" # objectType # optionals );
ectool
ectool countObjects \ "test-objectType" `# objectType` \ # optionals
Examples
Perl
use ElectricCommander(); my @artifactNameFilters; # Create the filter list for filtering on artifact name push (@artifactNameFilters, {"propertyName"=>"artifactName", "operator"=>"contains", "operand1"=>"groupId:installer-windows", ); my $cmdr = new ElectricCommander(); # Perform the countObjects query my $reference=$cmdr\->countObjects("artifactVersion", { filter=> {operator=>"and", filter=>[ { propertyName=>"modifyTime" , operator=>"greaterOrEqual",# Give me all dates after or equal arbinary date "operand1"=>"2014-03-25T14:48:55.286Z", } , { operator => 'or', # apply 'or' for the filters in the list filter => \@artifactNameFilter } ] } }); my $jobs=$reference->find('\/response\/count'); print $jobs;