lumberg 1.0.1 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +1 -1
- data/README.md +184 -70
- data/Rakefile +3 -1
- data/lib/lumberg/config.rb +19 -0
- data/lib/lumberg/cpanel/addon_domain.rb +50 -0
- data/lib/lumberg/cpanel/backups.rb +16 -0
- data/lib/lumberg/cpanel/base.rb +56 -0
- data/lib/lumberg/cpanel/box_trapper.rb +18 -0
- data/lib/lumberg/cpanel/branding.rb +89 -0
- data/lib/lumberg/cpanel/contact.rb +38 -0
- data/lib/lumberg/cpanel/cron.rb +89 -0
- data/lib/lumberg/cpanel/dns_lookup.rb +23 -0
- data/lib/lumberg/cpanel/domain_keys.rb +37 -0
- data/lib/lumberg/cpanel/domain_lookup.rb +71 -0
- data/lib/lumberg/cpanel/email.rb +522 -0
- data/lib/lumberg/cpanel/file_manager.rb +146 -0
- data/lib/lumberg/cpanel/ftp.rb +101 -0
- data/lib/lumberg/cpanel/gpg.rb +36 -0
- data/lib/lumberg/cpanel/locale.rb +15 -0
- data/lib/lumberg/cpanel/mime.rb +34 -0
- data/lib/lumberg/cpanel/mysql.rb +66 -0
- data/lib/lumberg/cpanel/mysql_db.rb +190 -0
- data/lib/lumberg/cpanel/net.rb +28 -0
- data/lib/lumberg/cpanel/park.rb +58 -0
- data/lib/lumberg/cpanel/password.rb +52 -0
- data/lib/lumberg/cpanel/password_strength.rb +63 -0
- data/lib/lumberg/cpanel/random_data.rb +25 -0
- data/lib/lumberg/cpanel/redirect.rb +44 -0
- data/lib/lumberg/cpanel/ssl.rb +220 -0
- data/lib/lumberg/cpanel/sub_domain.rb +61 -0
- data/lib/lumberg/cpanel/support.rb +29 -0
- data/lib/lumberg/cpanel/zone_edit.rb +134 -0
- data/lib/lumberg/cpanel.rb +32 -0
- data/lib/lumberg/format_whm.rb +162 -0
- data/lib/lumberg/version.rb +1 -1
- data/lib/lumberg/whm/account.rb +29 -106
- data/lib/lumberg/whm/base.rb +3 -7
- data/lib/lumberg/whm/cert.rb +88 -0
- data/lib/lumberg/whm/dns.rb +49 -77
- data/lib/lumberg/whm/reseller.rb +25 -118
- data/lib/lumberg/whm/server.rb +163 -222
- data/lib/lumberg/whm/transfer_tool.rb +165 -0
- data/lib/lumberg/whm.rb +11 -9
- data/lib/lumberg/whostmgr/base.rb +13 -0
- data/lib/lumberg/whostmgr/ssl.rb +57 -0
- data/lib/lumberg/whostmgr.rb +6 -0
- data/lib/lumberg.rb +35 -8
- data/spec/config_spec.rb +28 -0
- data/spec/cpanel/addon_domain_spec.rb +84 -0
- data/spec/cpanel/backups_spec.rb +22 -0
- data/spec/cpanel/base_spec.rb +128 -0
- data/spec/cpanel/box_trapper_spec.rb +22 -0
- data/spec/cpanel/branding_spec.rb +46 -0
- data/spec/cpanel/contact_spec.rb +50 -0
- data/spec/cpanel/cron_spec.rb +161 -0
- data/spec/cpanel/dns_lookup_spec.rb +22 -0
- data/spec/cpanel/domain_keys_spec.rb +46 -0
- data/spec/cpanel/domain_lookup_spec.rb +77 -0
- data/spec/cpanel/email_spec.rb +639 -0
- data/spec/cpanel/file_manager_spec.rb +73 -0
- data/spec/cpanel/ftp_spec.rb +71 -0
- data/spec/cpanel/gpg_spec.rb +48 -0
- data/spec/cpanel/locale_spec.rb +23 -0
- data/spec/cpanel/mime_spec.rb +0 -0
- data/spec/cpanel/mysql_db_spec.rb +119 -0
- data/spec/cpanel/mysql_spec.rb +0 -0
- data/spec/cpanel/net_spec.rb +30 -0
- data/spec/cpanel/park_spec.rb +94 -0
- data/spec/cpanel/password_spec.rb +35 -0
- data/spec/cpanel/password_strength_spec.rb +50 -0
- data/spec/cpanel/random_data_spec.rb +24 -0
- data/spec/cpanel/redirect_spec.rb +0 -0
- data/spec/cpanel/ssl_spec.rb +158 -0
- data/spec/cpanel/sub_domain_spec.rb +72 -0
- data/spec/cpanel/support_spec.rb +38 -0
- data/spec/cpanel/zone_edit_spec.rb +0 -0
- data/spec/format_whm_spec.rb +53 -0
- data/spec/sample_certs/cpanel.crt +28 -0
- data/spec/sample_certs/cpanel.key +28 -0
- data/spec/sample_certs/main.crt +27 -0
- data/spec/sample_certs/sample.crt +26 -0
- data/spec/sample_certs/sample.key +27 -0
- data/spec/spec_helper.rb +10 -3
- data/spec/support/cpanel_matchers.rb +17 -0
- data/spec/vcr_cassettes/cpanel/addon_domain/add.yml +77 -0
- data/spec/vcr_cassettes/cpanel/addon_domain/list.yml +77 -0
- data/spec/vcr_cassettes/cpanel/addon_domain/remove.yml +77 -0
- data/spec/vcr_cassettes/cpanel/backups/list.yml +40 -0
- data/spec/vcr_cassettes/cpanel/box_trapper/list.yml +40 -0
- data/spec/vcr_cassettes/cpanel/branding/list_icons.yml +40 -0
- data/spec/vcr_cassettes/cpanel/branding/list_image_types.yml +40 -0
- data/spec/vcr_cassettes/cpanel/branding/list_object_types.yml +40 -0
- data/spec/vcr_cassettes/cpanel/branding/list_pkgs.yml +40 -0
- data/spec/vcr_cassettes/cpanel/branding/list_sprites.yml +40 -0
- data/spec/vcr_cassettes/cpanel/contact/show.yml +40 -0
- data/spec/vcr_cassettes/cpanel/contact/update.yml +40 -0
- data/spec/vcr_cassettes/cpanel/cron/add.yml +77 -0
- data/spec/vcr_cassettes/cpanel/cron/edit.yml +114 -0
- data/spec/vcr_cassettes/cpanel/cron/email.yml +77 -0
- data/spec/vcr_cassettes/cpanel/cron/list.yml +77 -0
- data/spec/vcr_cassettes/cpanel/cron/remove.yml +151 -0
- data/spec/vcr_cassettes/cpanel/cron/set_email.yml +77 -0
- data/spec/vcr_cassettes/cpanel/dns_lookup/name_to_ip.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_keys/add.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_keys/available.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_keys/installed.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_keys/remove.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_lookup/count.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_lookup/docroot.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_lookup/docroots.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_lookup/document_root.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_lookup/document_roots.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_lookup/list.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/acceptable_encodings.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/accounts.yml +188 -0
- data/spec/vcr_cassettes/cpanel/email/add_account.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/add_filter.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/add_forwarder.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/add_mailing_list.yml +73 -0
- data/spec/vcr_cassettes/cpanel/email/add_mx.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/change_mx.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/change_password.yml +43 -0
- data/spec/vcr_cassettes/cpanel/email/check_local_delivery_local.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/check_local_delivery_remote.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/default_address.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/delete_mx.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/disk_usage.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/domains.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/domains_with_aliases.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/edit_quota.yml +112 -0
- data/spec/vcr_cassettes/cpanel/email/filters.yml +114 -0
- data/spec/vcr_cassettes/cpanel/email/forwarders.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/mail_dir.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/mail_dirs.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/mailing_lists.yml +73 -0
- data/spec/vcr_cassettes/cpanel/email/main_discard.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/mx.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/remove.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/set_default_address.yml +43 -0
- data/spec/vcr_cassettes/cpanel/email/set_mail_delivery_local.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/set_mail_delivery_remote.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/set_mx_type.yml +40 -0
- data/spec/vcr_cassettes/cpanel/file_manager/disk_usage.yml +38 -0
- data/spec/vcr_cassettes/cpanel/file_manager/list.yml +38 -0
- data/spec/vcr_cassettes/cpanel/file_manager/operate.yml +77 -0
- data/spec/vcr_cassettes/cpanel/file_manager/show.yml +40 -0
- data/spec/vcr_cassettes/cpanel/file_manager/stat.yml +38 -0
- data/spec/vcr_cassettes/cpanel/ftp/addftp.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ftp/delftp.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ftp/listftp.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ftp/listftpsessions.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ftp/listftpwithdisk.yml +95 -0
- data/spec/vcr_cassettes/cpanel/ftp/passwd.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ftp/setquota.yml +43 -0
- data/spec/vcr_cassettes/cpanel/gpg/count.yml +40 -0
- data/spec/vcr_cassettes/cpanel/gpg/count_private.yml +40 -0
- data/spec/vcr_cassettes/cpanel/gpg/list.yml +40 -0
- data/spec/vcr_cassettes/cpanel/gpg/list_private.yml +40 -0
- data/spec/vcr_cassettes/cpanel/locale/show.yml +40 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/add_db.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/add_host.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/add_user.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/add_user_db.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/check_db.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/del_db.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/del_host.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/del_user.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/del_user_db.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/init_cache.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/number_of_dbs.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/repair_db.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/update_privs.yml +42 -0
- data/spec/vcr_cassettes/cpanel/net/query_hostname.yml +40 -0
- data/spec/vcr_cassettes/cpanel/net/traceroute.yml +40 -0
- data/spec/vcr_cassettes/cpanel/park/add.yml +77 -0
- data/spec/vcr_cassettes/cpanel/park/list.yml +77 -0
- data/spec/vcr_cassettes/cpanel/park/list_addon_domains.yml +77 -0
- data/spec/vcr_cassettes/cpanel/park/remove.yml +77 -0
- data/spec/vcr_cassettes/cpanel/password/digest_authentication.yml +77 -0
- data/spec/vcr_cassettes/cpanel/password/modify.yml +77 -0
- data/spec/vcr_cassettes/cpanel/password_strength/all_required_strengths.yml +43 -0
- data/spec/vcr_cassettes/cpanel/password_strength/required_strength.yml +43 -0
- data/spec/vcr_cassettes/cpanel/password_strength/strength.yml +83 -0
- data/spec/vcr_cassettes/cpanel/random_data/show.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/fetchcabundle.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/gencrt.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ssl/gencsr.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ssl/genkey.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/installssl.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/listcrts.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/listcsrs.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/listkeys.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/listsslitems.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/remove.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ssl/showcrt.yml +38 -0
- data/spec/vcr_cassettes/cpanel/ssl/showcsr.yml +38 -0
- data/spec/vcr_cassettes/cpanel/ssl/showkey.yml +38 -0
- data/spec/vcr_cassettes/cpanel/ssl/uploadcrt.yml +40 -0
- data/spec/vcr_cassettes/cpanel/sub_domain/add.yml +77 -0
- data/spec/vcr_cassettes/cpanel/sub_domain/list.yml +77 -0
- data/spec/vcr_cassettes/cpanel/sub_domain/remove.yml +77 -0
- data/spec/vcr_cassettes/cpanel/support/contactable.yml +40 -0
- data/spec/vcr_cassettes/whm/account/accountsummary.yml +41 -29
- data/spec/vcr_cassettes/whm/account/changepackage.yml +73 -43
- data/spec/vcr_cassettes/whm/account/createacct.yml +101 -31
- data/spec/vcr_cassettes/whm/account/domainuserdata.yml +43 -29
- data/spec/vcr_cassettes/whm/account/editquota.yml +78 -57
- data/spec/vcr_cassettes/whm/account/limitbw.yml +79 -57
- data/spec/vcr_cassettes/whm/account/listaccts.yml +195 -100
- data/spec/vcr_cassettes/whm/account/listsuspended.yml +41 -29
- data/spec/vcr_cassettes/whm/account/modifyacct.yml +61 -42
- data/spec/vcr_cassettes/whm/account/myprivs.yml +41 -29
- data/spec/vcr_cassettes/whm/account/passwd.yml +44 -29
- data/spec/vcr_cassettes/whm/account/removeacct.yml +134 -57
- data/spec/vcr_cassettes/whm/account/restoreaccount.yml +310 -135
- data/spec/vcr_cassettes/whm/account/setsiteip.yml +166 -127
- data/spec/vcr_cassettes/whm/account/suspend.yml +75 -43
- data/spec/vcr_cassettes/whm/account/unsuspend.yml +46 -29
- data/spec/vcr_cassettes/whm/cert/fetch_ssl_vhosts.yml +44 -0
- data/spec/vcr_cassettes/whm/cert/fetchsslinfo.yml +38 -0
- data/spec/vcr_cassettes/whm/cert/generatessl.yml +94 -0
- data/spec/vcr_cassettes/whm/cert/installssl.yml +38 -0
- data/spec/vcr_cassettes/whm/cert/listcrts.yml +38 -0
- data/spec/vcr_cassettes/whm/dns/adddns.yml +61 -43
- data/spec/vcr_cassettes/whm/dns/addzonerecord.yml +42 -29
- data/spec/vcr_cassettes/whm/dns/dumpzone.yml +44 -29
- data/spec/vcr_cassettes/whm/dns/editzonerecord.yml +61 -43
- data/spec/vcr_cassettes/whm/dns/getzonerecord.yml +60 -43
- data/spec/vcr_cassettes/whm/dns/killdns.yml +42 -29
- data/spec/vcr_cassettes/whm/dns/listmxs.yml +23 -15
- data/spec/vcr_cassettes/whm/dns/listzones.yml +22 -15
- data/spec/vcr_cassettes/whm/dns/lookupnsip.yml +40 -29
- data/spec/vcr_cassettes/whm/dns/removezonerecord.yml +61 -43
- data/spec/vcr_cassettes/whm/dns/resetzone.yml +42 -29
- data/spec/vcr_cassettes/whm/dns/resolvedomainname.yml +40 -29
- data/spec/vcr_cassettes/whm/dns/savemxs.yml +23 -15
- data/spec/vcr_cassettes/whm/reseller/acctcounts.yml +41 -29
- data/spec/vcr_cassettes/whm/reseller/listacls.yml +22 -15
- data/spec/vcr_cassettes/whm/reseller/listresellers.yml +22 -15
- data/spec/vcr_cassettes/whm/reseller/resellerstats.yml +42 -29
- data/spec/vcr_cassettes/whm/reseller/saveacllist.yml +76 -57
- data/spec/vcr_cassettes/whm/reseller/setacls.yml +40 -29
- data/spec/vcr_cassettes/whm/reseller/setresellerips.yml +42 -28
- data/spec/vcr_cassettes/whm/reseller/setresellerlimits.yml +41 -29
- data/spec/vcr_cassettes/whm/reseller/setresellermainip.yml +59 -43
- data/spec/vcr_cassettes/whm/reseller/setresellernameservers.yml +58 -43
- data/spec/vcr_cassettes/whm/reseller/setresellerpackagelimit.yml +61 -43
- data/spec/vcr_cassettes/whm/reseller/setupreseller.yml +41 -29
- data/spec/vcr_cassettes/whm/reseller/suspendreseller.yml +75 -44
- data/spec/vcr_cassettes/whm/reseller/terminatereseller.yml +83 -46
- data/spec/vcr_cassettes/whm/reseller/unsetupreseller.yml +41 -29
- data/spec/vcr_cassettes/whm/reseller/unsuspendreseller.yml +46 -29
- data/spec/vcr_cassettes/whm/server/addip.yml +24 -15
- data/spec/vcr_cassettes/whm/server/applist.yml +22 -15
- data/spec/vcr_cassettes/whm/server/delip.yml +23 -15
- data/spec/vcr_cassettes/whm/server/disk_usage.yml +45 -0
- data/spec/vcr_cassettes/whm/server/edit_hook.yml +44 -0
- data/spec/vcr_cassettes/whm/server/gethostname.yml +22 -15
- data/spec/vcr_cassettes/whm/server/getlanglist.yml +22 -15
- data/spec/vcr_cassettes/whm/server/gettweaksetting.yml +44 -0
- data/spec/vcr_cassettes/whm/server/list_hooks.yml +44 -0
- data/spec/vcr_cassettes/whm/server/listips.yml +22 -15
- data/spec/vcr_cassettes/whm/server/loadavg.yml +26 -19
- data/spec/vcr_cassettes/whm/server/lookup_nameserver_ip.yml +44 -0
- data/spec/vcr_cassettes/whm/server/my_function.yml +59 -43
- data/spec/vcr_cassettes/whm/server/nvget.yml +22 -15
- data/spec/vcr_cassettes/whm/server/nvset.yml +22 -15
- data/spec/vcr_cassettes/whm/server/reboot.yml +22 -15
- data/spec/vcr_cassettes/whm/server/sethostname.yml +24 -15
- data/spec/vcr_cassettes/whm/server/setresolvers.yml +23 -15
- data/spec/vcr_cassettes/whm/server/settweaksetting.yml +44 -0
- data/spec/vcr_cassettes/whm/server/showbw.yml +22 -15
- data/spec/vcr_cassettes/whm/server/systemloadavg.yml +40 -29
- data/spec/vcr_cassettes/whm/server/themes.yml +38 -0
- data/spec/vcr_cassettes/whm/server/version.yml +22 -15
- data/spec/vcr_cassettes/whm/transfer_tool/check.yml +44 -0
- data/spec/vcr_cassettes/whm/transfer_tool/create.yml +72 -0
- data/spec/vcr_cassettes/whm/transfer_tool/enqueue.yml +44 -0
- data/spec/vcr_cassettes/whm/transfer_tool/pause.yml +44 -0
- data/spec/vcr_cassettes/whm/transfer_tool/show_log.yml +44 -0
- data/spec/vcr_cassettes/whm/transfer_tool/start.yml +44 -0
- data/spec/vcr_cassettes/whm/transfer_tool/status.yml +44 -0
- data/spec/vcr_cassettes/whm/transfer_tool/validate_user.yml +44 -0
- data/spec/vcr_cassettes/whostmgr/ssl/create.yml +219 -0
- data/spec/vcr_cassettes/whostmgr/ssl/remove.yml +172 -0
- data/spec/vcr_cassettes/whostmgr/ssl/remove_data.yml +179 -0
- data/spec/whm/account_spec.rb +90 -249
- data/spec/whm/base_spec.rb +3 -7
- data/spec/whm/cert_spec.rb +110 -0
- data/spec/whm/dns_spec.rb +37 -155
- data/spec/whm/reseller_spec.rb +46 -114
- data/spec/whm/server_spec.rb +142 -156
- data/spec/whm/transfer_tool_spec.rb +172 -0
- data/spec/whm/whm_spec.rb +8 -8
- data/spec/whostmgr/ssl_spec.rb +55 -0
- metadata +528 -108
- data/.gitignore +0 -10
- data/.rspec +0 -2
- data/.rvmrc +0 -49
- data/.travis.yml +0 -11
- data/lib/lumberg/whm/args.rb +0 -113
- data/lib/net_http_hacked.rb +0 -42
- data/lumberg.gemspec +0 -28
- data/spec/vcr_cassettes/whm/server/response_type.yml +0 -85
- data/spec/whm/args_spec.rb +0 -179
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a5ccd3bf942f150d835527fa7bfdbf89f8c0e214
|
4
|
+
data.tar.gz: 8f8723d73089a5c80c5fb5c0f6c88b7a92e8d69e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7dc50efeb877e113a34c0a92e412503b31b324dddba4ae9d5a4e1517830fd059424b84d8049acab06e9938ae5c465d516ebf17697adf72f6813eb03b615a57f8
|
7
|
+
data.tar.gz: f3daae45a95e11563237514ae66e122b95a474ce7a416ee97dfad144f7fb327c12e232cefc111c854a60c1de3243c58a6a31271e55d733710072379d1452f263
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
Lumberg [![Lumberg Build Status][Build Icon]][Build Status]
|
2
|
-
===========================================================
|
1
|
+
# Lumberg [![Lumberg Build Status][Build Icon]][Build Status]
|
3
2
|
|
4
3
|
![Lumberg logo](http://i.imgur.com/xC4Sw.jpg)
|
5
4
|
|
@@ -8,29 +7,33 @@ beta-ish. Please report any issues you find. :)
|
|
8
7
|
|
9
8
|
[RDoc](http://rdoc.info/github/site5/lumberg/master/frames)
|
10
9
|
|
11
|
-
Confirmed to work with ruby 1.
|
12
|
-
cPanel 11.28+
|
10
|
+
Confirmed to work with ruby 1.9.3, 2.0.0, 2.1.3, 2.2.0 and JRuby 1.9 mode.
|
13
11
|
|
14
12
|
[Build Status]: http://travis-ci.org/site5/lumberg
|
15
13
|
[Build Icon]: https://secure.travis-ci.org/site5/lumberg.png?branch=master
|
16
14
|
|
17
15
|
|
18
|
-
|
19
|
-
|
16
|
+
## cPanel Version Targets
|
17
|
+
|
18
|
+
* cPanel 11.4x: _v2.0.0_
|
19
|
+
* cPanel 11.3x: _v2.0.0.pre10_
|
20
|
+
* cPanel 11.2x: _v1.1.1_
|
21
|
+
|
22
|
+
|
23
|
+
## Install
|
20
24
|
|
21
25
|
gem install lumberg
|
22
26
|
|
23
27
|
|
24
|
-
Usage
|
25
|
-
-----
|
28
|
+
## Usage
|
26
29
|
|
27
30
|
Create a server object and connect to WHM using your host and hash:
|
28
31
|
|
29
32
|
```ruby
|
30
33
|
require 'lumberg'
|
31
34
|
server = Lumberg::Whm::Server.new(
|
32
|
-
:
|
33
|
-
:
|
35
|
+
host: WHM_HOST,
|
36
|
+
hash: WHM_HASH
|
34
37
|
)
|
35
38
|
```
|
36
39
|
|
@@ -38,9 +41,10 @@ If you are using HTTP Basic Authentication with a username/password:
|
|
38
41
|
|
39
42
|
```ruby
|
40
43
|
server = Lumberg::Whm::Server.new(
|
41
|
-
:
|
42
|
-
:
|
43
|
-
:
|
44
|
+
host: WHM_HOST,
|
45
|
+
user: USERNAME,
|
46
|
+
hash: 'my_password',
|
47
|
+
basic_auth: true
|
44
48
|
)
|
45
49
|
```
|
46
50
|
|
@@ -81,43 +85,42 @@ Here's an example of what the returned data looks like for a single account
|
|
81
85
|
pp result[:params][:acct].first
|
82
86
|
|
83
87
|
{
|
84
|
-
:
|
85
|
-
:
|
86
|
-
:
|
87
|
-
:
|
88
|
-
:
|
89
|
-
:
|
90
|
-
:
|
91
|
-
:
|
92
|
-
:
|
93
|
-
:
|
94
|
-
:
|
95
|
-
:
|
96
|
-
:
|
97
|
-
:
|
98
|
-
:
|
99
|
-
:
|
100
|
-
:
|
101
|
-
:
|
102
|
-
:
|
103
|
-
:
|
104
|
-
:
|
105
|
-
:
|
106
|
-
:
|
88
|
+
startdate: false,
|
89
|
+
plan: "default",
|
90
|
+
suspended: false,
|
91
|
+
theme: "x3",
|
92
|
+
shell: "/usr/local/cpanel/bin/jailshell",
|
93
|
+
maxpop: "unlimited",
|
94
|
+
maxlst: "unlimited",
|
95
|
+
maxaddons: "*unknown*",
|
96
|
+
suspendtime: nil,
|
97
|
+
ip: false,
|
98
|
+
maxsub: "unlimited",
|
99
|
+
domain: "bob.com",
|
100
|
+
maxsql: "unlimited",
|
101
|
+
partition: "home",
|
102
|
+
maxftp: "unlimited",
|
103
|
+
user: "bob",
|
104
|
+
suspendreason: "not suspended",
|
105
|
+
unix_startdate: false,
|
106
|
+
diskused: false,
|
107
|
+
maxparked: "*unknown*",
|
108
|
+
email: "*unknown*",
|
109
|
+
disklimit: "unlimited",
|
110
|
+
owner: "root"
|
107
111
|
}
|
108
112
|
```
|
109
113
|
|
110
114
|
|
111
|
-
Account Example
|
112
|
-
---------------
|
115
|
+
### Account Example
|
113
116
|
|
114
117
|
Creating a new account requires only a username, domain, and password.
|
115
118
|
|
116
119
|
```ruby
|
117
120
|
result = server.account.create(
|
118
|
-
:
|
119
|
-
:
|
120
|
-
:
|
121
|
+
username: 'newuser',
|
122
|
+
domain: 'newuser.com',
|
123
|
+
password: 'password'
|
121
124
|
)
|
122
125
|
|
123
126
|
if result[:success]
|
@@ -130,18 +133,17 @@ Account Creation Ok
|
|
130
133
|
You can list all accounts or search for a specific account.
|
131
134
|
|
132
135
|
```ruby
|
133
|
-
result = server.account.list(:
|
136
|
+
result = server.account.list(search: 'new', searchtype: 'user')
|
134
137
|
acct = result[:params][:acct].first
|
135
138
|
p "Found user '#{acct[:user]}' with domain '#{acct[:domain]}'"
|
136
139
|
|
137
140
|
Found user 'newuser' with domain 'newuser.com'
|
138
141
|
```
|
139
142
|
|
140
|
-
|
141
143
|
Suspending an account is simple and the reason for suspension is optional.
|
142
144
|
|
143
145
|
```ruby
|
144
|
-
result = server.account.suspend(:
|
146
|
+
result = server.account.suspend(username: 'newuser', reason: 'bad user')
|
145
147
|
p "user was suspended successfully" if result[:success]
|
146
148
|
|
147
149
|
user was suspended successfully
|
@@ -151,7 +153,7 @@ We can look at the account list again to see the reason for the user's
|
|
151
153
|
suspension.
|
152
154
|
|
153
155
|
```ruby
|
154
|
-
result = server.account.list(:
|
156
|
+
result = server.account.list(search: 'new', searchtype: 'user')
|
155
157
|
acct = result[:params][:acct].first
|
156
158
|
p "user '#{acct[:user]}' was suspended with reason '#{acct[:suspendreason]}'"
|
157
159
|
|
@@ -161,28 +163,27 @@ user 'newuser' was suspended with reason 'bad user'
|
|
161
163
|
Finally, we remove the user and delete their account.
|
162
164
|
|
163
165
|
```ruby
|
164
|
-
result = server.account.remove(:
|
166
|
+
result = server.account.remove(username: 'newuser')
|
165
167
|
p result[:message]
|
166
168
|
|
167
169
|
newuser account removed
|
168
170
|
```
|
169
171
|
|
170
172
|
|
171
|
-
Reseller Example
|
172
|
-
----------------
|
173
|
+
### Reseller Example
|
173
174
|
|
174
175
|
Creating a reseller works by changing the status of an existing user account,
|
175
176
|
so first we create a user account and then we can create that user as a reseller.
|
176
177
|
|
177
178
|
```ruby
|
178
179
|
result = server.account.create(
|
179
|
-
:
|
180
|
-
:
|
181
|
-
:
|
180
|
+
username: 'rtest',
|
181
|
+
domain: 'resellerexample.com',
|
182
|
+
password: 'password'
|
182
183
|
)
|
183
184
|
|
184
185
|
if result[:success]
|
185
|
-
result = server.reseller.create(:
|
186
|
+
result = server.reseller.create(username: 'rtest', makeowner: true)
|
186
187
|
p "created reseller rtest" if result[:success]
|
187
188
|
end
|
188
189
|
|
@@ -202,7 +203,7 @@ Suspending a reseller is pretty straightforward. It's optional to provide a
|
|
202
203
|
reason for the suspension.
|
203
204
|
|
204
205
|
```ruby
|
205
|
-
result = server.reseller.suspend(:
|
206
|
+
result = server.reseller.suspend(username: 'rtest', reason: 'bad user')
|
206
207
|
p "reseller was suspended successfully" if result[:success]
|
207
208
|
|
208
209
|
user was suspended successfully
|
@@ -212,35 +213,148 @@ Deleting the reseller removes the reseller status from the user account. To
|
|
212
213
|
also delete the user account, set the `:terminatereseller` argument.
|
213
214
|
|
214
215
|
```ruby
|
215
|
-
result = server.reseller.terminate(:
|
216
|
+
result = server.reseller.terminate(reseller: 'rtest', terminatereseller: true)
|
216
217
|
p result[:message]
|
217
218
|
|
218
219
|
Account Terminations Complete
|
219
220
|
```
|
220
221
|
|
221
|
-
|
222
|
-
============
|
222
|
+
### Accessing cPanel API
|
223
223
|
|
224
|
-
|
225
|
-
|
224
|
+
[cPanel API](http://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/ApiIntroduction)
|
225
|
+
interface is provided by the `Lumberg::Cpanel` module. Classes within the module
|
226
|
+
correspond to cPanel API modules. cPanel API module coverage is currently
|
227
|
+
incomplete and we're seeking contributions. Check out [Extending
|
228
|
+
Lumberg::Cpanel](#extending-lumbergcpanel) for details on how you can help.
|
229
|
+
|
230
|
+
#### Email example
|
231
|
+
|
232
|
+
```ruby
|
233
|
+
# Create an interface object for cPanel API Email module
|
234
|
+
email = Lumberg::Cpanel::Email.new(
|
235
|
+
server: server, # An instance of Lumberg::Server
|
236
|
+
api_username: "jerry" # User whose cPanel we'll be interacting with
|
237
|
+
)
|
226
238
|
|
227
|
-
|
228
|
-
|
239
|
+
# Get a list of email accounts
|
240
|
+
email.accounts[:params][:data] #=> Array of info hashes for each email account
|
241
|
+
|
242
|
+
# Add an email forwarder to forward mail for my-forwarder@domain.com to
|
243
|
+
# dest@other-domain.com
|
244
|
+
email.add_forwarder(
|
245
|
+
domain: "domain.com",
|
246
|
+
email: "my-forwarder",
|
247
|
+
fwdopt: "fwd",
|
248
|
+
fwdemail: "dest@other-domain.com"
|
249
|
+
)
|
250
|
+
```
|
251
|
+
|
252
|
+
|
253
|
+
## Contributing
|
254
|
+
|
255
|
+
### Extending Lumberg::Cpanel
|
256
|
+
|
257
|
+
1. Find a cPanel API module that isn't already covered. See
|
258
|
+
[cPanel API documentation](http://docs.cpanel.net/twiki/bin/view/SoftwareDevelopmentKit/ApiIntroduction)
|
259
|
+
for a full list of available API modules.
|
260
|
+
|
261
|
+
2. Create a file (underscore style) in `lib/lumberg/cpanel/` named after the
|
262
|
+
cPanel API module you're working on. If the cPanel API module is "LangMods"
|
263
|
+
name the file "lang_mods.rb". You'll define your class here. `require` this
|
264
|
+
file from `lib/lumberg/cpanel.rb`.
|
265
|
+
|
266
|
+
3. Define a class that inherits from `Lumberg::Cpanel::Base`:
|
267
|
+
```ruby
|
268
|
+
# Create a class for (fictional) "SomeModule" API module
|
269
|
+
module Lumberg
|
270
|
+
module Cpanel
|
271
|
+
class SomeModule < Base
|
272
|
+
end
|
273
|
+
end
|
274
|
+
end
|
275
|
+
```
|
276
|
+
The cPanel API module name is normally inferred from the class name, e.g., if
|
277
|
+
the class name is `Email` the cPanel "Email" API module will be used. If the
|
278
|
+
cPanel API module you're working with doesn't match up with Ruby class naming
|
279
|
+
convention, override the `::api_module` class method:
|
280
|
+
```ruby
|
281
|
+
module Lumberg
|
282
|
+
module Cpanel
|
283
|
+
class SslInfo
|
284
|
+
def self.api_module; "SSLInfo"; end
|
285
|
+
end
|
286
|
+
end
|
287
|
+
end
|
288
|
+
```
|
289
|
+
4. Fill in the methods.
|
290
|
+
```ruby
|
291
|
+
module Lumberg
|
292
|
+
module Cpanel
|
293
|
+
class Branding
|
294
|
+
# Public: Get URL locations for specific sprites.
|
295
|
+
#
|
296
|
+
# options - Hash options for API call params (default: {}):
|
297
|
+
# :img - String branding object label for the image you want to
|
298
|
+
# retrieve.
|
299
|
+
# :imgtype - String branding image type you want to retrieve, e.g.,
|
300
|
+
# "icon" or "heading".
|
301
|
+
# :method - String specification for returned value options.
|
302
|
+
# Acceptable values are: "only_filetype_gif",
|
303
|
+
# "skip_filetype_gif", "snap_to_smallest_width", and
|
304
|
+
# "scale_60percent".
|
305
|
+
# :subtype - String branding image subtype, e.g., "img", "bg",
|
306
|
+
# "compleximg".
|
307
|
+
# :image - String parameter allows you to force appropriate
|
308
|
+
# output by setting it to "heading" (optional).
|
309
|
+
# :skipgroups - String parameter allows you to specify whether or not
|
310
|
+
# to include "img" values that begin with "group_" in
|
311
|
+
# the output. "1" indicates that you wish to skip "img"
|
312
|
+
# values that begin with "group_" (optional).
|
313
|
+
#
|
314
|
+
# Returns Hash API response.
|
315
|
+
def list_sprites(options = {})
|
316
|
+
perform_request({
|
317
|
+
api_function: "spritelist"
|
318
|
+
}.merge(options))
|
319
|
+
end
|
320
|
+
end
|
321
|
+
end
|
322
|
+
end
|
323
|
+
```
|
324
|
+
|
325
|
+
- In many cases, you'll name your methods to match up
|
326
|
+
with the documented cPanel API methods. However, the documented method
|
327
|
+
names are sometimes a bit lengthy, confusing, or otherwise unwieldy; feel
|
328
|
+
free to give your corresponding method an improved name.
|
329
|
+
- Use [TomDoc](http://tomdoc.org/) documentation for your methods.
|
330
|
+
Be sure to document all required and optional parameters from the
|
331
|
+
cPanel API documentation.
|
332
|
+
- All methods should take an options arg that defaults to {}.
|
333
|
+
These options should be merged onto the options passed to
|
334
|
+
#perform_request to allow overriding of :api_username or
|
335
|
+
other parameters.
|
336
|
+
|
337
|
+
### Sanitizing VCR cassettes
|
338
|
+
|
339
|
+
All HTTP interactions are recorded using VCR and FakeWeb. Please be sure to remove
|
340
|
+
sensitive data from your cassettes. A Rake task is provided for this purpose:
|
341
|
+
```
|
342
|
+
WHM_HOST=my-cpanel-server.com WHM_HASH=$(cat my-access-hash) bundle exec rake sanitize_cassettes
|
343
|
+
```
|
344
|
+
Once you've sanitized your cassettes, manually verify that there's no sensitive
|
345
|
+
information still present (check URLs, authorization params, etc.).
|
229
346
|
|
230
|
-
|
231
|
-
remove any sensitive information from your cassettes.
|
347
|
+
### Note on Patches/Pull Requests
|
232
348
|
|
233
349
|
* Fork the project.
|
234
|
-
* Add yourself to the Contributors list
|
235
350
|
* Make your feature addition or bug fix.
|
236
|
-
* Add tests for it. This is important so
|
351
|
+
* Add tests for it. This is important so we don't break it in a
|
237
352
|
future version unintentionally.
|
238
|
-
* Commit, do not mess with
|
353
|
+
* Commit, do not mess with Rakefile, version, or history.
|
239
354
|
(if you want to have your own version, that is fine but bump version in a
|
240
|
-
commit by itself
|
241
|
-
* Send
|
355
|
+
commit by itself we can ignore when we pull)
|
356
|
+
* Send us a pull request. Bonus points for topic branches.
|
242
357
|
|
243
|
-
Copyright
|
244
|
-
=========
|
358
|
+
## Copyright
|
245
359
|
|
246
|
-
Copyright (c)
|
360
|
+
Copyright (c) 2015 WWWH, LLC. See LICENSE for details.
|
data/Rakefile
CHANGED
@@ -14,6 +14,8 @@ begin
|
|
14
14
|
rescue LoadError
|
15
15
|
end
|
16
16
|
|
17
|
+
load 'vcr/tasks/vcr.rake'
|
18
|
+
|
17
19
|
RSpec::Core::RakeTask.new :spec
|
18
20
|
Bundler::GemHelper.install_tasks
|
19
21
|
|
@@ -26,7 +28,7 @@ task :sanitize_cassettes do
|
|
26
28
|
files.each do |file|
|
27
29
|
old = File.read(file)
|
28
30
|
if old.match(/#{ENV['WHM_HASH']}|#{ENV['WHM_HOST']}/)
|
29
|
-
puts "Sanitizing #{file}"
|
31
|
+
puts "Sanitizing #{file}"
|
30
32
|
old.gsub!(ENV['WHM_HASH'], 'iscool')
|
31
33
|
old.gsub!(ENV['WHM_HOST'], 'myhost.com')
|
32
34
|
File.open(file, 'w') do |f|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Lumberg
|
2
|
+
# Holds the configuration for Lumberg
|
3
|
+
class Config
|
4
|
+
attr_accessor :options
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
@options = {}
|
8
|
+
end
|
9
|
+
|
10
|
+
def [](v)
|
11
|
+
@options[v]
|
12
|
+
end
|
13
|
+
|
14
|
+
# Debug output. value can be either true to output to $stderr or a path to a file
|
15
|
+
def debug(output)
|
16
|
+
@options[:debug] = output
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Lumberg
|
2
|
+
module Cpanel
|
3
|
+
class AddonDomain < Base
|
4
|
+
# Public: Delete an addon domain. This will also remove the corresponding
|
5
|
+
# subdomain and FTP account.
|
6
|
+
#
|
7
|
+
# options - Hash options for API call params (default: {}):
|
8
|
+
# :domain - String addon domain to be deleted.
|
9
|
+
# :subdomain - String adddon domain's username followed by "_", then
|
10
|
+
# the addon domain's main domain, e.g.,
|
11
|
+
# "user_addon.com"
|
12
|
+
#
|
13
|
+
# Returns Hash API response.
|
14
|
+
def remove(options = {})
|
15
|
+
perform_request({
|
16
|
+
api_function: "deladdondomain"
|
17
|
+
}.merge(options))
|
18
|
+
end
|
19
|
+
|
20
|
+
# Public: Add an addon domain with a coresponding subdomain.
|
21
|
+
#
|
22
|
+
# options - Hash options for API call params (default: {}):
|
23
|
+
# :dir - String path for addon domain docroot.
|
24
|
+
# :newdomain - String domain to use for addon domain.
|
25
|
+
# :subdomain - String subdomain / FTP username corresponding to new
|
26
|
+
# addon domain, e.g., "user".
|
27
|
+
#
|
28
|
+
# Returns Hash API response.
|
29
|
+
def add(options = {})
|
30
|
+
perform_request({
|
31
|
+
api_function: "addaddondomain"
|
32
|
+
}.merge(options))
|
33
|
+
end
|
34
|
+
|
35
|
+
# Public: Get a list of addon domains.
|
36
|
+
#
|
37
|
+
# options - Hash options for API call params (default: {}):
|
38
|
+
# :regex - String regular expression to filter search results
|
39
|
+
# (optional).
|
40
|
+
#
|
41
|
+
# Returns Hash API response.
|
42
|
+
def list(options={})
|
43
|
+
perform_request({
|
44
|
+
api_function: "listaddondomains"
|
45
|
+
}.merge(options))
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Lumberg
|
2
|
+
module Cpanel
|
3
|
+
class Backups < Base
|
4
|
+
# Public: Get a list backups.
|
5
|
+
#
|
6
|
+
# options - Hash options for API call params (default: {})
|
7
|
+
#
|
8
|
+
# Returns Hash API response.
|
9
|
+
def list(options = {})
|
10
|
+
perform_request({
|
11
|
+
api_function: "listfullbackups"
|
12
|
+
}.merge(options))
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module Lumberg
|
2
|
+
module Cpanel
|
3
|
+
class Base < Whm::Base
|
4
|
+
attr_accessor :api_username
|
5
|
+
|
6
|
+
# Public: Gets cPanel API module name based on class name. This method
|
7
|
+
# should be overriden in subclasses where the cPanel API module name
|
8
|
+
# and the class name don't match up.
|
9
|
+
#
|
10
|
+
# Returns String cPanel API module name.
|
11
|
+
def self.api_module
|
12
|
+
self.name.split("::").last
|
13
|
+
end
|
14
|
+
|
15
|
+
# Public: Initialize a new cPanel API interface.
|
16
|
+
#
|
17
|
+
# options - Hash options (default: {}):
|
18
|
+
# :api_username - String username to set as the default account
|
19
|
+
# username for cPanel API calls (optional).
|
20
|
+
def initialize(options = {})
|
21
|
+
@api_username = options.delete(:api_username)
|
22
|
+
|
23
|
+
super options
|
24
|
+
end
|
25
|
+
|
26
|
+
# Public: Perform a cPanel API method call.
|
27
|
+
#
|
28
|
+
# options - Hash options for API call params (default: {}):
|
29
|
+
# :api_function - String API function name to call.
|
30
|
+
# :api_module - String API module on which API function will be
|
31
|
+
# called (optional, default: self.class.api_module).
|
32
|
+
# :response_key - String key used to select desired part of API
|
33
|
+
# response (optional, default: "cpanelresult").
|
34
|
+
# :api_username - String account username for API call (optional,
|
35
|
+
# default: @api_username)
|
36
|
+
# :api_version - Integer cPanel API version to use (optional,
|
37
|
+
# default: 2)
|
38
|
+
#
|
39
|
+
# Returns Hash API response.
|
40
|
+
def perform_request(options = {})
|
41
|
+
options[:api_username] ||= api_username
|
42
|
+
|
43
|
+
api_module = options.delete(:api_module) || self.class.api_module
|
44
|
+
params = {
|
45
|
+
response_key: options.delete(:response_key) || "cpanelresult",
|
46
|
+
cpanel_jsonapi_user: options.delete(:api_username),
|
47
|
+
cpanel_jsonapi_module: api_module,
|
48
|
+
cpanel_jsonapi_func: options.delete(:api_function),
|
49
|
+
cpanel_jsonapi_apiversion: options.delete(:api_version) || 2,
|
50
|
+
}.merge(options)
|
51
|
+
|
52
|
+
server.perform_request("cpanel", params)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Lumberg
|
2
|
+
module Cpanel
|
3
|
+
class BoxTrapper < Base
|
4
|
+
# Public: Get list of email accounts and their BoxTrapper statuses.
|
5
|
+
#
|
6
|
+
# options - Hash options for API call params (default: {}):
|
7
|
+
# :regex - String regular expression to filter search results
|
8
|
+
# (optional).
|
9
|
+
#
|
10
|
+
# Returns Hash API response.
|
11
|
+
def list(options = {})
|
12
|
+
perform_request({
|
13
|
+
api_function: "accountmanagelist"
|
14
|
+
}.merge(options))
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
module Lumberg
|
2
|
+
module Cpanel
|
3
|
+
class Branding < Base
|
4
|
+
# Public: Get list of branding packages.
|
5
|
+
#
|
6
|
+
# options - Hash options for API call params (default: {}):
|
7
|
+
# :onlyshowyours - Return only packages that the user owns?
|
8
|
+
# String "1" or "0" (optional).
|
9
|
+
# :showroot - Only return system branding packages?
|
10
|
+
# String "1" or "0" (optional).
|
11
|
+
# :skipglobal - Only return customized branding packages?
|
12
|
+
# String "1" or "0" (optional).
|
13
|
+
# :skiphidden - Skip branding packages owned by the user?
|
14
|
+
# String "1" or "0" (optional).
|
15
|
+
#
|
16
|
+
# Returns Hash API response.
|
17
|
+
def list_pkgs(options = {})
|
18
|
+
perform_request({
|
19
|
+
api_function: "showpkgs"
|
20
|
+
}.merge(options))
|
21
|
+
end
|
22
|
+
|
23
|
+
# Public: Get URL locations for specific sprites.
|
24
|
+
#
|
25
|
+
# options - Hash options for API call params (default: {}):
|
26
|
+
# :img - String branding object label for the image you want to
|
27
|
+
# retrieve.
|
28
|
+
# :imgtype - String branding image type you want to retrieve, e.g.,
|
29
|
+
# "icon" or "heading".
|
30
|
+
# :method - String specification for returned value options.
|
31
|
+
# Acceptable values are: "only_filetype_gif",
|
32
|
+
# "skip_filetype_gif", "snap_to_smallest_width", and
|
33
|
+
# "scale_60percent".
|
34
|
+
# :subtype - String branding image subtype, e.g., "img", "bg",
|
35
|
+
# "compleximg".
|
36
|
+
# :image - String parameter allows you to force appropriate
|
37
|
+
# output by setting it to "heading" (optional).
|
38
|
+
# :skipgroups - String parameter allows you to specify whether or not
|
39
|
+
# to include "img" values that begin with "group_" in
|
40
|
+
# the output. "1" indicates that you wish to skip "img"
|
41
|
+
# values that begin with "group_" (optional).
|
42
|
+
#
|
43
|
+
# Returns Hash API response.
|
44
|
+
def list_sprites(options = {})
|
45
|
+
perform_request({
|
46
|
+
api_function: "spritelist"
|
47
|
+
}.merge(options))
|
48
|
+
end
|
49
|
+
|
50
|
+
# Public: Retrieve a list of icons within the x3 interface.
|
51
|
+
#
|
52
|
+
# options - Hash options for API call params (default: {}):
|
53
|
+
# :nvarglist - String parameter allows you to specify the order in
|
54
|
+
# which you wish to have groups returned, separated by
|
55
|
+
# pipes, e.g., "mail|files|domains|logs". This is the
|
56
|
+
# last filter on the data and is stored in your
|
57
|
+
# xmaingroupsorder NVDATA variable (optional).
|
58
|
+
#
|
59
|
+
# Returns Hash API response.
|
60
|
+
def list_icons(options = {})
|
61
|
+
perform_request({
|
62
|
+
api_function: "applist"
|
63
|
+
}.merge(options))
|
64
|
+
end
|
65
|
+
|
66
|
+
# Public: Get list of branding object types.
|
67
|
+
#
|
68
|
+
# options - Hash options for API call params (default: {}):
|
69
|
+
#
|
70
|
+
# Returns Hash API response.
|
71
|
+
def list_object_types(options = {})
|
72
|
+
perform_request({
|
73
|
+
api_function: "listobjecttypes"
|
74
|
+
}.merge(options))
|
75
|
+
end
|
76
|
+
|
77
|
+
# Public: Get list of branding image types.
|
78
|
+
#
|
79
|
+
# options - Hash options for API call params (default: {}):
|
80
|
+
#
|
81
|
+
# Returns Hash API response.
|
82
|
+
def list_image_types(options = {})
|
83
|
+
perform_request({
|
84
|
+
api_function: "listimgtypes"
|
85
|
+
}.merge(options))
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|