Interface HttpTreeApi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SingleReferenceResponseassignReference(Reference.ReferenceType type, java.lang.String ref, Reference assignTo)Update a reference's HEAD to point to a different commit.CommitResponsecommitMultipleOperations(java.lang.String branch, Operations operations)Commit multiple operations against the given branch expecting that branch to have the given hash as its latest commit.SingleReferenceResponsecreateReference(java.lang.String name, Reference.ReferenceType type, Reference reference)Create a new reference.SingleReferenceResponsedeleteReference(Reference.ReferenceType type, java.lang.String ref)Delete a named reference.ReferencesResponsegetAllReferences(ReferencesParams params)Get all references.LogResponsegetCommitLog(java.lang.String ref, CommitLogParams params)Retrieve the commit log for a ref, potentially truncated by the backend.ContentResponsegetContent(ContentKey key, java.lang.String ref)DiffResponsegetDiff(DiffParams params)Returns a set of content differences between two given references.EntriesResponsegetEntries(java.lang.String ref, EntriesParams params)Retrieve objects for a ref, potentially truncated by the backend.GetMultipleContentsResponsegetMultipleContents(java.lang.String ref, GetMultipleContentsRequest request)Similar toTreeApi.getContent(ContentKey, String), but takes multipleContentKeys and returns theContentfor the one or moreContentKeys in a named-reference (aBranchorTag).SingleReferenceResponsegetReferenceByName(GetReferenceParams params)Get details of a particular ref, if it exists.GetMultipleContentsResponsegetSeveralContents(java.lang.String ref, java.util.List<java.lang.String> keys)MergeResponsemergeRefIntoBranch(java.lang.String branch, Merge merge)Merge commits from any reference onto a branch.MergeResponsetransplantCommitsIntoBranch(java.lang.String branch, Transplant transplant)Cherry-pick a set of commits into a branch.
-
-
-
Method Detail
-
getAllReferences
@GET @Produces("application/json") ReferencesResponse getAllReferences(@BeanParam ReferencesParams params)Description copied from interface:TreeApiGet all references.- Specified by:
getAllReferencesin interfaceTreeApi- Returns:
- A
ReferencesResponseinstance containing all references.
-
createReference
@POST @Produces("application/json") SingleReferenceResponse createReference(@QueryParam("name") java.lang.String name, @QueryParam("type") Reference.ReferenceType type, Reference reference) throws NessieNotFoundException, NessieConflictExceptionDescription copied from interface:TreeApiCreate a new reference.The type of
reference, which can be either aBranchorTag, determines the type of the reference to be created.Reference.getName()defines the name of the reference to be created,Reference.getHash()is the hash of the created reference, the HEAD of the created reference.sourceRefNameis the name of the reference which containsReference.getHash(), and must be present ifReference.getHash()is present.Specifying no
Reference.getHash()means that the new reference will be created "at the beginning of time".- Specified by:
createReferencein interfaceTreeApi- Throws:
NessieNotFoundExceptionNessieConflictException
-
getReferenceByName
@GET @Produces("application/json") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}") SingleReferenceResponse getReferenceByName(@BeanParam GetReferenceParams params) throws NessieNotFoundExceptionDescription copied from interface:TreeApiGet details of a particular ref, if it exists.- Specified by:
getReferenceByNamein interfaceTreeApi- Throws:
NessieNotFoundException
-
getEntries
@GET @Produces("application/json") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}/entries") EntriesResponse getEntries(@PathParam("ref") java.lang.String ref, @BeanParam EntriesParams params) throws NessieNotFoundExceptionDescription copied from interface:TreeApiRetrieve objects for a ref, potentially truncated by the backend.Retrieves up to
maxRecordsobjects for the given named reference (tag or branch). The backend may respect the givenmaxrecords hint, but return less or more entries. Backends may also cap the returned entries at a hard-coded limit, the default REST server implementation has such a hard-coded limit.Invoking
getEntries()does not guarantee to return all commit log entries of a given reference, because the result can be truncated by the backend.To implement paging, check
EntriesResponse.isHasMore()and, iftrue, pass the value ofEntriesResponse.getToken()in the next invocation ofgetEntries()as thepageTokenparameter.See
org.projectnessie.client.StreamingUtilinnessie-client.- Specified by:
getEntriesin interfaceTreeApi- Throws:
NessieNotFoundException
-
getCommitLog
@GET @Produces("application/json") @Path("{ref}/history") LogResponse getCommitLog(@PathParam("ref") java.lang.String ref, @BeanParam CommitLogParams params) throws NessieNotFoundExceptionDescription copied from interface:TreeApiRetrieve the commit log for a ref, potentially truncated by the backend.Retrieves up to
maxRecordscommit-log-entries starting at the HEAD of the given named reference (tag or branch). The backend may respect the givenmaxrecords hint, but return less or more entries. Backends may also cap the returned entries at a hard-coded limit, the default REST server implementation has such a hard-coded limit.Invoking
getCommitLog()does not guarantee to return all commit log entries of a given reference, because the result can be truncated by the backend.To implement paging, check
LogResponse.isHasMore()and, iftrue, pass the value ofLogResponse.getToken()in the next invocation ofgetCommitLog()as thepageTokenparameter.See
org.projectnessie.client.StreamingUtilinnessie-client.- Specified by:
getCommitLogin interfaceTreeApi- Throws:
NessieNotFoundException
-
getDiff
@GET @Produces("application/json") @Path("{from-ref:([^/]+|[^@]+(@|%40)[^@/]*)}/diff/{to-ref:([^/]+|[^@]+(@|%40)[^@/]*)}") DiffResponse getDiff(@BeanParam DiffParams params) throws NessieNotFoundExceptionDescription copied from interface:TreeApiReturns a set of content differences between two given references.- Specified by:
getDiffin interfaceTreeApi- Parameters:
params- TheDiffParamsthat includes the parameters for this API call.- Returns:
- A set of diff values that show the difference between two given references.
- Throws:
NessieNotFoundException
-
assignReference
@PUT @Produces("application/json") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}") SingleReferenceResponse assignReference(@QueryParam("type") Reference.ReferenceType type, @PathParam("ref") java.lang.String ref, Reference assignTo) throws NessieNotFoundException, NessieConflictExceptionDescription copied from interface:TreeApiUpdate a reference's HEAD to point to a different commit.- Specified by:
assignReferencein interfaceTreeApi- Parameters:
type- Optional expected type of reference being assigned. Will be validated if present.- Throws:
NessieNotFoundExceptionNessieConflictException
-
deleteReference
@DELETE @Produces("application/json") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}") SingleReferenceResponse deleteReference(@QueryParam("type") Reference.ReferenceType type, @PathParam("ref") java.lang.String ref) throws NessieConflictException, NessieNotFoundExceptionDescription copied from interface:TreeApiDelete a named reference.- Specified by:
deleteReferencein interfaceTreeApi- Parameters:
type- Optional expected type of reference being deleted. Will be validated if present.- Throws:
NessieConflictExceptionNessieNotFoundException
-
getContent
@GET @Produces("application/json") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}/contents/{key}") ContentResponse getContent(@PathParam("key") ContentKey key, @PathParam("ref") java.lang.String ref) throws NessieNotFoundExceptionDescription copied from interface:TreeApiThis operation returns theContentfor aContentKeyin a named-reference (aBranchorTag).If the table-metadata is tracked globally (Iceberg), Nessie returns a
Contentobject, that contains the most up-to-date part for the globally tracked part (Iceberg: table-metadata) plus the per-Nessie-reference/hash specific part (Iceberg: snapshot-ID, schema-ID, partition-spec-ID, default-sort-order-ID).- Specified by:
getContentin interfaceTreeApi- Parameters:
key- theContentKeys to retrieveref- named-reference to retrieve the content for- Returns:
- list of
GetMultipleContentsResponse.ContentWithKeys - Throws:
NessieNotFoundException- ifreforhashOnRefdoes not exist
-
getSeveralContents
@GET @Produces("application/json") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}/contents") GetMultipleContentsResponse getSeveralContents(@PathParam("ref") java.lang.String ref, @QueryParam("key") java.util.List<java.lang.String> keys) throws NessieNotFoundException- Throws:
NessieNotFoundException
-
getMultipleContents
@POST @Produces("application/json") @Consumes("application/json") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}/contents") GetMultipleContentsResponse getMultipleContents(@PathParam("ref") java.lang.String ref, GetMultipleContentsRequest request) throws NessieNotFoundExceptionDescription copied from interface:TreeApiSimilar toTreeApi.getContent(ContentKey, String), but takes multipleContentKeys and returns theContentfor the one or moreContentKeys in a named-reference (aBranchorTag).If the table-metadata is tracked globally (Iceberg), Nessie returns a
Contentobject, that contains the most up-to-date part for the globally tracked part (Iceberg: table-metadata) plus the per-Nessie-reference/hash specific part (Iceberg: snapshot-id, schema-id, partition-spec-id, default-sort-order-id).- Specified by:
getMultipleContentsin interfaceTreeApi- Parameters:
ref- named-reference to retrieve the content forrequest- theContentKeys to retrieve- Returns:
- list of
GetMultipleContentsResponse.ContentWithKeys - Throws:
NessieNotFoundException- ifreforhashOnRefdoes not exist
-
transplantCommitsIntoBranch
@POST @Produces("application/json") @Path("{branch}/history/transplant") MergeResponse transplantCommitsIntoBranch(@PathParam("branch") java.lang.String branch, Transplant transplant) throws NessieNotFoundException, NessieConflictExceptionDescription copied from interface:TreeApiCherry-pick a set of commits into a branch.- Specified by:
transplantCommitsIntoBranchin interfaceTreeApi- Throws:
NessieNotFoundExceptionNessieConflictException
-
mergeRefIntoBranch
@POST @Produces("application/json") @Path("{branch}/history/merge") MergeResponse mergeRefIntoBranch(@PathParam("branch") java.lang.String branch, Merge merge) throws NessieNotFoundException, NessieConflictExceptionDescription copied from interface:TreeApiMerge commits from any reference onto a branch.- Specified by:
mergeRefIntoBranchin interfaceTreeApi- Throws:
NessieNotFoundExceptionNessieConflictException
-
commitMultipleOperations
@POST @Path("{branch}/history/commit") @Produces("application/json") @Consumes("application/json") CommitResponse commitMultipleOperations(@PathParam("branch") java.lang.String branch, Operations operations) throws NessieNotFoundException, NessieConflictExceptionDescription copied from interface:TreeApiCommit multiple operations against the given branch expecting that branch to have the given hash as its latest commit. The hash in the successful response contains the hash of the commit that contains the operations of the invocation.- Specified by:
commitMultipleOperationsin interfaceTreeApi- Parameters:
branch- Branch to change, defaults to default branch.operations-Operationsto apply- Returns:
- updated
Branchobjects with the hash of the new HEAD - Throws:
NessieNotFoundException- ifbranchNamecould not be foundNessieConflictException- if the operations could not be applied to some conflict, which is either caused by a conflicting commit or concurrent commits.
-
-