hi, how would i create a branch in lakefs using th...
# help
u
hi, how would i create a branch in lakefs using the REST api, that starts at a specific commit id or tag?
u
i tried passing in a source of
lakefs://<repo>/<tag>
as well as
lakefs://<repo>/<commit id>
but i keep getting a 500 internal server error
u
the endpoint (POST) is
https://<our lake fs installation>/api/v1/repositories/origin/branches?repository=origin
with a JSON payload of:
Copy code
{"name": "my_branch", source: "<lakefs://origin/my_tag>"}
where
my_tag
is a pre-existing tag
u
on the command line however i can issue this to create a branch from an existing tag, and it works fine:
Copy code
lakectl branch create <lakefs://origin/verun-test-20220221> --source <lakefs://origin/my_tag/>
u
u
hey so that’s the documentation i’ve been following
u
i’m also now trying to use the python lakefs client
u
but i keep getting this error:
u
{“message”:“source reference ‘<lakefs://origin/my_tag/>’: not found”}
even though the tag does exist
u
nm, got the python client working - thanks!
u
Thanks for the update, let me know if you are running into any other issue
u
for the api try
Copy code
https://<our lake fs installation>/api/v1/repositories/origin/branches
with payload
Copy code
{"name": "my_branch", source: "<lakefs://origin/my_tag>"}