Why not adopt me?
NAME
Net::Fluidinfo - A Perl interface to Fluidinfo
SYNOPSIS
use Net::Fluidinfo;
# Predefined Fluidinfo client for playing around, points
# to the sandbox with user test/test
$fin = Net::Fluidinfo->new_for_testing;
$fin = Net::Fluidinfo->new_for_testing(trace_http => 1);
# Fluidinfo client pointing to production
$fin = Net::Fluidinfo->new(username => 'username', password => 'password');
# Fluidinfo taking credentials from environment variables
# FLUIDINFO_USERNAME and FLUIDINFO_PASSWORD
$fin = Net::Fluidinfo->new;
# Content-MD5 headers with checksums for requests with payload
$fin = Net::Fluidinfo->new(md5 => 1)
# Resource getters
$object = $fin->get_object_by_id($id, about => 1);
$object = $fin->get_object_by_about($about);
$ns = $fin->get_namespace($path, description => 1);
$tag = $fin->get_tag($path, description => 1);
$permission = $fin->get_permission($category, $path_or_has_path, $action);
$user = $fin->get_user($username);
# Object search
@ids = $fin->search("has fxn/rating");
DESCRIPTION
Net::Fluidinfo
provides an interface to the Fluidinfo API.
The documentation of Net::Fluidinfo does not explain Fluidinfo, though there are links to relevant pages in the documentation of each class.
If you want to get familiar with Fluidinfo please check these pages:
- Fluidinfo high-level description
- Fluidinfo API documentation
- Fluidinfo API specification
- Fluidinfo Essence blog posts
USAGE
Class Methods
- Net::Fluidinfo->new(%attrs)
-
Returns an object for communicating with Fluidinfo.
This is a wrapper around LWP::UserAgent and does not validate credentials in the very constructor. If they are wrong requests will fail when performed.
Attributes and options are:
- username
-
Your username in Fluidinfo. If not present uses the value of the environment variable FLUIDINFO_USERNAME.
- password
-
Your password in Fluidinfo. If not present uses the value of the environment variable FLUIDINFO_PASSWORD.
- protocol
-
Either 'HTTP' or 'HTTPS'. Defaults to 'HTTP'.
- host
-
The Fluidinfo host. Defaults to fluiddb.fluidinfo.com.
- md5
-
If this flag is true requests with payload get a Content-MD5 header with a checksum.
- trace_http_requests
-
A flag, logs all HTTP requests if true.
- trace_http_responses
-
A flag, logs all HTTP responses if true.
- trace_http
-
A flag, logs all HTTP requests and responses if true. (Shorthand for enabling the two above.)
- Net::Fluidinfo->new_for_testing
-
Returns a
Net::Fluidinfo
instance pointing to the sandbox with "test"/"test". The host of the sandbox can be checked in the package variable$Net::Fluidinfo::SANDBOX_HOST
.
Instance Methods
- $fin->username
- $fin->username($username)
-
Gets/sets the username.
- $fin->password
- $fin->password($password)
-
Gets/sets the password.
- $fin->protocol
- $fin->protocol($protocol)
-
Gets/sets the protocol, either 'HTTP' or 'HTTPS'.
- $fin->ua
-
Returns the instance of LWP::UserAgent used to communicate with Fluidinfo.
- $fin->user
-
Returns the user on behalf of whom fin is doing calls. This attribute is lazy loaded.
- $fin->get_object_by_id
-
Convenience shortcut for
Net::Fluidinfo::Object::get_by_id
, see Net::Fluidinfo::Object. - $fin->get_object_by_about
-
Convenience shortcut for
Net::Fluidinfo::Object::get_by_about
, see Net::Fluidinfo::Object. - $fin->search
-
Convenience shortcut for
Net::Fluidinfo::Object::search
, see Net::Fluidinfo::Object. - $fin->get_namespace
-
Convenience shortcut for
Net::Fluidinfo::Namespace::get
, see Net::Fluidinfo::Namespace. - $fin->get_tag
-
Convenience shortcut for
Net::Fluidinfo::Tag::get
, see Net::Fluidinfo::Tag. - $fin->get_permission
-
Convenience shortcut for
Net::Fluidinfo::Permission::get
, see Net::Fluidinfo::Permission. - $fin->get_user
-
Convenience shortcut for
Net::Fluidinfo::User::get
, see Net::Fluidinfo::User.
AUTHOR
Xavier Noria (FXN), <fxn@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2009-2012 Xavier Noria
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 254:
You forgot a '=back' before '=head1'