diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-04-06 09:51:31 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-04-06 09:51:31 +0300 |
commit | 6defd70a2df0975ee22b09018a9dc709a7933200 (patch) | |
tree | f161b7958c3e6975d0bc2dbdef2bf3175e4d6216 /subplot/server.py | |
parent | 1c6ae813b00e46d2a8061fa480d1780124af1e64 (diff) | |
download | obnam2-6defd70a2df0975ee22b09018a9dc709a7933200.tar.gz |
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
Diffstat (limited to 'subplot/server.py')
-rw-r--r-- | subplot/server.py | 8 |
1 files changed, 4 insertions, 4 deletions
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) |