GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NET::STF::CLIENT (3)

.ds Aq ’

NAME

Net::STF::Client - STF Client

CONTENTS

SYNOPSIS



    use Net::STF::Client;

    my $client = Net::STF::Client->new(
        url => "http://stf.example.com",
        repl_count => 3,
    );

    # If you want to use Basic Auth:
    # my $client = Net::STF::Client->new(
    #     ... other params ...
    #     username => ....,
    #     password => ....,
    # );

    # direct CRUD from the client (fastest if you have the URL)
    $object = $client->put_object( $url, $content, \%opts );
    $object = $client->get_object( $url, \%opts );
    $bool   = $client->delete_object( $url, \%opts );
    $bool   = $client->delete_bucket( $url, \%opts );

    # bucket-oriented interface
    my $bucket = $client->create_bucket( $bucket_name );
    $object = $bucket->put_object( $key, $content, \%opts );
    $object = $bucket->get_object( $key, \%opts );
    $bool   = $bucket->del_object( $key, \%opts );
    $bool   = $bucket->delete( $recursive );

    # object data
    $object->url;
    $object->key;
    $object->content;



DESCRIPTION

Net::STF::Client implements the STF protocol to talk to STF servers.

METHODS

CW$class->new(%args)

url The base URL for your STF server. Required if you’re going to use the bucket-oriented interface.
repl_count The default number of replicas to request when creating new objects. You may override this setting during a call to put_object(), but if unspecified, this value will be used as default.

If you don’t specify this value in the constructor call, default value of 3 will be used.

username Username used for basic authentication. Leave blank if your server does not use basic authentiation.
password Password used for basic authentication. Leave blank if your server does not use basic authentiation.
agent_name The user agent name used when accessing the STF server. If unspecified, Net::STF::Client/$VERSION will be used as default.
furl Furl::HTTP object to talk to the STF server. You only need to provide this if you want to customize the behavior of Furl::HTTP object, which is pretty rare.

CW$object = CW$client->put_object( CW$url, CW$content, \%opts );

$content (Any) The object value to be stored. Can be anything that Furl::HTTP can handle when making a POST request.
$url (Str) The URL to put your object.

If the url parameter was supplied, you may specify a URL fragment containing the$bucket_name/$object_name

So these are equivalent:



    my $stf_base    = "http://stf.mycompany.com/";
    my $bucket_name = "mybucket";
    my $object_name = "path/to/object.dat";

    # Complete URL
    {
        my $client = Net::STF::Client->new();
        $client->put_object( "$stf_base/$bucket_name/$object_name", ... );
    }

    # URL fragment
    {
        my $client = Net::STF::Client->new( url => $stf_base );
        $client->put_object( "$bucket_name/$object_name", ... );
    }



%opts
repl_count (Int) Specify if you want to override the default X-STF-Replication-Count value:



    # Make a lot of replicas for this object!
    $client->put_object( $url, $content, { repl_count => 30 } );

    # Use whatever default in $client
    $client->put_object( $url, $content );



consistency (Int) Specify if you want to set the X-STF-Consistency value.
headers Appended to headers sent by Furl::HTTP
write_file Passed to Furl::HTTP
write_code Passed to Furl::HTTP

CW$object = CW$client->get_object( CW$url, \%opts );

url (Str) See docs for put_object() for details
%opts
headers Appended to headers sent by Furl::HTTP
write_file Passed to Furl::HTTP
write_code Passed to Furl::HTTP

CW$bool = CW$client->delete_object( CW$url, \%opts );

url (Str) See docs for put_object() for details
%opts
headers Appended to headers sent by Furl::HTTP
write_file Passed to Furl::HTTP
write_code Passed to Furl::HTTP

CW$bool = CW$client->delete_bucket( CW$url, \%opts );

url (Str) See docs for put_object() for details
%opts
headers Appended to headers sent by Furl::HTTP
write_file Passed to Furl::HTTP
write_code Passed to Furl::HTTP

SEE ALSO

Net::STF::Object

Net::STF::Bucket

AUTHOR

Daisuke Maki <daisuke@endeworks.jp>

COPYRIGHT AND LICENSE

Copyright (C) 2011 by Daisuke Maki

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NET::STF::CLIENT (3) 2012-08-23

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.