NAME

CloudFlare::Client - Object Orientated Interface to Cloudflare client API

VERSION

version 0.02

SYNOPSIS

Provides an object orientated interface to the CloudFlare client API

use CloudFlare::Client;

my $api = new CloudFlare::Client(
    user   => $CF_USER,
    apikey => $CF_KEY);
$api->stats;
...

Please see the documentation at https://www.cloudflare.com/docs/client-api.html for information the CloudFlare client API and its arguments. Optional arguments are passed in as a hash with keys as given in the docs

ATTRIBUTES

_user

CF user name (email) used to access the API. Set using the user argument to the constructor. Readonly.

_key

CF API key, set using the apikey argument to the constructor. Readonly

_ua

UserAgent object used to make API calls, set internally. Readonly

METHODS

new

Construct a new CloudFlare::Client API object

my $api = new CloudFlare::Client(
    user   => $CF_USER,
    apikey => $CF_KEY);

stats

$api->stats($zone, $interval)

zoneLoadMulti

$api->zoneLoadMulti

recLoadAll

$api->recLoadAll($zone);

zoneCheck

$api->zoneCheck(@zones);

zoneIps

$api->zoneIps($zone, %optionalArgs);

ipLkup

$api->ipLkup($ip)

zoneSettings

$api->zoneSettings($zone)

secLvl

$api->secLvl($zone,$securityLvl)

cacheLvl

$api->cacheLvl($zone, $cacheLevel)

devMode

$api->devMode($zone, $value)

fpurgeTs

$api->fpurgeTs($zone, $value)

zoneFilePurge

$api->zoneFilePurge($zone, $url)

zoneGrab

$api->zoneGrab($zoneId)

wl

$api->wl($ip)

ban

$api->ban($ip)

nul

$api->nul($ip)

ipv46

$api->ipv46($zone, $value)

async

$api->async($zone, $value)

minify

$api->minify($zone, $value)

mirage2

$api->mirage2($zone, $value)

recNew

$api->recNew($zone, $type, $name
             $content, $ttl, %optionalArgs)

recEdit

$api->recEdit($zone, $type, $recordId, $name
              $content, $ttl, %optionalArgs)

recDelete

$api->recDelete($zone, $recordId)

_apiCall

Makes a call through to the CF API, via HTTPS POST

$api->_makeCall($action, %args)

If the HTTPS connection fails this can throw a CloudFlare::Client::Exception::Connection. If the CF API itself gives an error then it can throw a CloudFlare::Client::Exception::Upstream

_wlBanNul

Used to aggregrate a number of CF calls with a single signature into one function

BUGS

Please report any bugs or feature requests to bug-cloudflare-client at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CloudFlare-Client. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc CloudFlare::Client

You can also look for information at:

ACKNOWLEDGEMENTS

Thanks to CloudFlare providing an awesome free service with an API.

AUTHOR

Peter Roberts <me+dev@peter-r.co.uk>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2014 by Peter Roberts.

This is free software, licensed under:

The MIT (X11) License