The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WWW::PAUSE::Simple - An API for PAUSE

VERSION

This document describes version 0.03 of WWW::PAUSE::Simple (from Perl distribution WWW-PAUSE-Simple), released on 2015-02-19.

SYNOPSIS

DESCRIPTION

STATUS: Experimental.

This module provides several API functions for performing common tasks on PAUSE. It comes with a CLI script pause.

FUNCTIONS

delete_files(%args) -> [status, msg, result, meta]

Delete files.

When a file is deleted, it is not immediately deleted but has scheduled_for_deletion status for 72 hours, then deleted. During that time, the file can be undeleted.

Arguments ('*' denotes required arguments):

  • all => bool

    Apply to all files.

  • file => array[str]

    File name.

  • password* => str

    PAUSE password.

  • username* => str

    PAUSE ID.

Returns an enveloped result (an array).

First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (result) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.

Return value: (any)

list_files(%args) -> [status, msg, result, meta]

List files on your PAUSE account.

Arguments ('*' denotes required arguments):

  • del => bool

    Only list files which are scheduled for deletion.

  • detail => bool

    Whether to return detailed records.

  • password* => str

    PAUSE password.

  • query => array[str]

    Filter result by keywords/string.

  • username* => str

    PAUSE ID.

Returns an enveloped result (an array).

First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (result) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.

Return value: (any)

reindex_files(%args) -> [status, msg, result, meta]

Force reindexing.

Arguments ('*' denotes required arguments):

  • all => bool

    Apply to all files.

  • file => array[str]

    File name.

  • password* => str

    PAUSE password.

  • username* => str

    PAUSE ID.

Returns an enveloped result (an array).

First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (result) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.

Return value: (any)

set_account_info(%args) -> [status, msg, result, meta]

Arguments ('*' denotes required arguments):

  • password* => str

    PAUSE password.

  • username* => str

    PAUSE ID.

Returns an enveloped result (an array).

First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (result) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.

Return value: (any)

set_password(%args) -> [status, msg, result, meta]

Arguments ('*' denotes required arguments):

  • password* => str

    PAUSE password.

  • username* => str

    PAUSE ID.

Returns an enveloped result (an array).

First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (result) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.

Return value: (any)

undelete_files(%args) -> [status, msg, result, meta]

Undelete files.

When a file is deleted, it is not immediately deleted but has scheduled_for_deletion status for 72 hours, then deleted. During that time, the file can be undeleted.

Arguments ('*' denotes required arguments):

  • all => bool

    Apply to all files.

  • file => array[str]

    File name.

  • password* => str

    PAUSE password.

  • username* => str

    PAUSE ID.

Returns an enveloped result (an array).

First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (result) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.

Return value: (any)

upload_file(%args) -> [status, msg, result, meta]

Upload a file to your PAUSE account.

Arguments ('*' denotes required arguments):

  • file* => str

    Path to file to upload.

  • password* => str

    PAUSE password.

  • subdir => str (default: "")

    Subdirectory to put the file into.

  • username* => str

    PAUSE ID.

Returns an enveloped result (an array).

First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (result) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.

Return value: (any)

SEE ALSO

CPAN::Uploader which also does uploading from CLI.

WWW::PAUSE::CleanUpHomeDir which can clean old releases from your PAUSE account (but no CLI). A similar subcommand will be added to pause (e.g. pause clean), which will provide an option to specify the number of old releases to keep.

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/WWW-PAUSE-Simple.

SOURCE

Source repository is at https://github.com/perlancar/perl-WWW-PAUSE-Simple.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=WWW-PAUSE-Simple

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.