https://lakefs.io/ logo
#help
Title
# help
a

Alessandro Mangone

12/02/2022, 10:39 AM
Hi, For my use case I’m using Spark on Scala and I’m using the
LakeFSClient
class. I’ve noticed that while on python client the commits api are exposed, this doesn’t happen on the Java counterpart. Is this something missing or is there a reason for the CommitsApi not being exposed there?
b

Barak Amar

12/02/2022, 10:43 AM
Hi @Alessandro Mangone yes, it looks like missing functionality in the client helper.
I'll open a bug and make sure it will be fixed for the next release of lakeFS.
For now you can instance ApiClient and use the ref api directly
👍 1
I'll paste an example
Copy code
ApiClient client = new ApiClient();
        client.setBasePath("<lakefs endpoint>/api/v1");
        client.setUsername("<key>");
        client.setPassword("<secret>");

        CommitsApi api = new CommitsApi(client);
        Commit response = api.commit("repo", "main", new CommitCreation().message("message"), "");
@Alessandro Mangone it looks I had it wrong the LakeFSClient.java you reference is part of our HadoopFS implementation.
This is the main reason why it doesn't include any reference to CommitsApi - currently it doesn't use it.
The Java SDK generated client code found in package io.lakefs.clients.api;
The above sample code is the way to use it. So, I'm not creating an issue for now.
a

Alessandro Mangone

12/02/2022, 10:54 AM
Ok, so for java I should instantiate the apiclient and all the apis individually, got it
b

Barak Amar

12/02/2022, 10:56 AM
Exactly - it is autogenerated based on the lakeFS OpenAPI spec - https://github.com/treeverse/lakeFS/blob/master/api/swagger.yml
👍 1
a

Alessandro Mangone

12/02/2022, 10:56 AM
Ok, thanks!
3 Views