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 java.lang.String` | `ARCHIVE_PAGE` |
    `static java.lang.String` | `ARCHIVE_RESULTS_PER_PAGE` |
    `static long` | `DEFAULT_PAGE` |
    `static java.lang.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

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

- - ### Field Detail

    - #### SERVICE_NAME

          static final java.lang.String SERVICE_NAME

      See Also:
        Constant Field Values

    - #### DEFAULT_PAGE

          static final long DEFAULT_PAGE

      See Also:
        Constant Field Values

    - #### ARCHIVE_PAGE

          static final java.lang.String ARCHIVE_PAGE

      See Also:
        Constant Field Values

    - #### ARCHIVE_RESULTS_PER_PAGE

          static final java.lang.String ARCHIVE_RESULTS_PER_PAGE

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### serviceName

          default java.lang.String serviceName()

      Specified by:
        `serviceName` in interface `ApiService`

    - #### downloadAttachment

          @GET
          @Path("attachments/{attachmentId:.*/Attachment[^/]*}")
          @Produces("application/octet-stream")
          javax.ws.rs.core.Response downloadAttachment​(@PathParam("attachmentId")
                                                       java.lang.String attachmentId)

      Returns the attachment file with the given ID.
      Parameters:
        `attachmentId` - the identifier of the attachment
      Returns:
        the attachment file.

    - #### getAttachment

          byte[] getAttachment​(java.lang.String attachmentId)
                        throws java.io.IOException

      Returns the attachment file with the given ID.
      Parameters:
        `attachmentId` - the identifier of the attachment
      Returns:
        the attachment file.
      Throws:
        `java.io.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")
          java.util.List<Release> searchReleases​(ReleasesFilters releasesFilters,
                                                 @DefaultValue("0") @QueryParam("page")
                                                 java.lang.Long page,
                                                 @DefaultValue("100") @QueryParam("resultsPerPage")
                                                 java.lang.Long resultsPerPage,
                                                 @DefaultValue("false") @QueryParam("pageIsOffset")
                                                 java.lang.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

          java.util.List<Release> searchReleases​(ReleasesFilters releasesFilters,
                                                 java.lang.Long page,
                                                 java.lang.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

          java.util.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

    - #### fullSearchReleases

          @POST
          @Path("fullSearch")
          ReleaseFullSearchResult fullSearchReleases​(@QueryParam("page")
                                                     java.lang.Long page,
                                                     @QueryParam("archivePage")
                                                     java.lang.Long archivePage,
                                                     @QueryParam("resultsPerPage")
                                                     java.lang.Long resultsPerPage,
                                                     @QueryParam("archiveResultsPerPage")
                                                     java.lang.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("/")
          java.util.List<Release> getReleases​(@DefaultValue("0") @QueryParam("page")
                                              java.lang.Long page,
                                              @DefaultValue("100") @QueryParam("resultsPerPage")
                                              java.lang.Long resultsPerPage,
                                              @DefaultValue("1") @QueryParam("depth")
                                              java.lang.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
          java.util.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")
                             java.lang.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​(java.lang.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")
                                     java.lang.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​(java.lang.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")
          java.util.List<Task> getActiveTasks​(@PathParam("releaseId")
                                              java.lang.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")
                        java.lang.String releaseId)

      Starts a planned release.
      Parameters:
        `releaseId` - the release identifier.
      Returns:
        the started release.

    - #### updateRelease

          @PUT
          @Path("/{releaseId:.*Release[^/]*}")
          Release updateRelease​(@PathParam("releaseId")
                                java.lang.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")
                      java.lang.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")
                        java.lang.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​(java.lang.String releaseId,
                        java.lang.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")
          java.util.List<Release> searchReleasesByTitle​(@QueryParam("releaseTitle")
                                                        java.lang.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")
          java.util.List<Variable> getVariables​(@PathParam("releaseId")
                                                java.lang.String releaseId)

      Get release variables.
      Parameters:
        `releaseId` - the identifier of the release.
      Returns:
        a list of variables.

    - #### getVariableValues

          @GET
          @Path("/{releaseId:.*Release[^/]*}/variableValues")
          java.util.Map<java.lang.String,​java.lang.String> getVariableValues​(@PathParam("releaseId")
                                                                                   java.lang.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")
                               java.lang.String variableId)

      Returns the variable for the given identifier.
      Parameters:
        `variableId` - the variable identifier.
      Returns:
        the variable.

    - #### getVariablePossibleValues

          @GET
          @Path("/{variableId:.*/Variable[^/]*}/possibleValues")
          java.util.Collection<java.lang.Object> getVariablePossibleValues​(@PathParam("variableId")
                                                                           java.lang.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")
          java.lang.Boolean isVariableUsed​(@PathParam("variableId")
                                           java.lang.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")
                               java.lang.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")
                              java.lang.String variableId)

      Delete variable from release.
      Parameters:
        `variableId` - the variable ID.

    - #### createVariable

          @POST
          @Path("/{releaseId:.*?}/variables")
          Variable createVariable​(@PathParam("releaseId")
                                  java.lang.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")
          java.util.List<Variable> updateVariables​(@PathParam("releaseId")
                                                   java.lang.String releaseId,
                                                   java.util.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")
                                  java.lang.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")
          java.util.List<java.lang.String> getPermissions()

      Returns possible permissions.
      Returns:
        list of permissions for releases

    - #### getTeams

          @GET
          @Path("/{releaseId:.*Release[^/]*}/teams")
          java.util.List<TeamView> getTeams​(@PathParam("releaseId")
                                            java.lang.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")
          java.util.List<TeamView> setTeams​(@PathParam("releaseId")
                                            java.lang.String releaseId,
                                            java.util.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")
                         java.lang.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")
                                java.lang.String releaseId,
                                @QueryParam("fromPhaseId")
                                java.lang.String phaseId,
                                @QueryParam("fromTaskId")
                                java.lang.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