Skip to main content

A Python client for interacting with IKuai routers

Project description

PyIKuaiClient

A Python client for interacting with IKuai routers.

How to install

pip install pyikuai

Usage

from pyikuai import IKuaiClient

ikuai_client = IKuaiClient(
    url="http://192.168.1.1",
    username="your/ikuai/username",
    password="your/ikuai/password"
)

Implemented functionality

mac_group

>>> ikuai_client.list_mac_groups()  # get the mac_groups configured
{'total': 2,
 'data': [{'id': 1,
   'comment': '',
   'group_name': 'IPAD',
   'addr_pool': '34:b8:ec:42:91:2d'},
  {'id': 2,
   'comment': 'foo,%20bar',
   'group_name': 'test',
   'addr_pool': '43:a9:fc:43:97:3d,43:a9:fc:43:97:3f'}]}
>>> ikuai_client.del_mac_group(group_id=3)  # delete mac_group with id 3
{'Result': 30000, 'ErrMsg': 'Success'}  # succeed even that id does not exists.
>>> ikuai_client.add_mac_group(
    group_name="test2",
    addr_pools=['43:a9:fc:43:97:3d', '43:a9:fc:43:97:3f'],
    comments=["foo2", "bar2"])

{'Result': 30000, 'ErrMsg': 'Success', 'RowId': 3}
>>> ikuai_client.edit_mac_group(  # update mac_group id 3 with new comments
    group_id=3,
    group_name="test2", 
    addr_pools=['43:a9:fc:43:97:3d', '43:a9:fc:43:97:3f'],
    comments=["foo3", "bar3"])

{'Result': 30000, 'ErrMsg': 'Success'}

acl_l7

The functionality related to behavioral control of devices connected, via protocol. The implemented methods include add_acl_l7, list_acl_l7, edit_acl_l7, del_acl_l7, disable_acl_l7, enable_acl_l7.

domain_blacklist

The functionality related to behavioral control of devices connected, via domain blacklist. The implemented methods include add_domain_blacklist, list_domain_blacklist, edit_domain_blacklist, del_domain_blacklist, disable_domain_blacklist, enable_domain_blacklist

sysstat

Get the system statistics.

>>> ikuai_client.get_sysstat()
{'verinfo': {'modelname': '',
  'verstring': '3.7.10 x32 Build202401231339',
  'version': '3.7.10',
  'build_date': 202401231339,
  'arch': 'x86',
  'sysbit': 'x32',
  'verflags': '',
  'is_enterprise': 0,
  'support_i18n': 0,
  'support_dingtalk': 1,
  'support_lcd': 0,
  'bootguide': 'hd'},
 'cpu': ['0.00%', '0.00%'],
 'memory': {'total': 886264,
  'available': 618720,
  'free': 538644,
  'cached': 45460,
  'buffers': 69132,
  'used': '30%'},
 'stream': {'connect_num': 52,
  'upload': 821,
  'download': 432,
  'total_up': 671137724,
  'total_down': 4459837833},
 'cputemp': []}
>>> ikuai_client.get_sysstat(["verinfo"])
{'verinfo': {'modelname': '',
  'verstring': '3.7.10 x32 Build202401231339',
  'version': '3.7.10',
  'build_date': 202401231339,
  'arch': 'x86',
  'sysbit': 'x32',
  'verflags': '',
  'is_enterprise': 0,
  'support_i18n': 0,
  'support_dingtalk': 1,
  'support_lcd': 0,
  'bootguide': 'hd'}}

monitor_lanip & monitor_lanipv6

Get the monitor list of lanip (v4) or lanipv6. For v4, use ikuai_client.list_monitor_lanip(). For v6, use ikuai_client.list_monitor_lanip(ip_type='v6') .

acl_mac

The access control of device via mac address. The implemented methods include: add_acl_mac, list_acl_mac, edit_acl_mac, del_acl_mac, enable_acl_mac, disable_acl_mac.

mac_comment

The management of alias of devices, mapping mac addresses. The implemented methods include: add_mac_comment, list_mac_comment, edit_mac_comment, del_mac_comment.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyikuai-0.3.0.dev0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

pyikuai-0.3.0.dev0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file pyikuai-0.3.0.dev0.tar.gz.

File metadata

  • Download URL: pyikuai-0.3.0.dev0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for pyikuai-0.3.0.dev0.tar.gz
Algorithm Hash digest
SHA256 dff12ec3a4a3c5b9c18a025e37447578bb9ba4365ea942c7f83d5ab1a8b9af6f
MD5 465de944bfd75e58292bbe1bc8a1097a
BLAKE2b-256 3c5cc4a33c6e2037d687799891755fc217f2d7c4619cdd91b4d03e35038c19ef

See more details on using hashes here.

File details

Details for the file pyikuai-0.3.0.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyikuai-0.3.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 9f7a882dcc5fc23e5993ca5ae966cc3b47febc31ab4e2a87b54b7618ba3105ed
MD5 510b0a184d053ed331c7a2edcde681ad
BLAKE2b-256 1b09e3fbd49dfb98d3dacf0af6238f9de72de57a538b718d1125ed4e52ec9248

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page