Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

client for the CPAN::Metabase

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 t
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Changes
Octocat-spinner-32 META.json
Octocat-spinner-32 README.PATCHING
Octocat-spinner-32 README.pod
Octocat-spinner-32 dist.ini
Octocat-spinner-32 perlcritic.rc
README.pod

NAME

Metabase::Client::Simple - a client that submits to Metabase servers

VERSION

version 0.009

SYNOPSIS

  use Metabase::Client::Simple;
  use Metabase::User::Profile;
  use Metabase::User::Secret;

  my $profile = Metabase::User::Profile->load('user.profile.json');
  my $secret  = Metabase::User::Secret ->load('user.secret.json' );

  my $client = Metabase::Client::Simple->new({
    profile => $profile,
    secret  => $secret,
    uri     => 'http://metabase.example.com/',
  });

  my $fact = generate_metabase_fact;

  $client->submit_fact($fact);

DESCRIPTION

Metabase::Client::Simple provides is extremely simple, lightweight library for submitting facts to a Metabase web server.

METHODS

new

  my $client = Metabase::Client::Simple->new(\%arg)

This is the object constructor.

Valid arguments are:

  profile - a Metabase::User::Profile object
  secret  - a Metabase::User::Secret object
  uri     - the root URI for the metabase server

If you use a uri argument with the 'https' scheme, you must have LWP::Protocol::https installed.

submit_fact

  $client->submit_fact($fact);

This method will submit a Metabase::Fact object to the client's server. On success, it will return a true value. On failure, it will raise an exception.

guid_exists

  $client->guid_exists('2f8519c6-24cf-11df-90b1-0018f34ec37c');

This method will check whether the given GUID is found on the metabase server. The GUID must be in lower-case, string form. It will return true or false. Note that a server error will also result in a false value.

register

  $client->register;

This method will submit the user credentials to the metabase server. It will be called automatically by submit_fact if necessary. You generally won't need to use it. On success, it will return a true value. On failure, it will raise an exception.

SUPPORT

Bugs / Feature Requests

Please report any bugs or feature requests through the issue tracker at http://rt.cpan.org/Public/Dist/Display.html?Name=Metabase-Client-Simple. You will be notified automatically of any progress on your issue.

Source Code

This is open source software. The code repository is available for public review and contribution under the terms of the license.

https://github.com/dagolden/metabase-client-simple

  git clone https://github.com/dagolden/metabase-client-simple.git

AUTHORS

  • David Golden <dagolden@cpan.org>
  • Ricardo Signes <rjbs@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2012 by David Golden.

This is free software, licensed under:

  The Apache License, Version 2.0, January 2004
Something went wrong with that request. Please try again.