Package com.xebialabs.xlrelease.api.v1

# Interface ReleaseApi

All Superinterfaces:
  `ApiService`

@Path("/api/v1/releases") @Consumes("application/json") @Produces("application/json") public interface ReleaseApi extends ApiService
Operations on releases.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `ARCHIVE_PAGE`
  `static final String`
  `ARCHIVE_RESULTS_PER_PAGE`
  `static final long`
  `DEFAULT_PAGE`
  `static final String`
  `SERVICE_NAME`

  ### Fields inherited from interface com.xebialabs.xlrelease.api.ApiService

  `DEFAULT_RESULTS_PER_PAGE, DEFAULT_RESULTS_PER_PAGE_STRING, DEPTH, ORDER_BY, PAGE, PAGE_IS_OFFSET, RESULTS_PER_PAGE, ROLE_IDS_DATA`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Release`
  `abort(String releaseId, AbortRelease abortRelease)`
  Aborts a release.
  `Release`
  `abort(String releaseId, String abortComment)`
  Aborts a release.
  `ReleaseCountResults`
  `countReleases(ReleasesFilters releasesFilters)`
  Count releases matching filter criteria.
  `Variable`
  `createVariable(String releaseId, Variable variable)`
  Create new variable.
  `void`
  `delete(String releaseId)`
  Deletes a release.
  `void`
  `deleteVariable(String variableId)`
  Delete variable from release.
  `jakarta.ws.rs.core.Response`
  `downloadAttachment(String attachmentId)`
  Returns the attachment file with the given ID.
  `ReleaseFullSearchResult`
  `fullSearchReleases(Long page, Long archivePage, Long resultsPerPage, Long archiveResultsPerPage, ReleasesFilters releasesFilters)`
  Searches releases.
  `List<Task>`
  `getActiveTasks(String releaseId)`
  Returns the active tasks in a release.
  `Release`
  `getArchivedRelease(String releaseId)`
  Returns the archived release for the given ID.
  `Release`
  `getArchivedRelease(String releaseId, boolean withRoleIds)`
  Returns the archived release for the given ID.
  `byte[]`
  `getAttachment(String attachmentId)`
  Returns the attachment file with the given ID.
  `List<String>`
  `getPermissions()`
  Returns possible permissions.
  `Release`
  `getRelease(String releaseId)`
  Returns the release with the given ID.
  `Release`
  `getRelease(String releaseId, boolean withRoleIds)`
  Returns the release with the given ID.
  `List<Release>`
  `getReleases()`
  Deprecated.
  Please use `getReleases(Long, Long, Integer)`
  `List<Release>`
  `getReleases(Long page, Long resultsPerPage, Integer depth)`
  Returns the list of planned or active releases that are visible to the current user.
  `List<TeamView>`
  `getTeams(String releaseId)`
  Returns effective teams of the release.
  `Variable`
  `getVariable(String variableId)`
  Returns the variable for the given identifier.
  `Collection<Object>`
  `getVariablePossibleValues(String variableId)`
  Returns possible values for the variable with the given identifier.
  `List<Variable>`
  `getVariables(String releaseId)`
  Get release variables.
  `Map<String,String>`
  `getVariableValues(String releaseId)`
  Get release variable values.
  `Boolean`
  `isVariableUsed(String variableId)`
  Returns true if variable with the given identifier is used in the release.
  `void`
  `replaceVariable(String variableId, VariableOrValue variableOrValue)`
  Replace variable occurrences with the given replacement.
  `Release`
  `restartPhase(Release release)`
  Restart release from the current phase.
  `Release`
  `restartPhase(Release release, boolean resumeRelease)`
  Restart release from the current phase and optionally resume the release.
  `Release`
  `restartPhase(Release release, Phase phase)`
  Restart the release from the given phase.
  `Release`
  `restartPhase(Release release, Phase phase, Task task)`
  Restart the release from the given phase and task.
  `Release`
  `restartPhase(Release release, Phase phase, Task task, PhaseVersion phaseVersion)`
  Restart the release from the given phase and task.
  `Release`
  `restartPhase(Release release, Phase phase, Task task, PhaseVersion phaseVersion, boolean resumeRelease)`
  Restart the release from the given phase and task and optionally resume the release.
  `Release`
  `restartPhase(Release release, Phase phase, PhaseVersion phaseVersion)`
  Restart the release from the given phase.
  `Release`
  `restartPhases(String releaseId, String phaseId, String taskId, PhaseVersion phaseVersion, boolean resumeRelease)`
  Restarts the release from a given phase and task.
  `Release`
  `resume(String releaseId)`
  Resumes a release that has been paused as part of a restart phases operation.
  `List<Release>`
  `searchReleases(ReleasesFilters releasesFilters)`
  Searches releases by filters with default pagination.
  `List<Release>`
  `searchReleases(ReleasesFilters releasesFilters, Long page, Long resultsPerPage)`
  Searches releases by filters.
  `List<Release>`
  `searchReleases(ReleasesFilters releasesFilters, Long page, Long resultsPerPage, Boolean pageIsOffset)`
  Searches releases by filters.
  `List<Release>`
  `searchReleasesByTitle(String releaseTitle)`
  Search releases by given title (exact match).
  `List<BasicReleaseView>`
  `searchReleasesOverview(ReleasesFilters releasesFilters, Long page, Long resultsPerPage)`
  Searches releases overview by filters.
  `default String`
  `serviceName()`
  `List<TeamView>`
  `setTeams(String releaseId, List<TeamView> teams)`
  Sets teams of the release.
  `Release`
  `start(String releaseId)`
  Starts a planned release.
  `Release`
  `updateRelease(Release release)`
  Updates the properties of a release.
  `Release`
  `updateRelease(String releaseId, Release release)`
  Updates the properties of a release.
  `Variable`
  `updateVariable(Variable variable)`
  Updates the properties of a variable.
  `Variable`
  `updateVariable(String variableId, Variable variable)`
  `List<Variable>`
  `updateVariables(String releaseId, List<Variable> variables)`
  Update the list of variables in a release.

- ## Field Details

  - ### SERVICE_NAME

    static final String SERVICE_NAME
    See Also:
      - Constant Field Values

  - ### DEFAULT_PAGE

    static final long DEFAULT_PAGE
    See Also:
      - Constant Field Values

  - ### ARCHIVE_PAGE

    static final String ARCHIVE_PAGE
    See Also:
      - Constant Field Values

  - ### ARCHIVE_RESULTS_PER_PAGE

    static final String ARCHIVE_RESULTS_PER_PAGE
    See Also:
      - Constant Field Values

- ## Method Details

  - ### serviceName

    default String serviceName()
    Specified by:
      `serviceName` in interface `ApiService`

  - ### downloadAttachment

    @GET @Path("attachments/{attachmentId:.*/Attachment[^/]*}") @Produces("application/octet-stream") jakarta.ws.rs.core.Response downloadAttachment(@PathParam("attachmentId") String attachmentId)
    Returns the attachment file with the given ID.
    Parameters:
      `attachmentId` - the identifier of the attachment
    Returns:
      the attachment file.

  - ### getAttachment

    byte[] getAttachment(String attachmentId) throws IOException
    Returns the attachment file with the given ID.
    Parameters:
      `attachmentId` - the identifier of the attachment
    Returns:
      the attachment file.
    Throws:
      `IOException`

  - ### countReleases

    @POST @Path("count") ReleaseCountResults countReleases(ReleasesFilters releasesFilters)
    Count releases matching filter criteria.
    Parameters:
      `releasesFilters` - the search criteria
    Returns:
      a map containing the number of releases (total) and the number by status

  - ### searchReleases

    @POST @Path("search") List<Release> searchReleases(ReleasesFilters releasesFilters, @DefaultValue("0") @QueryParam("page") Long page, @DefaultValue("100") @QueryParam("resultsPerPage") Long resultsPerPage, @DefaultValue("false") @QueryParam("pageIsOffset") Boolean pageIsOffset)
    Searches releases by filters.
    Parameters:
      `releasesFilters` - the search criteria
      `page` - the page of results to return. Default value is 0.
      `resultsPerPage` - the number of results per page. Default and maximum value is 100.
      `pageIsOffset` - the flag indicating if page is used as offset. Default is false.
    Returns:
      the list of matching releases

  - ### searchReleases

    List<Release> searchReleases(ReleasesFilters releasesFilters, Long page, Long resultsPerPage)
    Searches releases by filters.
    Parameters:
      `releasesFilters` - the search criteria
      `page` - the page of results to return.
      `resultsPerPage` - the number of results per page.
    Returns:
      the list of matching releases

  - ### searchReleases

    List<Release> searchReleases(ReleasesFilters releasesFilters)
    Searches releases by filters with default pagination.
    Parameters:
      `releasesFilters` - the search criteria
    Returns:
      the list of first 100 matching releases

  - ### searchReleasesOverview

    @POST @Path("search/overview") List<BasicReleaseView> searchReleasesOverview(ReleasesFilters releasesFilters, @DefaultValue("0") @QueryParam("page") Long page, @DefaultValue("100") @QueryParam("resultsPerPage") Long resultsPerPage)
    Searches releases overview by filters.
    Parameters:
      `releasesFilters` - the search criteria
      `page` - the page of results to return. Default value is 0.
      `resultsPerPage` - the number of results per page. Default and maximum value is 100.
    Returns:
      the list of matching releases

  - ### fullSearchReleases

    @POST @Path("fullSearch") ReleaseFullSearchResult fullSearchReleases(@QueryParam("page") Long page, @QueryParam("archivePage") Long archivePage, @QueryParam("resultsPerPage") Long resultsPerPage, @QueryParam("archiveResultsPerPage") Long archiveResultsPerPage, ReleasesFilters releasesFilters)
    Searches releases.
    Parameters:
      `page` - next page to query, active database
      `archivePage` - next page to query, archive database
      `resultsPerPage` - releases per page, active database
      `archiveResultsPerPage` - releases per page, archive database
      `releasesFilters` - the search criteria
    Returns:
      the list of matching releases

  - ### getReleases

    @GET @Path("/") List<Release> getReleases(@DefaultValue("0") @QueryParam("page") Long page, @DefaultValue("100") @QueryParam("resultsPerPage") Long resultsPerPage, @DefaultValue("1") @QueryParam("depth") Integer depth)
    Returns the list of planned or active releases that are visible to the current user.

    Active releases are ordered by the start date (ascending) and title (ascending).

    Parameters:
      `page` - the page of results to return. Default value is 0.
      `resultsPerPage` - the number of results per page. Default and maximum value is 100.
      `depth` - the depth to search for. Default value is 1.
    Returns:
      a list of releases.

  - ### getReleases

    @Deprecated List<Release> getReleases()
    Deprecated.
    Please use `getReleases(Long, Long, Integer)`
    Returns the list of the first 100 planned or active releases that are visible to the current user with depth 1.

  - ### getRelease

    @GET @Path("/{releaseId:((?!archived).)*Release[^/]*}") Release getRelease(@PathParam("releaseId") String releaseId, @DefaultValue("false") @QueryParam("roleIds") boolean withRoleIds)
    Returns the release with the given ID.
    Parameters:
      `releaseId` - the identifier of the release.
      `withRoleIds` - if true exposes roleIds in response.
    Returns:
      the release.

  - ### getRelease

    Release getRelease(String releaseId)
    Returns the release with the given ID.
    Parameters:
      `releaseId` - the identifier of the release.
    Returns:
      the release.

  - ### getArchivedRelease

    @GET @Path("/archived/{releaseId:.*Release[^/]*}") Release getArchivedRelease(@PathParam("releaseId") String releaseId, @DefaultValue("false") @QueryParam("roleIds") boolean withRoleIds)
    Returns the archived release for the given ID.
    Parameters:
      `releaseId` - the identifier of the release.
      `withRoleIds` - if true exposes roleIds in response.
    Returns:
      the release.

  - ### getArchivedRelease

    Release getArchivedRelease(String releaseId)
    Returns the archived release for the given ID.
    Parameters:
      `releaseId` - the identifier of the release.
    Returns:
      the release.

  - ### getActiveTasks

    @GET @Path("/{releaseId:.*Release[^/]*}/active-tasks") List<Task> getActiveTasks(@PathParam("releaseId") String releaseId)
    Returns the active tasks in a release.
    Parameters:
      `releaseId` - the identifier of the release
    Returns:
      a list of active tasks.

  - ### start

    @POST @Path("/{releaseId:.*Release[^/]*}/start") Release start(@PathParam("releaseId") String releaseId)
    Starts a planned release.
    Parameters:
      `releaseId` - the release identifier.
    Returns:
      the started release.

  - ### updateRelease

    @PUT @Path("/{releaseId:.*Release[^/]*}") Release updateRelease(@PathParam("releaseId") String releaseId, Release release)
    Updates the properties of a release.
    Parameters:
      `releaseId` - the identifier of the release.
      `release` - new contents of the release.
    Returns:
      the updated release.

  - ### updateRelease

    Release updateRelease(Release release)
    Updates the properties of a release.
    Parameters:
      `release` - new contents of the release.
    Returns:
      the updated release.

  - ### delete

    @DELETE @Path("/{releaseId:.*Release[^/]*}") void delete(@PathParam("releaseId") String releaseId)
    Deletes a release. The release MUST be in a final state (complete or aborted).
    Parameters:
      `releaseId` - the identifier of the release

  - ### abort

    @POST @Path("/{releaseId:.*Release[^/]*}/abort") Release abort(@PathParam("releaseId") String releaseId, AbortRelease abortRelease)
    Aborts a release.
    Parameters:
      `releaseId` - the identifier of the release
      `abortRelease` - the parameters to abort the release
    Returns:
      the aborted release

  - ### abort

    Release abort(String releaseId, String abortComment)
    Aborts a release.
    Parameters:
      `releaseId` - the identifier of the release
      `abortComment` - the comment of the abort
    Returns:
      the aborted release

  - ### searchReleasesByTitle

    @GET @Path("/byTitle") List<Release> searchReleasesByTitle(@QueryParam("releaseTitle") String releaseTitle)
    Search releases by given title (exact match).
    Parameters:
      `releaseTitle` - The title of the release.
    Returns:
      a list of releases.

  - ### getVariables

    @GET @Path("/{releaseId:.*Release[^/]*}/variables") List<Variable> getVariables(@PathParam("releaseId") String releaseId)
    Get release variables.
    Parameters:
      `releaseId` - the identifier of the release.
    Returns:
      a list of variables.

  - ### getVariableValues

    @GET @Path("/{releaseId:.*Release[^/]*}/variableValues") Map<String,String> getVariableValues(@PathParam("releaseId") String releaseId)
    Get release variable values.
    Parameters:
      `releaseId` - the identifier of the release.
    Returns:
      a list of variable values.

  - ### getVariable

    @GET @Path("/{variableId:.*/Variable[^/]*}") Variable getVariable(@PathParam("variableId") String variableId)
    Returns the variable for the given identifier.
    Parameters:
      `variableId` - the variable identifier.
    Returns:
      the variable.

  - ### getVariablePossibleValues

    @GET @Path("/{variableId:.*/Variable[^/]*}/possibleValues") Collection<Object> getVariablePossibleValues(@PathParam("variableId") String variableId)
    Returns possible values for the variable with the given identifier.
    Parameters:
      `variableId` - the variable identifier.
    Returns:
      possible values for the variable.

  - ### isVariableUsed

    @GET @Path("/{variableId:.*/Variable[^/]*}/used") Boolean isVariableUsed(@PathParam("variableId") String variableId)
    Returns true if variable with the given identifier is used in the release.
    Parameters:
      `variableId` - the variable ID.
    Returns:
      true if variable with the given identifier is used in the release.

  - ### replaceVariable

    @POST @Path("/{variableId:.*/Variable[^/]*}/replace") void replaceVariable(@PathParam("variableId") String variableId, VariableOrValue variableOrValue)
    Replace variable occurrences with the given replacement.
    Parameters:
      `variableId` - the variable ID.
      `variableOrValue` - an object with a variable or value replacing the initial variable.

  - ### deleteVariable

    @DELETE @Path("/{variableId:.*/Variable[^/]*}") void deleteVariable(@PathParam("variableId") String variableId)
    Delete variable from release.
    Parameters:
      `variableId` - the variable ID.

  - ### createVariable

    @POST @Path("/{releaseId:.*?}/variables") Variable createVariable(@PathParam("releaseId") String releaseId, Variable variable)
    Create new variable.
    Parameters:
      `releaseId` - the identifier of the release.
      `variable` - the variable to create.
    Returns:
      created variable.

  - ### updateVariables

    @PUT @Path("/{releaseId:.*?}/variables") List<Variable> updateVariables(@PathParam("releaseId") String releaseId, List<Variable> variables)
    Update the list of variables in a release.
    Parameters:
      `releaseId` - the identifier of the release.
      `variables` - the variable list to update.
    Returns:
      updated variables.

  - ### updateVariable

    @PUT @Path("/{variableId:.*/Variable[^/]*}") Variable updateVariable(@PathParam("variableId") String variableId, Variable variable)

  - ### updateVariable

    Variable updateVariable(Variable variable)
    Updates the properties of a variable.
    Parameters:
      `variable` - new contents of the variable.
    Returns:
      the updated variable.

  - ### getPermissions

    @GET @Path("/permissions") List<String> getPermissions()
    Returns possible permissions.
    Returns:
      list of permissions for releases

  - ### getTeams

    @GET @Path("/{releaseId:.*Release[^/]*}/teams") List<TeamView> getTeams(@PathParam("releaseId") String releaseId)
    Returns effective teams of the release.
    Parameters:
      `releaseId` - the identifier of the release
    Returns:
      a list of effective teams

  - ### setTeams

    @POST @Path("/{releaseId:.*Release[^/]*}/teams") List<TeamView> setTeams(@PathParam("releaseId") String releaseId, List<TeamView> teams)
    Sets teams of the release.
    Parameters:
      `releaseId` - the identifier of the release
    Returns:
      a list of updated teams

  - ### resume

    @POST @Path("/{releaseId:.*Release[^/]*}/resume") Release resume(@PathParam("releaseId") String releaseId)
    Resumes a release that has been paused as part of a restart phases operation.
    Parameters:
      `releaseId` - the identifier of the release
    Returns:
      the release

  - ### restartPhases

    @POST @Path("/{releaseId:.*Release[^/]*}/restart") Release restartPhases(@PathParam("releaseId") String releaseId, @QueryParam("fromPhaseId") String phaseId, @QueryParam("fromTaskId") String taskId, @QueryParam("phaseVersion") PhaseVersion phaseVersion, @QueryParam("resume") boolean resumeRelease)
    Restarts the release from a given phase and task.
    Parameters:
      `releaseId` - the identifier of the release
      `phaseId` - the identifier of the phase to restart from
      `taskId` - the identifier of the task to restart from
      `phaseVersion` - provide which 'version' of the phase should be copied
      `resumeRelease` - if true resumes the paused release immediately
    Returns:
      the release

  - ### restartPhase

    Release restartPhase(Release release)
    Restart release from the current phase.
    Parameters:
      `release` - the release.
    Returns:
      the release.

  - ### restartPhase

    Release restartPhase(Release release, boolean resumeRelease)
    Restart release from the current phase and optionally resume the release.
    Parameters:
      `release` - the release.
      `resumeRelease` - if true resumes the paused release immediately
    Returns:
      the release.

  - ### restartPhase

    Release restartPhase(Release release, Phase phase)
    Restart the release from the given phase. Creates copies of all phases between the given phase and the current phase.

    Will copy all phases between given Phase and the active phase of the release. If you want to only copy the latest phases, use method below to influence this behavior.

    Parameters:
      `release` - the release
      `phase` - the phase to restart from
    Returns:
      the release

  - ### restartPhase

    Release restartPhase(Release release, Phase phase, PhaseVersion phaseVersion)
    Restart the release from the given phase. Depending on 'phaseVersion' it will have a different copy strategy.
    Parameters:
      `release` - the release
      `phase` - the phase to restart from
      `phaseVersion` - the given phase version
    Returns:
      the release

  - ### restartPhase

    Release restartPhase(Release release, Phase phase, Task task)
    Restart the release from the given phase and task.

    Will copy all phases between given Phase and the active phase of the release. If you want to only copy the latest phases, use method below to influence this behavior.

    Parameters:
      `release` - the release
      `phase` - the phase to restart from
      `task` - the task to restart from
    Returns:
      the release

  - ### restartPhase

    Release restartPhase(Release release, Phase phase, Task task, PhaseVersion phaseVersion)
    Restart the release from the given phase and task.
    Parameters:
      `release` - the release
      `phase` - the phase to restart from
      `task` - the task to restart from
      `phaseVersion` - the given phase version
    Returns:
      the release

  - ### restartPhase

    Release restartPhase(Release release, Phase phase, Task task, PhaseVersion phaseVersion, boolean resumeRelease)
    Restart the release from the given phase and task and optionally resume the release.
    Parameters:
      `release` - the release
      `phase` - the phase to restart from
      `task` - the task to restart from
      `phaseVersion` - the given phase version
      `resumeRelease` - if true resumes the paused release immediately
    Returns:
      the release