chore(openmetadata): add inventory probe; full-stack ingestion verified (177 tables, +Kafka/S3/Superset)
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Report what OpenMetadata currently knows vs nothing — services, dbs, schemas, tables."""
|
||||
import om_api as o
|
||||
|
||||
st, d = o.login("admin@open-metadata.org", "admin")
|
||||
tok = d["accessToken"]
|
||||
|
||||
|
||||
def g(p):
|
||||
return o.req("GET", p, token=tok)[1]
|
||||
|
||||
|
||||
print("=== DATABASE SERVICES ===")
|
||||
s = g("/api/v1/services/databaseServices?limit=100")
|
||||
for sv in s.get("data", []):
|
||||
name = sv["name"]
|
||||
# tables under this service
|
||||
t = g("/api/v1/tables?limit=1&service=" + name)
|
||||
print(" %-22s type=%-12s tables=%s" % (name, sv.get("serviceType"), t.get("paging", {}).get("total")))
|
||||
print(" total services:", s.get("paging", {}).get("total"))
|
||||
|
||||
print()
|
||||
for kind in ("messagingServices", "pipelineServices", "storageServices",
|
||||
"dashboardServices", "mlmodelServices", "searchServices", "apiServices"):
|
||||
s = g("/api/v1/services/" + kind + "?limit=100")
|
||||
names = [sv["name"] for sv in s.get("data", [])]
|
||||
print("%-20s total=%s %s" % (kind, s.get("paging", {}).get("total"), names))
|
||||
|
||||
print()
|
||||
print("=== DATABASES / SCHEMAS per service ===")
|
||||
s = g("/api/v1/services/databaseServices?limit=100")
|
||||
for sv in s.get("data", []):
|
||||
name = sv["name"]
|
||||
dbs = g("/api/v1/databases?service=" + name + "&limit=100")
|
||||
for db in dbs.get("data", []):
|
||||
dbfqn = db["fullyQualifiedName"]
|
||||
sch = g("/api/v1/databaseSchemas?database=" + dbfqn + "&limit=100")
|
||||
schnames = [x["name"] for x in sch.get("data", [])]
|
||||
print(" %s.%s schemas=%s" % (name, db["name"], schnames))
|
||||
|
||||
print()
|
||||
print("=== TABLES total:", g("/api/v1/tables?limit=1").get("paging", {}).get("total"))
|
||||
Reference in New Issue
Block a user