Skip to content

Commit

Permalink
feat: Add resources allocation-csv to det cli
Browse files Browse the repository at this point in the history
  • Loading branch information
varlogtim committed Jul 12, 2024
1 parent 7fab87b commit 80f8645
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions harness/determined/cli/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ def print_response(r: requests.Response) -> None:
sys.stdout.buffer.write(chunk)


def csv(args: argparse.Namespace) -> None:
sess = cli.setup_session(args)
params = {"timestamp_after": args.timestamp_after, "timestamp_before": args.timestamp_before}
path = "resources/allocation/allocations-csv"
print_response(sess.get(path, params=params))


def raw(args: argparse.Namespace) -> None:
sess = cli.setup_session(args)
params = {"timestamp_after": args.timestamp_after, "timestamp_before": args.timestamp_before}
Expand Down Expand Up @@ -40,6 +47,15 @@ def aggregated(args: argparse.Namespace) -> None:
None,
"query historical resource allocation",
[
cli.Cmd(
"all|ocations",
csv,
"get a detailed csv of resource allocation at an allocation level",
[
cli.Arg("timestamp_after"),
cli.Arg("timestamp_before"),
],
),
cli.Cmd(
"raw",
raw,
Expand Down

0 comments on commit 80f8645

Please sign in to comment.