| name | ordine-list-entities |
| description | Use when 需要在 Ordine 系统中列出或发现已有的 Operation、Pipeline、Best Practice 等实体以复用,避免重复创建。触发词:list entities、列出operation、查找pipeline、有没有已有的、复用检查、发现实体。 |
列出与发现实体
概述
在创建新的 Operation、Pipeline 或 Best Practice 之前,应先搜索系统中是否已存在可复用的实体。Ordine 的 REST API 提供全量列表接口,通过客户端过滤实现搜索。
搜索方法
搜索 Operation
curl -s http://localhost:9433/api/operations | python3 -m json.tool
curl -s http://localhost:9433/api/operations | \
python3 -c "
import sys, json
ops = json.load(sys.stdin)
keyword = 'lint'
for op in ops:
if keyword.lower() in op['name'].lower() or keyword.lower() in (op.get('description') or '').lower():
print(f\"{op['id']}: {op['name']} — {op.get('description', '')}\")"
搜索 Pipeline
curl -s http://localhost:9433/api/pipelines | python3 -m json.tool
curl -s http://localhost:9433/api/pipelines | \
python3 -c "
import sys, json
pipes = json.load(sys.stdin)
keyword = 'dao'
for p in pipes:
if keyword.lower() in p['name'].lower() or keyword.lower() in (p.get('description') or '').lower():
print(f\"{p['id']}: {p['name']} — {p.get('description', '')}\")"
搜索 Best Practice
curl -s http://localhost:9433/api/best-practices | python3 -m json.tool
curl -s http://localhost:9433/api/best-practices | \
python3 -c "
import sys, json
bps = json.load(sys.stdin)
keyword = 'naming'
for bp in bps:
if keyword.lower() in bp['name'].lower() or keyword.lower() in (bp.get('description') or '').lower():
print(f\"{bp['id']}: {bp['name']} — {bp.get('description', '')}\")"