NAME
Net::APP - Critical Path Account Provisioning Protocol
SYNOPSIS
use Net::APP;
#constructor
$app = new Net::APP ( 'host:port',
User => $user,
Domain => $domain,
Password => $password,
Timeout => 60,
Debug => 1,
) or die $@;
#commands
$app->ver( 'ver' => $Net::APP::APP_VERSION );
$app->login ( User => $user,
Domain => $domain,
Password => $password,
);
$app->create_domain ( Domain => $domain );
$app->delete_domain ( Domain => $domain );
#etc. (see the Account Provisioning Protocol Developer's Guide, section 3.3)
#command status
$message = $app->message;
$code = $app->code;
$bool = $app->ok();
#destructor
$app->close();
DESCRIPTION
This module implements a client interface to Critical Path's Account Provisioning Protocol, enabling a perl application to talk to APP servers. This documentation assumes that you are familiar with the APP protocol documented in the Account Provisioning Protocol Developer's Guide.
A new Net::APP object must be created with the new method. Once this has been done, all APP commands are accessed via method calls on the object.
METHODS
- new ( HOST:PORT [ , OPTIONS ] )
-
This is the constructor for a new Net::APP object.
HOST
andPORT
specify the host and port to connect to in cleartext. Typically this connection is proxied via Safe Passage Secure Tunnel to Critical Path.This method will connect to the APP server and execute the ver method.
OPTIONS are passed in a hash like fastion, using key and value pairs. Possible options are:
Timeout - Set a timeout value (defaults to 120)
Debug - Enable debugging information (see the debug method in Net::Cmd)
User, Domain, Password - if these exist, the new method will also execute the login method automatically.
If the constructor fails undef will be returned and an error message will be in $@.
- ver
- login
- create_domain
- delete_domain
- etc.
-
See the Account Provisioning Protocol Developer's Guide for details. Commands need not be in upper case, and options are passed in a hash-like fashion, as a list of key-value pairs.
All options return a reference to a list containing the lines of the reponse, or undef upon failure. The first line is parsed for the status code and message. You can check the status code and message using the normal Net::Cmd message, code, ok, and status methods.
Only the get_num_domain_mailboxes, get_mailbox_availability and get_mailbox_status methods currently return any additional response information. No attempt is (yet) made to parse this data.
- message
-
Returns the text message returned from the last command.
- code
-
Returns the response code from the last command (see the Account Provisioning Protcol Developer's Guide, chapter 4). The code `-1' is used to represent unparsable output from the APP server, in which case the entire first line of the response is returned by the messsage method.
- ok
-
Returns true if the last code was an acceptable response.
- status
-
Since the APP protocol has no concept of a "most significant digit" (see "status" in Net::Cmd), this is a noisy synonym for code.
INTERNAL METHODS
These methods are not intended to be called by the user.
- _app_command ( COMMAND [ , OPTIONS ] )
-
Sends COMMAND, encoded as per the Account Provisioning Protocol Developer's Guide, section 3.2. OPTIONS are passed in a hash like fashion, using key and value pairs.
- _app_response
-
Gets a response from the server. Returns a reference to a list containing the lines, or undef upon failure. You can check the status code and message using the normal Net::Cmd message, code, ok, and status methods.
INTERNAL SUBROUTINES
These subroutines are not intended to be called by the user.
AUTHOR
Ivan Kohler <ivan-netapp@sisd.com>.
This module is not sponsored or endorsed by Critical Path.
COPYRIGHT
Copyright (c) 1999 Ivan Kohler. Copyright (c) 1999 Silicon Interactive Software Design. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
VERSION
$Id: APP.pm,v 1.1.1.1 1999/06/21 10:11:11 ivan Exp $
This module currently implements APP v2.1, as documented in the Account Provisioning Protocol Developers Guide v2.1.
BUGS
The Account Provisioning Protocol Developer's Guide is not publicly available.
It appears that Safe Passage Secure Tunnel establishes a standard SSL connection. It should be possible to use Net::SSLeay and connect to the APP server directly.
Sending values with consecutive double quote characters is untested.
The get_num_domain_mailboxes, get_mailbox_availability and get_mailbox_status methods currently return response information. No attempt is (yet) made to parse this data.
SEE ALSO
Critical Path <http://www.cp.net/>, Safe Passage Secure Tunnel <http://www.c2.net/products/spst>, Net::SSLeay, Net::Cmd, perl(1).
HISTORY
$Log: APP.pm,v $ Revision 1.1.1.1 1999/06/21 10:11:11 ivan new project