inhibitor_tool

inhibitor_tool

Introduction

inhibitor_tool is a Python CLI tool for adding items to an inhibition list via an API, with authentication handled via auth_token.

Installation

link: https://pypi.org/project/inhibitor-tool/

bash 复制代码
pip3 install inhibitor_tool==5.2.1




---

**inhibitor_tool**  

📌 Introduction  

inhibitor_tool is a Python CLI tool that allows users to send inhibition requests via an API.  
It supports authentication through environment variables loaded from auth_token.  


---

🛠 Installation  
You can install the package using pip:  

pip3 install inhibitor_tool


---

🔧 Configuration  

1️⃣ Set Up Authentication  
Before using inhibitor_tool, you must configure authentication credentials in ~/.auth_token and load them into the environment:  

export USERNAME=mmwei3
export PASSWORD=mmwei
export LOGIN_URL=http:///api/v1/user/login
export INHIBIT_URL=http:///api/v1/alarm/blacklist
export REMOVE_URL=http://api/v1/alarm/blacklist
export LIST_URL=http:///api/v1/alarm/blacklist?

source ~/.auth_token

💡 Important: The source ~/.auth_token command must be executed every time a new session is started.


---


---

🚀 Usage  

2️⃣ Inhibit an Item (Default TTL: 3 hours)  
[root@domp ~]# inhibitor-tool  --help
usage: inhibitor-tool [-h] [--version] {add,remove,list} ...

CLI tool for inhibition requests.

positional arguments:
  {add,remove,list}  Available commands
    add              Send an inhibition request.
    remove           Remove an inhibition request.
    list             List all active inhibitions.

optional arguments:
  -h, --help         show this help message and exit
  --version, -V      Show program's version number and exit.
[root@domp ~]#



inhibitor-tool add --content "MaliciousIP:192.168.1.1"

3️⃣ Specify a Custom TTL  
inhibitor-tool add --content "MaliciousIP:192.168.1.1" --ttl 6
- --ttl 6 means the inhibition will last 6 hours (default is 3 hours).  

4️⃣ Add a Custom Remark  
inhibitor-tool add --content "MaliciousIP:192.168.1.1" --ttl 6 --remark "Security alert"
- The remark helps track the reason for inhibition.  
- If omitted, it defaults to "tmp_inhibitor".

5️⃣ Remove an Inhibition  
inhibitor-tool remove --content "MaliciousIP:192.168.1.1"
- This command removes an inhibition entry matching the provided content.  

6️⃣ List Active Inhibitions  
inhibitor-tool list
- Displays active inhibitions in a shell-friendly table format.

🔹 JSON Output Format  
inhibitor-tool list --json
- Outputs inhibition data in JSON format, suitable for scripting.

7️⃣ Check Version  
inhibitor-tool --version
inhibitor-tool -V


---

2️⃣ Inhibit an Item (Default TTL: 3 hours)  
inhibitor-tool --content "MaliciousIP:192.168.1.1"

3️⃣ Specify a Custom TTL  

[root@domp ~]# inhibitor-tool  --help
usage: inhibitor-tool [-h] [--version] {add,remove,list} ...

CLI tool for inhibition requests.

positional arguments:
  {add,remove,list}  Available commands
    add              Send an inhibition request.
    remove           Remove an inhibition request.
    list             List all active inhibitions.

optional arguments:
  -h, --help         show this help message and exit
  --version, -V      Show program's version number and exit.
[root@domp ~]#





inhibitor-tool add  --content "MaliciousIP:192.168.1.1" --ttl 6
- --ttl 6 means the inhibition will last 6 hours (default is 3 hours).  

4️⃣ Add a Custom Remark  
inhibitor-tool add  --content "MaliciousIP:192.168.1.1" --ttl 6 --remark "Security alert"
- The remark helps track the reason for inhibition.  
- If omitted, it defaults to "tmp_inhibitor".


---

📜 Open-Source Information  
- Author: mmwei3  
- Email: mmwei3@iflytek.com  
- Contact: 178555350258  
- Date: 2025-03-19  
- License: MIT License  


---

📦 Packaging & Deployment  

5️⃣ Build the Package  
python setup.py sdist bdist_wheel

6️⃣ Install from Local Package  
pip install dist/inhibitor_tool-1.0.0-py3-none-any.whl

7️⃣ Uninstall the Package  
pip uninstall inhibitor_tool


---

📜 License (MIT)  
MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...


---

**📌 Dependencies (requirements.txt)**  
requests


---

This README.md provides a clear, structured, and fully configurable CLI tool for API-based inhibition with authentication and pip installation. 🚀
相关推荐
路由侠内网穿透2 天前
本地部署 GPS 跟踪系统 Traccar 并实现外部访问
运维·服务器·网络·windows·tcp/ip
研华嵌入式2 天前
如何在高通跃龙QCS6490 Arm架构上使用Windows 11 IoT企业版?
arm开发·windows·嵌入式硬件
带娃的IT创业者2 天前
Windows 平台上基于 MCP 构建“文心一言+彩云天气”服务实战
人工智能·windows·文心一言·mcp
csdn_aspnet2 天前
Windows Node.js 安装及环境配置详细教程
windows·node.js
摇滚侠2 天前
java语言中,list<String>转成字符串,逗号分割;List<Integer>转字符串,逗号分割
java·windows·list
Source.Liu2 天前
【Pywinauto库】12.2 pywinauto.element_info 后端内部实施模块
windows·python·自动化
Source.Liu2 天前
【Pywinauto库】12.1 pywinauto.backend 后端内部实施模块
开发语言·windows·python·自动化
私人珍藏库2 天前
[Windows] FileOptimizer v17.1.0_一款文件批量压缩工具
windows·批量压缩
掘根2 天前
【CMake】List
windows·microsoft·list
TToolss2 天前
删除文件夹里的网盘图标
windows