def delete_experiment(args: Namespace) -> None: if args.yes or render.yes_or_no( "Deleting an experiment will result in the unrecoverable \n" "deletion of all associated logs, checkpoints, and other \n" "metadata associated with the experiment. For a recoverable \n" "alternative, see the 'det archive' command. Do you still \n" "wish to proceed?" ): api.delete(args.master, "/api/v1/experiments/{}".format(args.experiment_id)) print("Successfully deleted experiment {}".format(args.experiment_id)) else: print("Aborting experiment deletion.")
def kill_shell(args: Namespace) -> None: for i, nid in enumerate(args.shell_id): try: api.delete(args.master, "shells/{}".format(nid)) print(colored("Killed shell {}".format(nid), "green")) except api.errors.APIException as e: if not args.force: for ignored in args.shell_id[i + 1:]: print("Cowardly not killing {}".format(ignored)) raise e print( colored("Skipping: {} ({})".format(e, type(e).__name__), "red"))
def remove_templates(args: Namespace) -> None: api.delete(args.master, path="templates/" + args.template_name) print(colored("Removed template {}".format(args.template_name), "green"))
def remove_client(parsed_args: Namespace) -> None: try: api.delete(parsed_args.master, "oauth2/clients/{}".format(parsed_args.client_id)) except NotFoundException: raise EnterpriseOnlyError("API not found: oauth2/clients")