CPAN::Mini::Inject::REST::Controller::API::Version1_0
Catalyst Controller.
/api/1.0/repository/File-Name-1.00.tar.gz
Downloads a file from the repository. Returns status 404 if the file could not be found.
Adds a file to the repository and injects it into the mirror. If the file can be added, status 201 (Created) is returned with details of which modules the file provides.
{ "provides": [ { "version": "0.04", "module": "hello" } ], "file": "hello-0.04.tar.gz" }
If the file cannot be added to the repository, status 400 is returned with an appropriate error message:
{ "error": "File hello-0.03.tar.gz is already in the repository" }
Note that if a file already exists in the repository, it cannot be added again.
/api/1.0/mirror/File-Name-1.0.tar.gz
Returns a list of modules provided by the file, and the CPAN-style path to download the file from the mirror (e.g. L/LO/LOCAL/File-Name-1.0.tar.gz).
{ "provides": { "CPAN::Mini::Inject::Config": { "version":"0.28" }, "CPAN::Mini::Inject": { "version":"0.28" } }, "file": "CPAN-Mini-Inject-0.28.tar.gz", "path": "L/LO/LOCAL/CPAN-Mini-Inject-0.28.tar.gz" }
If the file has not been added to the mirror, status 404 is returned with an appropriate error message:
{ "error": "File My-Module-1.04.tar.gz does not exist" }
Returns a list of all files that have been added to the mirror.
{ "files": [ "CPAN-Mini-Inject-0.28.tar.gz", "My-Private-Module-0.02.tar.gz" ] }
If no files have been added, status 204 (No Content) is returned.
/api/1.0/dist/Distribution-Name
Returns a list of files, from both the repository and the mirror, which match the specified distibution name.
{ "repository": [ "hello-0.01.tar.gz", "hello-0.02.tar.gz", "hello-0.03.tar.gz" ], "mirror": [ "hello-0.02.tar.gz" ] }
If the distribution cannot be found, status 404 is returned with an appropriate error message:
{ "error": "Cannot find dist My-Private-Module" }
/api/1.0/all_dists
Returns a list of all distributions that have been added to the mirror.
{ "dists": [ "CPAN-Mini-Inject", "My-Private-Module" ] }
If no distributions have been added, status 204 (No Content) is returned.
Jon Allen (JJ) <jj@jonallen.info>
This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.
To install CPAN::Mini::Inject::REST, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CPAN::Mini::Inject::REST
CPAN shell
perl -MCPAN -e shell install CPAN::Mini::Inject::REST
For more information on module installation, please visit the detailed CPAN module installation guide.