The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

WebService::Ooyala - Perl interface to Ooyala's API, currently only read operations (GET requests) are supported

Support for create, update, and delete (PUT, POST, DELETE) operations will be added in future releases.

VERSION

Version 0.03

SYNOPSIS

    my $ooyala = WebService::Ooyala->new({ api_key => $api_key, secret_key => $secret_key });

    # Grab all video assets (or at least the first page)
    my $data = $ooyala->get("assets");

    foreach my $video(@{$data->{items}}) {
        print "$video->{embed_code} $video->{name}\n";
    }

    # Get a particular video based on embed_code

    my $video = $data->get("assets/$embed_code");

SUBROUTINES/METHODS

new

Create a new WebService::Ooyala object with hashref of parameters

    my $ooyala = WebService::Ooyala->new( { api_key => $api_key, secret_key => $secret_key } );

Accepts the following parmeters

  • api_key

    Required parameter. Ooyala api_key

  • secret_key

    Required parameter. Ooyala secret_key

  • base_url

    Optional parameter -- defaults to "api.ooyala.com"

  • cache_base_url

    Optional parameter - defaults to "cdn.api.ooyala.com" for GET requests

  • expiration

    Optional parametter for time to expire url for getting results from API with this url -- defaults to 15 (seconds)

  • api_version

    Optional parameter - version of API being called -- defaults to "v2", but this module also works for "v3" API requests by changing this parameter

  • agent

    Agent that acts like LWP::UserAgent used for making requests -- module defaults to creating its own if none is provide

get

$ooyala->get($path, $params)

$ooyala->get("assets");

$ooyala->get("assets", { limit => 5 })

$ooyala->get("assets", { limit => 5, where => "labels INCLUDES '$label'" })

Accepts the following parameters:

  • path - path of api request (after version part of api request)

  • params - hashref of query parameters to be sent as part of API request

-

expires

Calculates expiration time

$ooyala->expires()

send_request

$ooyala->send_request($http_method, $relative_path, $body, $params);

$ooyala->send_request("GET", "assets", "", {})

Handles sending request to ooyala's API, suggest using simpler

$ooyala->get(..) (which calls this) from your application

generate_signature

    Generates signature needed to send API request based on payload

    $ooyala->($http_method, $path, $params, $body);

build_path

    Builds path up with parameters

    $ooyala->build_path($path, $params(

build_path_with_authentication_params

    Builds path with authentication and expiration parameters

    $ooyala->build_path_with_authentication_params($http_method, $path,
    $params, $body);

get_api_key

    Gets current ooyala api_key

    my $api_key = $ooylaa->get_api_key();

set_api_key

    Sets current ooyala api_key

    $ooylaa->set_api_key($api_key);

get_secret_key

    Gets current ooyala secret_key

    my $secret_key = $ooyala->get_secret_key()

set_secret_key

    Sets current ooyala secret_key

    $ooyala->set_secret_key($secret_key)

get_base_url

    Gets current base_url

    my $base_url = $ooyala->get_base_url();

set_base_url

    Sets current base_url

    $ooyala->set_base_url($base_url)

get_cache_base_url

    Gets current cache_base_url

    my $cache_base_url = $ooyala->get_cache_base_url();

set_cache_base_url

    Sets current cache_base_url

    $ooyala->set_cache_base_url($cache_base_url)

get_expiration

    Gets current expiration in seconds

    my $expiration = $ooyala->get_expiration();

set_expiration

    Sets current expiration in seconds

    $ooyala->set_expiration($expiration);

del_expiration

    Sets current expiration time to 0

    $ooyala->del_expiration()

SEE ALSO

Code here is a port of Ooyala's Python SDK

Ooyala API Documentation

ACKNOWLEDGEMENTS

Thanks to Slashdot for support in release of this module -- early code for this was developed as part of the Slashdot code base

AUTHOR

Tim Vroom, <vroom at blockstackers.com>

BUGS

Please report any bugs or feature requests to bug-webservice-ooyala at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WebService-Ooyala. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc WebService::Ooyala

You can also look for information at:

LICENSE AND COPYRIGHT

Copyright 2016 Tim Vroom.

This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:

http://www.perlfoundation.org/artistic_license_2_0

Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.

If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.

This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.

This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.

Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.