Community discussions

 
User avatar
vklpt
just joined
Topic Author
Posts: 15
Joined: Mon Feb 18, 2019 1:13 pm
Location: Izhevsk
Contact:

Scheduler with API support

Sun Jul 14, 2019 2:06 pm

https://github.com/vikilpet/Taskopy

Open source Python scheduler for Windows with RouterOS API support.

Example — add IP from clipboard to address-list "my_list":
def add_ip_to_list(hotkey='alt+ctrl+i'):
    routeros_send(
        [
            '/ip/firewall/address-list/add'
            , '=list=my_list'
            , '=address=' + clip_get()
        ]
        , device_ip='192.168.88.1'
        , device_user='admin'
        , device_pwd='PaSsWoRd'
    )
    msgbox('Done!', timeout=5)

Example — add address to list with HTTP-request:
def address_from_web(data, http=True, submenu='Rare'):
	routeros_send(
		[
			'/ip/firewall/address-list/add'
			, '=list=' + data.listname
			, '=address=' + data.address
		]
		, device_ip='192.168.88.1'
		, device_user='admin'
		, device_pwd='PaSSWorD'
	)
Then you can add address to any address-list with this HTTP request:
http://127.0.0.1/task?address_from_web&listname=my_list&address=1.2.3.4

Who is online

Users browsing this forum: Bing [Bot] and 14 guests