Interface HttpTreeApi
- All Superinterfaces:
TreeApi
-
Method Summary
Modifier and TypeMethodDescriptionassignReference(String type, String ref, Reference assignTo) Update a reference's HEAD to point to a different commit.commitMultipleOperations(String branch, Operations operations) Commit multiple operations against the given branch expecting that branch to have the given hash as its latest commit.createReference(String name, String type, Reference reference) Create a new reference.deleteReference(String type, String ref) Delete a named reference.getAllReferences(ReferencesParams params) Get all references.getCommitLog(String ref, CommitLogParams params) Retrieve the commit log for a ref, potentially truncated by the backend.getContent(ContentKey key, String ref, boolean withDocumentation) getDiff(DiffParams params) Returns a set of content differences between two given references.getEntries(String ref, EntriesParams params) Retrieve objects for a ref, potentially truncated by the backend.getMultipleContents(String ref, GetMultipleContentsRequest request, boolean withDocumentation) Similar toTreeApi.getContent(ContentKey, String, boolean), but takes multipleContentKeys and returns theContentfor the one or moreContentKeys in a named-reference (aBranchorTag).getReferenceByName(GetReferenceParams params) Get details of a particular ref, if it exists.Retrieve the recorded recent history of a reference.getSeveralContents(@Pattern(regexp="^((?:[A-Za-z](?:(?:(?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?)|-)?(?:@([0-9a-fA-F]{8,64})?)?(([~*^])([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[.][0-9]{1,9}Z|([0-9]+)))*$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a hash with optional relative part. Hash with optional relative part must consist of either a valid commit hash (which in turn must consist of the hex representation of 4-32 bytes), or a valid relative part (which must be either \'~\' + a number representing the n-th predecessor of a commit, \'^\' + a number representing the n-th parent within a commit, or \'*\' + a number representing the created timestamp of a commit, in milliseconds since epoch or in ISO-8601 format), or both.") @Pattern(regexp="^((?:[A-Za-z](?:(?:(?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?)|-)?(?:@([0-9a-fA-F]{8,64})?)?(([~*^])([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[.][0-9]{1,9}Z|([0-9]+)))*$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a hash with optional relative part. Hash with optional relative part must consist of either a valid commit hash (which in turn must consist of the hex representation of 4-32 bytes), or a valid relative part (which must be either \'~\' + a number representing the n-th predecessor of a commit, \'^\' + a number representing the n-th parent within a commit, or \'*\' + a number representing the created timestamp of a commit, in milliseconds since epoch or in ISO-8601 format), or both.") String ref, List<String> keys, boolean withDocumentation) mergeRefIntoBranch(String branch, Merge merge) Merge commits from any reference onto a branch.transplantCommitsIntoBranch(String branch, Transplant transplant) Cherry-pick a set of commits into a branch.
-
Method Details
-
getAllReferences
@GET @GET @Produces("application/json") @Produces("application/json") ReferencesResponse getAllReferences(@BeanParam @BeanParam ReferencesParams params) Description copied from interface:TreeApiGet all references.- Specified by:
getAllReferencesin interfaceTreeApi- Returns:
- A
ReferencesResponseinstance containing all references.
-
createReference
@POST @POST @Produces("application/json") @Produces("application/json") SingleReferenceResponse createReference(@QueryParam("name") @QueryParam("name") String name, @QueryParam("type") @QueryParam("type") String type, Reference reference) throws NessieNotFoundException, NessieConflictException Description 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 @GET @Produces("application/json") @Produces("application/json") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}") SingleReferenceResponse getReferenceByName(@BeanParam @BeanParam GetReferenceParams params) throws NessieNotFoundException Description copied from interface:TreeApiGet details of a particular ref, if it exists.- Specified by:
getReferenceByNamein interfaceTreeApi- Throws:
NessieNotFoundException
-
getReferenceHistory
@GET @GET @Produces("application/json") @Produces("application/json") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}/recent-changes") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}/recent-changes") ReferenceHistoryResponse getReferenceHistory(@BeanParam @BeanParam ReferenceHistoryParams params) throws NessieNotFoundException Description copied from interface:TreeApiRetrieve the recorded recent history of a reference.A reference's history is a size and time limited record of changes of the reference's current pointer, aka HEAD. The size and time limits are configured in the Nessie server configuration.
- Specified by:
getReferenceHistoryin interfaceTreeApi- Throws:
NessieNotFoundException
-
getEntries
@GET @GET @Produces("application/json") @Produces("application/json") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}/entries") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}/entries") EntriesResponse getEntries(@PathParam("ref") @PathParam("ref") String ref, @BeanParam @BeanParam EntriesParams params) throws NessieNotFoundException Description 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 @GET @Produces("application/json") @Produces("application/json") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}/history") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}/history") LogResponse getCommitLog(@PathParam("ref") @PathParam("ref") String ref, @BeanParam @BeanParam CommitLogParams params) throws NessieNotFoundException Description 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 @GET @Produces("application/json") @Produces("application/json") @Path("{from-ref:([^/]+|[^@]+(@|%40)[^@/]*)}/diff/{to-ref:([^/]+|[^@]+(@|%40)[^@/]*)}") @Path("{from-ref:([^/]+|[^@]+(@|%40)[^@/]*)}/diff/{to-ref:([^/]+|[^@]+(@|%40)[^@/]*)}") DiffResponse getDiff(@BeanParam @BeanParam DiffParams params) throws NessieNotFoundException Description 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 @PUT @Produces("application/json") @Produces("application/json") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}") SingleReferenceResponse assignReference(@QueryParam("type") @QueryParam("type") String type, @PathParam("ref") @PathParam("ref") String ref, Reference assignTo) throws NessieNotFoundException, NessieConflictException Description 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 @DELETE @Produces("application/json") @Produces("application/json") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}") SingleReferenceResponse deleteReference(@QueryParam("type") @QueryParam("type") String type, @PathParam("ref") @PathParam("ref") String ref) throws NessieConflictException, NessieNotFoundException Description 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 @GET @Produces("application/json") @Produces("application/json") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}/contents/{key}") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}/contents/{key}") ContentResponse getContent(@PathParam("key") @PathParam("key") ContentKey key, @PathParam("ref") @PathParam("ref") String ref, @QueryParam("with-doc") @QueryParam("with-doc") boolean withDocumentation) throws NessieNotFoundException Description 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 forwithDocumentation- whether to return the documentation, if it exists.- Returns:
- list of
GetMultipleContentsResponse.ContentWithKeys - Throws:
NessieNotFoundException- ifreforhashOnRefdoes not exist
-
getSeveralContents
@GET @GET @Produces("application/json") @Produces("application/json") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}/contents") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}/contents") GetMultipleContentsResponse getSeveralContents(@Pattern(regexp="^((?:[A-Za-z](?:(?:(?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?)|-)?(?:@([0-9a-fA-F]{8,64})?)?(([~*^])([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[.][0-9]{1,9}Z|([0-9]+)))*$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a hash with optional relative part. Hash with optional relative part must consist of either a valid commit hash (which in turn must consist of the hex representation of 4-32 bytes), or a valid relative part (which must be either \'~\' + a number representing the n-th predecessor of a commit, \'^\' + a number representing the n-th parent within a commit, or \'*\' + a number representing the created timestamp of a commit, in milliseconds since epoch or in ISO-8601 format), or both.") @Pattern(regexp="^((?:[A-Za-z](?:(?:(?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?)|-)?(?:@([0-9a-fA-F]{8,64})?)?(([~*^])([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[.][0-9]{1,9}Z|([0-9]+)))*$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a hash with optional relative part. Hash with optional relative part must consist of either a valid commit hash (which in turn must consist of the hex representation of 4-32 bytes), or a valid relative part (which must be either \'~\' + a number representing the n-th predecessor of a commit, \'^\' + a number representing the n-th parent within a commit, or \'*\' + a number representing the created timestamp of a commit, in milliseconds since epoch or in ISO-8601 format), or both.") @PathParam("ref") @PathParam("ref") @Pattern(regexp="^((?:[A-Za-z](?:(?:(?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?)|-)?(?:@([0-9a-fA-F]{8,64})?)?(([~*^])([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[.][0-9]{1,9}Z|([0-9]+)))*$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a hash with optional relative part. Hash with optional relative part must consist of either a valid commit hash (which in turn must consist of the hex representation of 4-32 bytes), or a valid relative part (which must be either \'~\' + a number representing the n-th predecessor of a commit, \'^\' + a number representing the n-th parent within a commit, or \'*\' + a number representing the created timestamp of a commit, in milliseconds since epoch or in ISO-8601 format), or both.") @Pattern(regexp="^((?:[A-Za-z](?:(?:(?![.][.])[A-Za-z0-9./_-])*[A-Za-z0-9_-])?)|-)?(?:@([0-9a-fA-F]{8,64})?)?(([~*^])([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[.][0-9]{1,9}Z|([0-9]+)))*$",message="Reference name must start with a letter, followed by letters, digits, one of the ./_- characters, not end with a slash or dot, not contain \'..\', optionally followed by @ and a hash with optional relative part. Hash with optional relative part must consist of either a valid commit hash (which in turn must consist of the hex representation of 4-32 bytes), or a valid relative part (which must be either \'~\' + a number representing the n-th predecessor of a commit, \'^\' + a number representing the n-th parent within a commit, or \'*\' + a number representing the created timestamp of a commit, in milliseconds since epoch or in ISO-8601 format), or both.") String ref, @QueryParam("key") @QueryParam("key") List<String> keys, @QueryParam("with-doc") @QueryParam("with-doc") boolean withDocumentation) throws NessieNotFoundException - Throws:
NessieNotFoundException
-
getMultipleContents
@POST @POST @Produces("application/json") @Produces("application/json") @Consumes("application/json") @Consumes("application/json") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}/contents") @Path("{ref:([^/]+|[^@]+(@|%40)[^@/]*)}/contents") GetMultipleContentsResponse getMultipleContents(@PathParam("ref") @PathParam("ref") String ref, GetMultipleContentsRequest request, @QueryParam("with-doc") @QueryParam("with-doc") boolean withDocumentation) throws NessieNotFoundException Description copied from interface:TreeApiSimilar toTreeApi.getContent(ContentKey, String, boolean), 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 retrievewithDocumentation- whether to return the documentation, if it exists.- Returns:
- list of
GetMultipleContentsResponse.ContentWithKeys - Throws:
NessieNotFoundException- ifreforhashOnRefdoes not exist
-
transplantCommitsIntoBranch
@POST @POST @Produces("application/json") @Produces("application/json") @Path("{branch:([^/]+|[^@]+(@|%40)[^@/]*)}/history/transplant") @Path("{branch:([^/]+|[^@]+(@|%40)[^@/]*)}/history/transplant") MergeResponse transplantCommitsIntoBranch(@PathParam("branch") @PathParam("branch") String branch, Transplant transplant) throws NessieNotFoundException, NessieConflictException Description copied from interface:TreeApiCherry-pick a set of commits into a branch.- Specified by:
transplantCommitsIntoBranchin interfaceTreeApi- Throws:
NessieNotFoundExceptionNessieConflictException
-
mergeRefIntoBranch
@POST @POST @Produces("application/json") @Produces("application/json") @Path("{branch:([^/]+|[^@]+(@|%40)[^@/]*)}/history/merge") @Path("{branch:([^/]+|[^@]+(@|%40)[^@/]*)}/history/merge") MergeResponse mergeRefIntoBranch(@PathParam("branch") @PathParam("branch") String branch, Merge merge) throws NessieNotFoundException, NessieConflictException Description copied from interface:TreeApiMerge commits from any reference onto a branch.- Specified by:
mergeRefIntoBranchin interfaceTreeApi- Throws:
NessieNotFoundExceptionNessieConflictException
-
commitMultipleOperations
@POST @POST @Path("{branch:([^/]+|[^@]+(@|%40)[^@/]*)}/history/commit") @Path("{branch:([^/]+|[^@]+(@|%40)[^@/]*)}/history/commit") @Produces("application/json") @Produces("application/json") @Consumes("application/json") @Consumes("application/json") CommitResponse commitMultipleOperations(@PathParam("branch") @PathParam("branch") String branch, Operations operations) throws NessieNotFoundException, NessieConflictException Description 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.
-