← 返回
未分类 中文

Consul Service Deregister

Consul service deregistration tool. Triggered when users mention Consul deregister, remove service instance, service removal, or offline. Supports batch dere...
Consul 服务注销工具。用户提及 Consul注销、移除服务实例、服务移除或下线时触发,支持批量注销。
strongant
未分类 clawhub v1.0.4 1 版本 100000 Key: 无需
★ 0
Stars
📥 388
下载
💾 1
安装
1
版本
#latest

概述

Consul Service Deregister

Deregister service instances from Consul via the HTTP API.

Usage

Mode 1: Service ID + Agent List (Most Common)

User: Deregister service my-service-id on consul-agent-1, consul-agent-2, and consul-agent-3

AI executes:

python3 /Users/shiheng/.qclaw/workspace/skills/consul-deregister/scripts/deregister.py \
  --service-id my-service-id \
  --agents http://<CONSUL_HOST_1>:8500 http://<CONSUL_HOST_2>:8500 http://<CONSUL_HOST_3>:8500

Mode 2: Paste Raw curl Commands (Easiest)

User pastes existing curl commands, AI parses and replays them:

User: Execute these deregister commands:
      curl -XPUT http://<CONSUL_HOST_1>:8500/v1/agent/service/deregister/<SERVICE_ID>
      curl -XPUT http://<CONSUL_HOST_2>:8500/v1/agent/service/deregister/<SERVICE_ID>

AI executes:

python3 /Users/shiheng/.qclaw/workspace/skills/consul-deregister/scripts/deregister.py \
  --from-curl "curl -XPUT http://<CONSUL_HOST>:8500/v1/agent/service/deregister/<SERVICE_ID> ..."

Mode 3: Read Agent List from File

python3 /Users/shiheng/.qclaw/workspace/skills/consul-deregister/scripts/deregister.py \
  --service-id my-service-id \
  --agents-file ./agents.txt

agents.txt format (supports # comments):

# Consul Agent node list
<CONSUL_HOST_1>:8500
<CONSUL_HOST_2>:8500
<CONSUL_HOST_3>:8500

Dry-Run Preview

Add --dry-run to any mode to preview the requests without actually sending them:

python3 /Users/shiheng/.qclaw/workspace/skills/consul-deregister/scripts/deregister.py \
  --service-id my-service-id \
  --agents http://<CONSUL_HOST_1>:8500 http://<CONSUL_HOST_2>:8500 \
  --dry-run

With ACL Token

python3 /Users/shiheng/.qclaw/workspace/skills/consul-deregister/scripts/deregister.py \
  --service-id my-service-id \
  --agents http://<CONSUL_HOST>:8500 \
  --token your-consul-acl-token

Common Workflows

Scenario 1: Batch Deregister Gray Nodes

User provides a service ID and multiple IP:port pairs.

Scenario 2: Release Rollback

User triggers rollback; AI finds the old version's service ID from config/docs and deregisters.

Scenario 3: Service Migration

Moving a service from old cluster to new cluster — deregister from all old cluster nodes first.

Notes

  • service-id must exactly match the ID registered in Consul (no extra spaces)
  • Agent addresses accept both host:port and full URL (http://host:port) — auto-completed
  • Parallel requests by default (up to 10 concurrent), automatic speedup for many nodes
  • Non-zero exit code on any failure; AI will surface failure details
  • Use --json for JSON output suitable for scripting / pipeline integration

版本历史

共 1 个版本

  • v1.0.4 当前
    2026-05-03 11:17 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,363 📥 319,063
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,062 📥 800,187
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 672 📥 324,539