Stefan Adams


Mojo::CloudCheckr - A simple interface to the CloudCheckr API


  use Mojo::CloudCheckr;

  my $cc = Mojo::CloudCheckr->new(access_key => '...');
  say $cc->get(account => 'get_accounts_v2')->result->json('/accounts_and_users/0/account_name');


A simple interface to the CloudCheckr API.

Currently only a single get method is available, and it offers no data validation or error handling. No built-in support for paging. No support for POST queries (GET only). Pull requests welcome!

The API user guide is available at The API reference guide is available at The API admin reference guide is available at The API inventory guide is available at

So what does this module do? It makes building the API URL easier and includes the access key on all requests. It then removes the access key from the request message of the returned transaction. So, not much. But it does offer a little bit of sugar, and, hopefully eventually, some data validation, error handling, built-in support for paging, and POST queries.


Mojo::CloudCheckr implements the following attributes.


  my $access_key = $cc->access_key;
  $cc            = $cc->access_key($key);

The access_key for your CloudCheckr API. Learn more at


  my $base_url = $cc->base_url;
  $cc          = $cc->base_url($url);

The base URL for the CloudCheckr API, defaults to


  my $format = $cc->format;
  $cc        = $cc->format($format);

The response format from the CloudCheckr API, defaults to json.

  # Set the format to XML


Mojo::CloudCheckr inherits all methods from Mojo::Base and implements the following new ones.


  # Blocking
  my $tx = $cc->get(controller => 'action', %args);
  say $tx->result->body;
  # Non-blocking
  $cc->get(controller => 'action', %args => sub {
    my ($ua, $tx) = @_;
    say $tx->result->body;

All CloudCheckr API calls have a controller (or category) and an action (or task). Each of these is required for get and is defined in the API reference docs. If a callback is provided, it will process the request non- blocking. The access_key parameter will be removed from the request in the returned transaction (so that the arguments that were used to generate the response can be dumped without the need to hide this private key.)