From 6defd70a2df0975ee22b09018a9dc709a7933200 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 6 Apr 2022 09:51:31 +0300 Subject: feat! add chunk server API version to HTTP paths What was /chunks is now /v1/chunks. This is the minimal step to start supporting multiple API versions. Also, /v1/chunks/foo/bar is no longer supported. Sponsored-by: author --- subplot/server.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'subplot/server.py') diff --git a/subplot/server.py b/subplot/server.py index de63836..1f4506f 100644 --- a/subplot/server.py +++ b/subplot/server.py @@ -53,7 +53,7 @@ def stop_chunk_server(ctx, env=None): def post_file(ctx, filename=None, path=None, header=None, json=None): - url = f"{ctx['server_url']}/chunks" + url = f"{ctx['server_url']}/v1/chunks" headers = {header: json} data = open(filename, "rb").read() _request(ctx, requests.post, url, headers=headers, data=data) @@ -65,12 +65,12 @@ def get_chunk_via_var(ctx, var=None): def get_chunk_by_id(ctx, chunk_id=None): - url = f"{ctx['server_url']}/chunks/{chunk_id}" + url = f"{ctx['server_url']}/v1/chunks/{chunk_id}" _request(ctx, requests.get, url) def find_chunks_with_label(ctx, sha=None): - url = f"{ctx['server_url']}/chunks?label={sha}" + url = f"{ctx['server_url']}/v1/chunks?label={sha}" _request(ctx, requests.get, url) @@ -80,7 +80,7 @@ def delete_chunk_via_var(ctx, var=None): def delete_chunk_by_id(ctx, chunk_id=None): - url = f"{ctx['server_url']}/chunks/{chunk_id}" + url = f"{ctx['server_url']}/v1/chunks/{chunk_id}" _request(ctx, requests.delete, url) -- cgit v1.2.1