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. 🚀
相关推荐
摆烂工程师1 小时前
(5千字总结)国内如何安装和使用 Claude Code 的保姆级教程 - 支持Mac和Windows用户
windows·macos·claude
Bruce_Liuxiaowei8 小时前
Netstat高级分析工具:Windows与Linux双系统兼容的精准筛查利器
linux·运维·网络·windows·安全
Par@ish8 小时前
【网络安全】恶意 Python 包“psslib”仿冒 passlib,可导致 Windows 系统关闭
windows·python·web安全
emplace_back18 小时前
C# 集合表达式和展开运算符 (..) 详解
开发语言·windows·c#
一禅(OneZen)1 天前
「Windows/Mac OS」AIGC图片生成视频 ,webui + stable-diffusion环境部署教程
windows·stable diffusion
AirDroid_cn1 天前
OPPO手机怎样被其他手机远程控制?两台OPPO手机如何相互远程控制?
android·windows·ios·智能手机·iphone·远程工作·远程控制
小龙在山东1 天前
Python 包管理工具 uv
windows·python·uv
昏睡红猹1 天前
我在厂里搞wine的日子
windows·wine
love530love1 天前
Docker 稳定运行与存储优化全攻略(含可视化指南)
运维·人工智能·windows·docker·容器
1024小神1 天前
tauri项目在windows上的c盘没有权限写入文件
c语言·开发语言·windows