mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-22 03:31:02 +02:00
Add pulsar API token check
This commit is contained in:
parent
d0ae772fd6
commit
a5d5b4ca4a
56 changed files with 319 additions and 82 deletions
|
|
@ -13,10 +13,11 @@ import io
|
|||
import sys
|
||||
|
||||
default_pulsar_host = os.getenv("PULSAR_HOST", 'pulsar://localhost:6650')
|
||||
default_pulsar_api_key = os.getenv("PULSAR_API_KEY", None)
|
||||
|
||||
def show_graph(pulsar):
|
||||
def show_graph(pulsar, pulsar_api_key=None):
|
||||
|
||||
tq = TriplesQueryClient(pulsar_host=pulsar)
|
||||
tq = TriplesQueryClient(pulsar_host=pulsar, pulsar_api_key=pulsar_api_key)
|
||||
|
||||
rows = tq.request(None, None, None, limit=10_000_000)
|
||||
|
||||
|
|
@ -60,12 +61,18 @@ def main():
|
|||
default=default_pulsar_host,
|
||||
help=f'Pulsar host (default: {default_pulsar_host})',
|
||||
)
|
||||
|
||||
|
||||
parser.add_argument(
|
||||
'--pulsar-api-key',
|
||||
default=default_pulsar_api_key,
|
||||
help=f'Pulsar API key',
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
try:
|
||||
|
||||
show_graph(args.pulsar_host)
|
||||
show_graph(args.pulsar_host, pulsar_api_key=args.pulsar_api_key)
|
||||
|
||||
except Exception as e:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue