WWW::Codeguard::User - Perl interface to interact with the Codeguard API as a 'user'
This module provides you with an perl interface to interact with the Codeguard API and perform the 'user' level calls.
use WWW::Codeguard::User; my $api = WWW::Codeguard::User->new( $api_url, { api_secret => $user_api_secret, api_key => $user_api_key, access_secret => $user_access_secret, access_token => $user_access_token, verify_hostname => 1, } );
Each of these map to a call on Codeguard's User API.
This allows you to create a website resource under your User account. Params should be a hashref that contains the following attributes:
Required: The request will not succeed without these attributes.
url hostname account password or key provider
Optional:
dir_path port
This allows you to list the website resources under your User account. Params should be a hashref that contains the following attributes:
Required:
None
This allows you to list the exclusion rules for a website resource under your User account. Params should be a hashref that contains the following attributes:
website_id
This allows you to set the exclusion rules for a website resource under your User account. Params should be a hashref that contains the following attributes:
website_id exclude_rules - must be an array ref with elements specifying what paths/files to ignore. Example: [ 'access-logs/*' '*error_log*' '*stats/*' '/path/to/a/folder/*' '/path/to/a/file.txt' ]
This allows you to edit information for the specified website resource under your User account. Params should be a hashref that contains the following attributes:
url monitor_frequency account password or key dir_path hostname disabled
This allows you to delete the specified website resource under your User account. Params should be a hashref that contains the following attributes:
This allows you to enable a specified website resource under your User account. Params should be a hashref that contains the following attributes:
This allows you to disable a specified website resource under your User account. Params should be a hashref that contains the following attributes:
This allows you to create a database resource under your User account. Params should be a hashref that contains the following attributes:
server_address - MySQL Database Hostname or IP address. account - MySQL username which has access to the database_name database. password - MySQL password associated with account. Note: This parameter is only used during the create action. It is never returned by other API requests. port - MySQL server port number for use with the server_name. database_name - The name of the target database.
website_id - Numeric ID of the parent Website record. If no website_id is provided, the Database will not be associated with any website resource.
Experimental features: SSH functionality for DB backups is currently not fully functional on CodeGuard's side, and as such might not function as expected.
authentication_mode - This can be one of two values: 'direct' or 'ssh'. The direct method will attempt to open a connection using a MySQL client on the specified server and port. The ssh method will create an SSH tunnel through server_name using the server_account and server_password credentials to connect to the database on server_name. server_account - SSH username on server_address. Note: This field is only valid if the authenticationmode is ssh. Note: Required if authentication_mode is 'ssh'. server_password - SSH password associated with server_account. Note: Required if authentication_mode is 'ssh'.
This allows you to fetch all Database Records owned by the user.
This allows you to fetch information for the specified database resource under your User account. Params should be a hashref that contains the following attributes:
database_id
This allows you to edit information for the specified database resource under your User account. Params should be a hashref that contains the following attributes:
website_id server_address account password port database_name authentication_mode server_account server_password disabled
This allows you to delete the specified database resource under your User account. Params should be a hashref that contains the following attributes:
This allows you to enable a specified database resource under your User account. Params should be a hashref that contains the following attributes:
This allows you to disable a specified database resource under your User account. Params should be a hashref that contains the following attributes:
Will initiate an on-demand backup for a Website.
website_id - Id of the Website to create a backup for.
Will initiate a full restore for a Website.
website_id - Id of the Website to perform restore on. commit_id - The commit to restore the website from.
Will initiate a restore of the specified files and directories for a Website.
website_id - Id of the Website to perform the restore on. commit_id - The commit to restore files from. paths - A list of paths to restore.
Will initiate the production of a zip file which contains the entire contents of the selected backup. Upon completion a perishable link will be provided to the customer so that they can retrieve the zip file. The links expire after 1 week.
website_id - Id of the Website to download the file for. commit_id - The commit to create the zip file from.
Will initiate the production of a zip file which contains the the specified files and directories. Upon completion a perishable link will be provided to the customer so that they can retrieve the zip file. The links expire after 1 week.
website_id - Id of the Website to download the file for. commit_id - The commit to create the zip file from. paths - A list of paths to include in the archive.
List all of the backups for a Website.
website_id - Id of the Website to list the backups for.
Response includes files, directories and their associated metadata as an array of entries. Requests can be scoped to an optional path parameter.
path
website_id - Id of the Website to brose the backup of. commit_id - The commit to brwose the contents of.
path - scopes the results to this path within the backup.
List all backups of the database associated with selected website backup commit_id.
website_id - Id of the Website associated with the database to list backups for. commit_id - The website backup commit to retrieve associated database backups for.
Will initiate an on-demand backup for a Database.
website_id - Id of the Website associated with the database to create a backup for. database_id - Id of the Database to create a backup for.
Will initiate a full restore for a Database.
website_id - Id of the Website associated with the database to restore. database_id - Id of the Database to restore a backup for. commit_id - The commit to restore the database from.
List all the bacukps for a Database.
website_id - Id of the Website associated with the requested database. database_id - Id of the Database to list the backups for.
This creates a login URL that can be used to access the Codeguard Dashboard for your User account.
Basic accessor methods to retrieve the current settings
Returns the current value in $self->{api_secret}.
Returns the current value in $self->{api_key}.
Returns the current value in $self->{access_secret}.
Returns the current value in $self->{access_token}.
Rishwanth Yeddula, <ryeddula at cpan.org>
<ryeddula at cpan.org>
Please report any bugs or feature requests to bug-www-codeguard at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-Codeguard. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-www-codeguard at rt.cpan.org
You can find documentation for this module with the following perldoc commands.
perldoc WWW::Codeguard perldoc WWW::Codeguard::Partner perldoc WWW::Codeguard::User
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-Codeguard
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/WWW-Codeguard
CPAN Ratings
http://cpanratings.perl.org/d/WWW-Codeguard
Search CPAN
http://search.cpan.org/dist/WWW-Codeguard/
Thanks to Hostgator.com for funding the development of this module and providing test resources.
Copyright 2014 Rishwanth Yeddula.
This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:
http://www.perlfoundation.org/artistic_license_2_0
Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.
If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.
This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.
This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.
Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
To install WWW::Codeguard, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Codeguard
CPAN shell
perl -MCPAN -e shell install WWW::Codeguard
For more information on module installation, please visit the detailed CPAN module installation guide.