Example script
import humanize
from tabulate import tabulate
from ansys.hps.client import Client, ProjectApi
project_id = "02vna3Aap8ZEkykK0j52Uj"
job_id = "02vna3DVqDW2CgQrRe3X34"
cl = Client(
url="https://localhost:8443/hps",
username="repuser",
password="repuser",
verify=False
)
project_api = ProjectApi(cl, project_id)
job = project_api.get_jobs(id=[job_id], fields=["id", "file_ids"])[0]
query_params = {"id": job.file_ids, "hash.ne": "null"}
files = project_api.get_files(**query_params)
table_data = [['Name', 'Path', 'Size', 'Last Modified']]
table_data.extend(
[[
f.name,
f.evaluation_path,
humanize.naturalsize(f.size),
humanize.naturaltime(f.modification_time)
] for f in files]
)
print(tabulate(table_data, headers="firstrow"))
Example script