ARS-Simple

 view release on metacpan or  search on metacpan

lib/ARS/Simple.pm  view on Meta::CPAN

1; # End of ARS::Simple


__END__

=head1 NAME

ARS::Simple - A simplified interface to Remedy ARSystem

=head1 SYNOPSIS

A simple interface to Remedy ARSystem utilising the ARSperl API interface.
Keeps your code more readable and by use of the cache avoids your credentials
being spread through all your scripts.

 use ARS::Simple;

 my $ar = ARS::Simple->new({
     server   => 'my_remedy_server',
     user     => 'admin',
     password => 'admin',
     });

 ### Get the Entry-ID/Request-ID for all User's with Login starting with 'g'
 # Here $eid is any array reference of entry-id/request-id values
 my $data = $ar->get_list({
     form  => 'User',
     query => qq{'Login' LIKE "g%"},
     });
 print Data::Dumper->Dump([$data], ['data']), "\n";
 # Resulting data dump:
 # $data = {
 #   'eids' => [
 #     '000000000004467',
 #     '000000000004469',
 #     '000000000004470',
 #   ],
 #   'numMatches' => 3
 #};

 ### Get data from a form, based on a query (as you would use in the User Tool)
 my $form  = 'User';
 my $entryListLabel = $ar->get_data_by_label({
     form  => $form,
     query => qq{'Login Name' LIKE "ge%"},  # Login Name = FID 101
     lfid  => { 'LoginName', 101, 'FullName', 8, 'LicenseType', 109, },
     });
 print Data::Dumper->Dump([$entryListLabel], ['entryListLabel']), "\n";
 # Resulting data dump:
 # $entryListLabel = {
 #  '000000000014467' => {
 #    'FullName' => 'Geoff Batty',
 #    'LicenseType' => 0,
 #    'LoginName' => 'gbatty'
 #  },
 #  '000000000014469' => {
 #    'FullName' => 'Greg George',
 #    'LicenseType' => 2,
 #    'LoginName' => 'gregg'
 #  },
 #  '000000000024470' => {
 #    'FullName' => 'Gabrielle Gustoff',
 #    'LicenseType' => 0,
 #    'LoginName' => 'ggustoff'
 #  },

 # Update a record, change the Login Name to 'greg'
 my %lvp = ( LoginName => 'greg' );
 $ar->update_record({
     eid  => '000000000014469',
     form => 'User',
     lvp  => \%lvp,
     lfid => { 'LoginName', 101, 'FullName', 8, 'LicenseType', 109, },
     });

=head1 VERSION

Version 0.01

=head2 FEATURES

=over 4

=item *

Provides obfuscated storage for default user and password so they are
not scattered throuhout all your scripts

=item *

Provide a perlish interface to ARSperl which makes your code
more readable

=back

=head1 METHODS

=head2 new

Constructor for ARS::Simple.  There are three required arguments:

=over 4

=item server

The name (or possibly IP Address) of the Remedy ARSystem server you
wish to connect to.

=item user

The user you wish to connect as (this is often a user with administrator
privilages).  Note that while this is a required argument, it may be supplied
via the configuration file to avoid lots of scripts with the user (and password)
in them (less to change, not on display so safer).

=item password

The password to the user you wish to connect as.  This may come from the configuration
file if set.

=back



( run in 0.475 second using v1.01-cache-2.11-cpan-df04353d9ac )