pyikuai


Namepyikuai JSON
Version 0.4.0.dev0 PyPI version JSON
download
home_pagehttps://github.com/dzhuang/PyIKuaiClient/
SummaryA Python client for interacting with IKuai routers
upload_time2024-02-18 17:47:18
maintainer
docs_urlNone
authorDong Zhuang
requires_python>=3.6
licenseMIT
keywords ikuai router client api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PyIKuaiClient

A Python client for interacting with IKuai routers.

## How to install

```bash
pip install pyikuai
```

## Usage

```python
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

```python

>>> 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. 

```python
>>> 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`.

### mac_qos

The interface for limiting download/upload speed of devices, mapping mac addresses. The implemented methods include: `add_mac_qos`, `list_mac_qos`, `edit_mac_qos`, `del_mac_qos`, `enable_mac_qos`, `disable_mac_qos`.

### url_black

Blacklisting or whitelisting url for accessing, mapping mac addresses. The implemented methods include: `add_url_black`, `list_url_black`, `edit_url_black`, `del_url_black`, `enable_url_black`, `disable_url_black`.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dzhuang/PyIKuaiClient/",
    "name": "pyikuai",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "iKuai Router client API",
    "author": "Dong Zhuang",
    "author_email": "dzhuang.scut@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/27/80/afb99553c4665080ac1ebbd966ff3e9fd62dc254db6cdde6a6d238b816e9/pyikuai-0.4.0.dev0.tar.gz",
    "platform": null,
    "description": "# PyIKuaiClient\n\nA Python client for interacting with IKuai routers.\n\n## How to install\n\n```bash\npip install pyikuai\n```\n\n## Usage\n\n```python\nfrom pyikuai import IKuaiClient\n\nikuai_client = IKuaiClient(\n    url=\"http://192.168.1.1\",\n    username=\"your/ikuai/username\",\n    password=\"your/ikuai/password\"\n)\n\n```\n\n## Implemented functionality\n\n### mac_group\n\n```python\n\n>>> ikuai_client.list_mac_groups()  # get the mac_groups configured\n{'total': 2,\n 'data': [{'id': 1,\n   'comment': '',\n   'group_name': 'IPAD',\n   'addr_pool': '34:b8:ec:42:91:2d'},\n  {'id': 2,\n   'comment': 'foo,%20bar',\n   'group_name': 'test',\n   'addr_pool': '43:a9:fc:43:97:3d,43:a9:fc:43:97:3f'}]}\n>>> ikuai_client.del_mac_group(group_id=3)  # delete mac_group with id 3\n{'Result': 30000, 'ErrMsg': 'Success'}  # succeed even that id does not exists.\n>>> ikuai_client.add_mac_group(\n    group_name=\"test2\",\n    addr_pools=['43:a9:fc:43:97:3d', '43:a9:fc:43:97:3f'],\n    comments=[\"foo2\", \"bar2\"])\n\n{'Result': 30000, 'ErrMsg': 'Success', 'RowId': 3}\n>>> ikuai_client.edit_mac_group(  # update mac_group id 3 with new comments\n    group_id=3,\n    group_name=\"test2\", \n    addr_pools=['43:a9:fc:43:97:3d', '43:a9:fc:43:97:3f'],\n    comments=[\"foo3\", \"bar3\"])\n\n{'Result': 30000, 'ErrMsg': 'Success'}\n```\n\n### acl_l7\n\nThe functionality related to behavioral control of devices connected, via protocol. \nThe implemented methods include\n`add_acl_l7`, `list_acl_l7`, `edit_acl_l7`, `del_acl_l7`, `disable_acl_l7`, `enable_acl_l7`.\n\n\n### domain_blacklist\n\nThe functionality related to behavioral control of devices connected, via domain blacklist.\nThe implemented methods include\n`add_domain_blacklist`, `list_domain_blacklist`, `edit_domain_blacklist`, `del_domain_blacklist`,\n`disable_domain_blacklist`, `enable_domain_blacklist`\n\n\n### sysstat\n\nGet the system statistics. \n\n```python\n>>> ikuai_client.get_sysstat()\n{'verinfo': {'modelname': '',\n  'verstring': '3.7.10 x32 Build202401231339',\n  'version': '3.7.10',\n  'build_date': 202401231339,\n  'arch': 'x86',\n  'sysbit': 'x32',\n  'verflags': '',\n  'is_enterprise': 0,\n  'support_i18n': 0,\n  'support_dingtalk': 1,\n  'support_lcd': 0,\n  'bootguide': 'hd'},\n 'cpu': ['0.00%', '0.00%'],\n 'memory': {'total': 886264,\n  'available': 618720,\n  'free': 538644,\n  'cached': 45460,\n  'buffers': 69132,\n  'used': '30%'},\n 'stream': {'connect_num': 52,\n  'upload': 821,\n  'download': 432,\n  'total_up': 671137724,\n  'total_down': 4459837833},\n 'cputemp': []}\n>>> ikuai_client.get_sysstat([\"verinfo\"])\n{'verinfo': {'modelname': '',\n  'verstring': '3.7.10 x32 Build202401231339',\n  'version': '3.7.10',\n  'build_date': 202401231339,\n  'arch': 'x86',\n  'sysbit': 'x32',\n  'verflags': '',\n  'is_enterprise': 0,\n  'support_i18n': 0,\n  'support_dingtalk': 1,\n  'support_lcd': 0,\n  'bootguide': 'hd'}}\n```\n\n### monitor_lanip & monitor_lanipv6\n\nGet 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')`` .\n\n\n### acl_mac\n\nThe 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`.\n\n### mac_comment\n\nThe management of alias of devices, mapping mac addresses. The implemented methods include: `add_mac_comment`, `list_mac_comment`, `edit_mac_comment`, `del_mac_comment`.\n\n### mac_qos\n\nThe interface for limiting download/upload speed of devices, mapping mac addresses. The implemented methods include: `add_mac_qos`, `list_mac_qos`, `edit_mac_qos`, `del_mac_qos`, `enable_mac_qos`, `disable_mac_qos`.\n\n### url_black\n\nBlacklisting or whitelisting url for accessing, mapping mac addresses. The implemented methods include: `add_url_black`, `list_url_black`, `edit_url_black`, `del_url_black`, `enable_url_black`, `disable_url_black`.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python client for interacting with IKuai routers",
    "version": "0.4.0.dev0",
    "project_urls": {
        "Homepage": "https://github.com/dzhuang/PyIKuaiClient/"
    },
    "split_keywords": [
        "ikuai",
        "router",
        "client",
        "api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8b4768e44725a68acaf28025134c27d90a68ab13a6d24865c7cadc7f8925c773",
                "md5": "98fe2efc769ced4ba54b5d2f7abdbf95",
                "sha256": "500d0a8a8705afccc384650f57b7a44d1b8fca2841b86d8e35afbb5799e7ee60"
            },
            "downloads": -1,
            "filename": "pyikuai-0.4.0.dev0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "98fe2efc769ced4ba54b5d2f7abdbf95",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 9765,
            "upload_time": "2024-02-18T17:47:17",
            "upload_time_iso_8601": "2024-02-18T17:47:17.324141Z",
            "url": "https://files.pythonhosted.org/packages/8b/47/68e44725a68acaf28025134c27d90a68ab13a6d24865c7cadc7f8925c773/pyikuai-0.4.0.dev0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2780afb99553c4665080ac1ebbd966ff3e9fd62dc254db6cdde6a6d238b816e9",
                "md5": "c60ca8f87d9095a4e2feff0943570438",
                "sha256": "513df5fb117e20e78bef5ba016c836f0c52a75367a954fb6aa0ed8204724bc79"
            },
            "downloads": -1,
            "filename": "pyikuai-0.4.0.dev0.tar.gz",
            "has_sig": false,
            "md5_digest": "c60ca8f87d9095a4e2feff0943570438",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 10866,
            "upload_time": "2024-02-18T17:47:18",
            "upload_time_iso_8601": "2024-02-18T17:47:18.612261Z",
            "url": "https://files.pythonhosted.org/packages/27/80/afb99553c4665080ac1ebbd966ff3e9fd62dc254db6cdde6a6d238b816e9/pyikuai-0.4.0.dev0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-18 17:47:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dzhuang",
    "github_project": "PyIKuaiClient",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pyikuai"
}
        
Elapsed time: 0.42487s