NAME
WWW::FBX::Role::API::APIv3 - Freebox API v3
SYNOPSIS
with 'WWW::FBX::Role::API::APIv3';
DESCRIPTION
WWW::FBX::Role::API::APIv3 is the freebox6 API version 3 as a Moose Role
API
API documentation is given here: http://dev.freebox.fr/sdk/os/ The following methods are currently implemented in this library:
RRD
get rrd stats
$fbx->rrd( { db => "temp", fields => [ "cpub" ], precision => 1 } );
call and contacts
call log
$fbx->call_log;
contact
$fbx->contact;
connection
connection
$res = $fbx->connection;
connection config
$res = $fbx->connection_config;
connection ipv6 config
$fbx->connection_ipv6_config;
connection xdsl
$fbx->connection_xdsl;
connection ftth
$fbx->connection_ftth;
update connection config
$res = $fbx->upd_connection({ping=>\1});
update connection ipv6 config
$res = $fbx->upd_ipv6_config({ipv6_enabled=>\0});
connection dyndns noip
$res = $fbx->connection_dyndns("noip/status");
connection dyndns noip
$res = $fbx->upd_connection_dyndns("noip/status", {enabled=>\0});
dhcp
dhcp config
$fbx->dhcp_config;
dhcp static lease
$fbx->dhcp_static_lease;
dhcp dynamic lease
$fbx->dhcp_dynamic_lease;
download
downloads
$fbx->downloads;
downloads config
$fbx->downloads_config;
downloads stats
$fbx->downloads_stats;
download feeds
$fbx->downloads_feeds;
downloads config
$res = $fbx->downloads_config;
download tasks
$res = $fbx->get_download_task;
download add
$res = $fbx->add_download_task( { download_url => "http://cdimage.debian.org/debian-cd/current/arm64/bt-cd/debian-8.4.0-arm64-CD-1.iso.torrent"} );
update downloads config
$res = $fbx->upd_downloads_config({max_downloading_tasks => $max_dl_tasks});
update throttling
$res = $fbx->upd_downloads_throttle( "schedule" );
download tasks
$res = $fbx->get_download_task;
download task
$res = $fbx->get_download_task( $id );
download task log
$res = $fbx->get_download_task( "$id/log" );
downloads update
$fbx->upd_download_task( $id, { io_priority => "high" } );
get download task files
$res = $fbx->get_download_task("$id/files") ;
update priority of download file
$res = $fbx->change_prio_download_file( "$id/files/$id_file", { priority=>"high"} );
downloads task del
$res = $fbx->del_download_task( $id );
download add by local file
$res = $fbx->add_download_task_file( {download_file => [ "mine/debian-8.4.0-arm64-netinst.iso.torrent" ] });
download tracker
$res = $fbx->get_download_task( "$id/trackers");
download peers
$res = $fbx->get_download_task( "$id/peers");
downloads task del with file erase
$fbx->del_download_task( "$id/erase" );
download feed
$res = $fbx->downloads_feeds;
add feed
$res = $fbx->add_feed( "http://www.esa.int/rssfeed/Our_Activities/Space_News" );
update feed
$fbx->upd_feed( $id , {auto_download=> \1} );
download feed
$res = $fbx->downloads_feeds("$id/items");
refresh feed
$fbx->refresh_feed( "$id/fetch" );
refresh all feeds
$fbx->refresh_feeds;
download feed items
$fbx->downloads_feeds("$id/items");
update a feed item
$fbx->upd_feed("$id/items/$id_file");
download a feed item
$fbx->download_feed_item("$id/items/$id_file/download");
mark all items as read
$fbx->mark_all_read( "$id/items/mark_all_as_read" );
del feed
$fbx->del_feed( $id );
download file to disk
$res = $fbx->download_file( "Disque dur/Photos/cyril/DSCF4322.JPG" );
download file to disk
$res = $fbx->download_file( "Disque dur/Photos/cyril/DSCF4321.JPG" );
get upload id
$res = $fbx->upload_auth( {upload_name => "DSCF4322.JPG", dirname => "/Disque dur/"} );
upload file by upload id
$res = $fbx->upload_file( {id=> $res->{id}, filename=>"DSCF4322.JPG"});
upload file directly
$res = $fbx->upload_file( {filename => "DSCF4321.JPG", dirname => "/Disque dur/"} );
freeplugs
list freeplugs
$fbx->freeplugs_net;
get a particular freeplugs
$fbx->freeplugs_net("F4:CA:E5:1D:46:AE");
reset freeplug
$fbx->reset_freeplug("F4:CA:E5:1D:46:AE");
fs
fs tasks
$fbx->fs_tasks;
fs task
$fbx->fs_tasks(12);
del fs task
$fbx->del_task(12);
update fs task
$fbx->upd_task(12, state=>"paused"});
list files
$res = $fbx->list_files("Disque dur/");
file info
$res = $fbx->file_info("Disque dur/Photos/Sydney/DSCF4323.JPG");
file move
$res = $fbx->mv( {files=>[ qw/a.txt b.txt/ ], dst => "/Disque dur/directory", mode => "overwrite" } );
file cp
$res = $fbx->cp( {files=>[ qw/a.txt b.txt/ ], dst => "/Disque dur/directory", mode => "overwrite" } );
file archive
$res = $fbx->archive( {files=>[ qw/a.txt b.txt/ ], dst => "/Disque dur/archive.zip", mode => "overwrite" } );
file rm
$res = $fbx->rm( {files=>[ qw/a.txt b.txt/ ] } );
file cat
$res = $fbx->cat( {files=>[ qw/a.txt b.txt/ ], dst=>"/Disque dur/file", multi_volumes=\0, delete_files=>\0, append=>\1, overwrite=>\0 } );
file extract
$res = $fbx->cat( { src => "foo.iso", dst=>"/Disque dur/directory", password =>"", delete_archive=>\0, overwrite=>\0 } );
file repair
$res = $fbx->repair( { src => "foo.iso.par2", delete_archive=>\0 } );
file hash
$res = $fbx->hash( { src => "foo.iso", hash_type=>"md5" } );
mkdir
$res = $fbx->mkdir( { parent => "/Disque dur/", dirname => "directory" } );
rename
$res = $fbx->rename( { src => "/Disque dur/a.txt", dst => "b.txt' } );
download RAW file not JSON!
$res = $fbx->download_file("Disque dur/Photos/cyril/DSCF4322.JPG");
ftp
ftp config
$fbx->ftp_config;
lan
lan config
$res = $fbx->lan_config;
lan browser interfaces
$res = $fbx->lan_browser_interfaces;
lan browser interfaces pub
$res = $fbx->list_hosts( $net );
get host information
$res = $fbx->list_hosts("$net/$id");
update host information
$res = $fbx->upd_host("$net/$id", { id => $id , host_type => "networking_device" });
update lan config
$res = $fbx->upd_lan_config( {mode=>"router"} );
send wol
$res = $fbx->wol_host( $net, {mac => "B8:27:EB:73:8C:4E"} );
lcd
lcd
$res = $fbx->lcd;
lcd brightness back
$fbx->set_lcd({ brightness => $res->{brightness} });
nat
fw dmz
$fbx->fw_dmz;
fw all redir
$fbx->fw_redir;
fw redir
$fbx->fw_redir(0);
fw all incoming
$fbx->fw_incoming;
fw incoming
$fbx->fw_incoming("bittorent-main");
parental
parental config
$fbx->parental_config;
parental filter
$fbx->parental_filter;
share
share link
$fbx->share_link;
upload status
$fbx->upload;
upload status of a task
$fbx->upload(1);
airmedia config
$fbx->airmedia_config;
airmedia receivers
$fbx->airmedia_receivers;
shares
netshare samba
$res = $fbx->netshare_samba;
netshare afp
$fbx->netshare_afp;
storage
storage disk
$fbx->storage_disk;
storage partition
$fbx->storage_partition;
switch
switch status
$res = $fbx->switch_sts;
switch port config
$res = $fbx->switch_port(1);
switch port stats
$res = $fbx->switch_port("1/stats/");
set switch port config
$res = $fbx->set_switch_port(1 , {duplex=>"auto"} );
system
get system info
$fbx->system;
reboot system
$fbx->reboot;
upnp
upnpigd config
$fbx->upnpigd_config;
upnpigd redir
$fbx->upnpigd_redir;
upnpav
upnpav
$res=$fbx->upnpav;
set upnpav
$fbx->set_upnpav($res->{enabled});
vpn
vpn
$fbx->vpn;
vpn user
$fbx->vpn_user;
vpn ip_pool
$fbx->vpn_ip_pool;
vpn client config
$fbx->vpn_client_config;
vpn client status
$fbx->vpn_client_status;
vpn client log
$fbx->vpn_client_log;
wifi
wifi config
$fbx->wifi_config;
wifi ap list
$fbx->wifi_ap;
wifi ap
$fbx->wifi_ap(0);
wifi ap allowed combinations
$fbx->wifi_ap( "0/allowed_channel_comb" );
wifi ap connected stations
$fbx->wifi_ap( "0/stations" );
wifi ap neighbors
$fbx->wifi_ap( "0/neighbors" );
wifi ap channel usage
$fbx->wifi_ap( "0/channel_usage" );
wifi all bss
$fbx->wifi_bss;
wifi of a bss
$fbx->wifi_bss( "00:24:D4:AA:BB:CC" );
wifi planning
$fbx->wifi_planning;
wifi mac filter
$fbx->wifi_mac_filter;
LICENSE
Copyright (C) Laurent Kislaire.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
Laurent Kislaire <teebeenator@gmail.com>