Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcusramberg/mojo-cloudflare
Talk with the cloudflare API using Mojo::UserAgent
https://github.com/marcusramberg/mojo-cloudflare
Last synced: 17 days ago
JSON representation
Talk with the cloudflare API using Mojo::UserAgent
- Host: GitHub
- URL: https://github.com/marcusramberg/mojo-cloudflare
- Owner: marcusramberg
- Created: 2014-10-04T07:37:08.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-05T08:37:40.000Z (over 10 years ago)
- Last Synced: 2024-12-21T11:51:28.496Z (26 days ago)
- Size: 109 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- Changelog: Changes
Awesome Lists containing this project
README
NAME
Mojo::Cloudflare - Talk with the Cloudflare API using Mojo::UserAgentVERSION
0.03DESCRIPTION
Mojo::Cloudflare is an (async) client for the CloudFlare API
.SYNOPSIS
use Mojo::Cloudflare;
my $cf = Mojo::Cloudflare->new(
email => '[email protected]',
key => '8afbe6dea02407989af4dd4c97bb6e25',
zone => 'example.com',
);# add a record
$cf->record({
content => 'mojolicio.us',
name => 'direct.example.pm',
type => 'CNAME',
})->save;# retrieve and update records
for my $record ($cf->records->all) {
warn $record->name;
$record->ttl(1)->save; # update a record
}# update a record
$cf->record({
content => 'mojolicio.us',
id => 'some_id_fom_cloudflare', # <-- cause update instead of insert
name => 'direct.example.pm',
type => 'CNAME',
})->save;ATTRIBUTES
api_url
Holds the endpoint where we communicate. Default is
.
$str = $self->email;
$self = $self->email($str);The e-mail address associated with the API key.
key
$str = $self->key;
$self = $self->key($str);This is the API key made available on your Account page.
zone
$str = $self->zone;
$self = $self->zone($str);The zone (domain) to act on.
METHODS
add_record
Will be deprecated. Use "save" in Mojo::Cloudflare::Record instead.delete_record
Will be deprecated. Use "delete" in Mojo::Cloudflare::Record instead.edit_record
Will be deprecated. Use "save" in Mojo::Cloudflare::Record instead.record
$record_obj = $self->record(\%record_construction_args);Returns a Mojo::Cloudflare::Record object.
records
$records_obj = $self->records($offset);
$self = $self->records($offset, sub {
my($self, $err, $records_obj) = @_;
});Used to retrieve Mojo::Cloudflare::Record objects. The return value will
be a Mojo::Cloudflare::RecordSet object.$offset is optional and defaults to "all", which will retrieve all the
DNS records instead of the limit of 180 set by CloudFlare.COPYRIGHT AND LICENSE
Copyright (C) 2014, Jan Henning ThorsenThis program is free software, you can redistribute it and/or modify it
under the terms of the Artistic License version 2.0.AUTHOR
Jan Henning Thorsen - "[email protected]"