init: workspace opencode sync

This commit is contained in:
2026-08-15 00:28:08 +07:00
commit 2451170708
122 changed files with 10549 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
import librouteros
api = librouteros.connect('192.168.100.2', 'mi4', 'm14', port=8728)
# Test 1: Set comment on Bulanan2
items = list(api('/system/scheduler/print'))
for item in items:
if item['name'] == 'Bulanan2':
print(f'Bulanan2 .id = {item[".id"]}')
print(f'Current comment: {item.get("comment")}')
# Set comment
result = list(api('/system/scheduler/set', **{'.id': item['.id'], 'comment': 'TEST_FIX_123'}))
print(f'Set result: {result}')
break
# Re-read
items = list(api('/system/scheduler/print'))
for item in items:
if item['name'] == 'Bulanan2':
print(f'Comment after set: {item.get("comment")}')
# Test 2: Set on-event with simple value
simple_script = ':put "hello world"'
items = list(api('/system/scheduler/print', **{'?name': 'Bulanan2'}))
if items:
item = items[0]
print(f'Setting on-event to simple script...')
result = list(api('/system/scheduler/set', **{'.id': item['.id'], 'on-event': simple_script, 'comment': 'Monitor Profile Bulanan2'}))
print(f'Result: {result}')
# Re-read
items = list(api('/system/scheduler/print', **{'?name': 'Bulanan2'}))
if items:
print(f'On-event after: {items[0].get("on-event")[:100]}')
api.close()