Giter Club home page Giter Club logo

app-cpanel's Introduction

NAME

App::cpanel - CLI for cPanel UAPI and API 2

PROJECT STATUS

CPAN version

SYNOPSIS

$ cpanel uapi Notifications get_notifications_count
$ cpanel uapi ResourceUsage get_usages
$ cpanel uapi Fileman list_files dir=public_html
$ cpanel uapi Fileman get_file_content dir=public_html file=index.html
$ cpanel download public_html/index.html
$ cpanel api2 Fileman fileop op=chmod metadata=0755 sourcefiles=public_html/cgi-bin/hello-world
$ cpanel api2 Fileman fileop op=unlink sourcefiles=public_html/cgi-bin/hello-world
$ cpanel api2 Fileman mkdir path= name=new-dir-at-top

# this one is one at a time but can overwrite files
$ cpanel api2 Fileman savefile dir=public_html/cgi-bin filename=hello-world content="$(cat public_html/cgi-bin/hello-world)"
# this is multiple files but refuses to overwrite
$ cpanel upload public_html/cgi-bin hello-world

# download
$ cpanel mirror public_html public_html cpanel localfs
# upload
$ cpanel mirror public_html public_html localfs cpanel

DESCRIPTION

CLI for cPanel UAPI and also API 2, due to missing functionality in UAPI.

Stores session token in ~/.cpanel-token, a two-line file. First line is the URL component that goes after cpsess. Second is the cpsession cookie, which you can get from your browser's DevTools.

Stores relevant domain name in ~/.cpanel-domain.

FUNCTIONS

Exportable:

dispatch_cmd_print

Will print the return value, using "dumper" in Mojo::Util except for download.

dispatch_cmd_raw_p

Returns a promise of the decoded JSON value or downloaded content.

dir_walk_p

Takes $from_dir, $to_dir, $from_map, $to_map. Copies the information in the first directory to the second, using the respective maps. Assumes UNIX-like semantics in filenames, i.e. $dir/$file.

Returns a promise of completion.

The maps are hash-refs whose values are functions, and the keys are:

ls

Takes $dir. Returns a promise of two hash-refs, of directories and of files. Each has keys of relative filename, values are an array-ref containing a string octal number representing UNIX permissions, and a number giving the mtime. Must reject if does not exist.

mkdir

Takes $dir. Returns a promise of having created the directory.

read

Takes $dir, $file. Returns a promise of the file contents.

write

Takes $dir, $file. Returns a promise of having written the file contents.

chmod

Takes $path, $perms. Returns a promise of having changed the permissions.

SEE ALSO

https://documentation.cpanel.net/display/DD/Guide+to+UAPI

https://documentation.cpanel.net/display/DD/Guide+to+cPanel+API+2

AUTHOR

Ed J

COPYRIGHT AND LICENSE

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

app-cpanel's People

Contributors

mohawk2 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.