mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-03 06:51:00 +02:00
release/v2.4 -> master (#844)
This commit is contained in:
parent
a24df8e990
commit
89cabee1b4
386 changed files with 7202 additions and 5741 deletions
|
|
@ -10,13 +10,13 @@ import json
|
|||
|
||||
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
|
||||
default_token = os.getenv("TRUSTGRAPH_TOKEN", None)
|
||||
default_user = "trustgraph"
|
||||
default_workspace = os.getenv("TRUSTGRAPH_WORKSPACE", "default")
|
||||
|
||||
def show_docs(url, user, token=None):
|
||||
def show_docs(url, token=None, workspace="default"):
|
||||
|
||||
api = Api(url, token=token).library()
|
||||
api = Api(url, token=token, workspace=workspace).library()
|
||||
|
||||
docs = api.get_documents(user=user)
|
||||
docs = api.get_documents()
|
||||
|
||||
if len(docs) == 0:
|
||||
print("No documents.")
|
||||
|
|
@ -60,9 +60,9 @@ def main():
|
|||
)
|
||||
|
||||
parser.add_argument(
|
||||
'-U', '--user',
|
||||
default=default_user,
|
||||
help=f'User ID (default: {default_user})'
|
||||
'-w', '--workspace',
|
||||
default=default_workspace,
|
||||
help=f'Workspace (default: {default_workspace})',
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
|
@ -71,8 +71,8 @@ def main():
|
|||
|
||||
show_docs(
|
||||
url = args.api_url,
|
||||
user = args.user,
|
||||
token = args.token,
|
||||
workspace = args.workspace,
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue