Interface TemplateApi

All Superinterfaces:
ApiService

@Path("/api/v1/templates") @Consumes("application/json") @Produces("application/json") public interface TemplateApi extends ApiService
Operations on templates.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.xebialabs.xlrelease.domain.Release
    copyTemplate(String templateId, com.xebialabs.xlrelease.api.v1.forms.CopyTemplate copyTemplate)
    Makes a copy of the template on the current folder
    default com.xebialabs.xlrelease.domain.Release
    copyTemplate(String templateId, String title, String description)
    Makes a copy of the template on the current folder
    com.xebialabs.xlrelease.domain.Release
    create(String templateId, com.xebialabs.xlrelease.api.v1.forms.CreateRelease createRelease)
    Creates a release from a template.
    com.xebialabs.xlrelease.domain.Release
    createTemplate(com.xebialabs.xlrelease.domain.Release template, String folderId)
    Creates a template inside a folder.
    com.xebialabs.xlrelease.domain.variables.Variable
    createVariable(String templateId, com.xebialabs.xlrelease.api.v1.forms.Variable variable)
    Create a new variable.
    void
    deleteTemplate(String templateId)
    Deletes a template.
    void
    deleteVariable(String variableId)
    Delete variable from template.
    jakarta.ws.rs.core.Response
     
    jakarta.ws.rs.core.Response
    Exports template as a zip download, in xlr format
    Returns possible permissions.
    List<com.xebialabs.xlrelease.api.v1.views.TeamView>
    getTeams(String templateId)
    Returns effective teams of the template.
    com.xebialabs.xlrelease.domain.Release
    getTemplate(String templateId)
    Returns the template for the given identifier.
    List<com.xebialabs.xlrelease.domain.Release>
    default List<com.xebialabs.xlrelease.domain.Release>
    getTemplates(String title, List<String> tags, Long page, Long resultsPerPage, Integer depth)
    Returns the list of release templates that are visible to the current user.
    List<com.xebialabs.xlrelease.domain.Release>
    getTemplates(String title, List<String> tags, String kind, Long page, Long resultsPerPage, Integer depth)
    Returns the list of release or workflow templates that are visible to the current user.
    com.xebialabs.xlrelease.domain.variables.Variable
    getVariable(String variableId)
    Returns the variable for the given identifier.
    Returns possible values for the variable with the given identifier.
    List<com.xebialabs.xlrelease.domain.variables.Variable>
    getVariables(String templateId)
    Get variables.
    List<com.xebialabs.xlrelease.views.ImportResult>
    importTemplate(String json, String folderId)
    Imports a template, serialized in JSON format.
    List<com.xebialabs.xlrelease.views.ImportResult>
    importTemplate(String json, String folderId, String version)
    Imports a template, serialized in JSON format.
    List<com.xebialabs.xlrelease.views.ImportResult>
    importTemplateAsXlr(jakarta.servlet.http.HttpServletRequest request, String folderId)
    Imports a template, serialized in XLR format, or a Releasefile (Releasefile.groovy) inside a .zip file.
    isVariableUsed(String variableId)
    Returns true if variable with the given identifier is used in the template.
    void
    replaceVariable(String variableId, com.xebialabs.xlrelease.api.v1.forms.VariableOrValue variableOrValue)
    Replace variable occurrences with the given replacement.
    default String
     
    List<com.xebialabs.xlrelease.api.v1.views.TeamView>
    setTeams(String templateId, List<com.xebialabs.xlrelease.api.v1.views.TeamView> teamDtos)
    Sets teams of the template.
    com.xebialabs.xlrelease.domain.Release
    start(String templateId, com.xebialabs.xlrelease.api.v1.forms.StartRelease startRelease)
    Starts a release from a template.
    default com.xebialabs.xlrelease.domain.Release
    updateTemplate(com.xebialabs.xlrelease.domain.Release template)
    Updates the properties of a template.
    com.xebialabs.xlrelease.domain.Release
    updateTemplate(String templateId, com.xebialabs.xlrelease.domain.Release template)
    Updates the properties of a template.
    default com.xebialabs.xlrelease.domain.variables.Variable
    updateVariable(com.xebialabs.xlrelease.domain.variables.Variable variable)
    Updates the properties of a variable.
    com.xebialabs.xlrelease.domain.variables.Variable
    updateVariable(String variableId, com.xebialabs.xlrelease.domain.variables.Variable variable)
     
    List<com.xebialabs.xlrelease.domain.variables.Variable>
    updateVariables(String releaseId, List<com.xebialabs.xlrelease.domain.variables.Variable> variables)
    Update the variable list.
  • Field Details

  • Method Details

    • serviceName

      default String serviceName()
      Specified by:
      serviceName in interface ApiService
    • getTemplates

      @GET List<com.xebialabs.xlrelease.domain.Release> getTemplates(@QueryParam("title") String title, @QueryParam("tag") List<String> tags, @DefaultValue("RELEASE") @QueryParam("kind") String kind, @DefaultValue("0") @QueryParam("page") Long page, @DefaultValue("100") @QueryParam("resultsPerPage") Long resultsPerPage, @DefaultValue("1") @QueryParam("depth") Integer depth)
      Returns the list of release or workflow templates that are visible to the current user.
      Parameters:
      title - an optional search filter containing the title of the template.
      tags - an optional search filter containing list of template tags.
      kind - the kind of template. Default value is release.
      page - the page of results to return. Default value is 0.
      resultsPerPage - the number of results per page. Default value is 100. Maximum value is 100.
      depth - the depth to search for. Default value is 1.
      Returns:
      a list of release templates.
    • getTemplates

      default List<com.xebialabs.xlrelease.domain.Release> getTemplates(String title, List<String> tags, Long page, Long resultsPerPage, Integer depth)
      Returns the list of release templates that are visible to the current user.
      Parameters:
      title - an optional search filter containing the title of the template.
      tags - an optional search filter containing list of template tags.
      page - the page of results to return. Default value is 0.
      resultsPerPage - the number of results per page. Default value is 100. Maximum value is 100.
      depth - the depth to search for. Default value is 1.
      Returns:
      a list of release templates.
    • getTemplates

      @Deprecated List<com.xebialabs.xlrelease.domain.Release> getTemplates(String filter)
      Returns the list of the first 100 release templates that are visible to the current user with depth 1.
      Parameters:
      filter - An optional search filter containing the title of the template
    • updateTemplate

      @PUT @Path("/{templateId:.*Release[^/]*}") com.xebialabs.xlrelease.domain.Release updateTemplate(@PathParam("templateId") String templateId, com.xebialabs.xlrelease.domain.Release template)
      Updates the properties of a template.
      Parameters:
      templateId - the template identifier.
      template - new contents of the template.
      Returns:
      the updated release template.
    • updateTemplate

      default com.xebialabs.xlrelease.domain.Release updateTemplate(com.xebialabs.xlrelease.domain.Release template)
      Updates the properties of a template.
      Parameters:
      template - new contents of the template.
      Returns:
      the updated release template.
    • createTemplate

      @POST com.xebialabs.xlrelease.domain.Release createTemplate(com.xebialabs.xlrelease.domain.Release template, @QueryParam("folderId") String folderId)
      Creates a template inside a folder.

      All nested configuration items (e.g. phases, tasks, teams) will be removed from the provided template, you can use corresponding phaseApi or taskApi for those.

      Parameters:
      template - the contents of the release template.
      folderId - an optional parameter to create a template inside a folder
      Returns:
      the created template.
    • importTemplate

      @POST @Path("/import") @Consumes("application/json") List<com.xebialabs.xlrelease.views.ImportResult> importTemplate(String json, @QueryParam("folderId") String folderId, @QueryParam("version") String version)
      Imports a template, serialized in JSON format.
      Parameters:
      json - JSON representation of the template.
      folderId - the target folder.
      version - the version of the template. (optional)
      Returns:
      the newly created release template
    • importTemplate

      List<com.xebialabs.xlrelease.views.ImportResult> importTemplate(String json, String folderId)
      Imports a template, serialized in JSON format.
      Parameters:
      json - JSON representation of the template.
      folderId - the target folder.
      Returns:
      the newly created release template
    • importTemplateAsXlr

      @POST @Path("/import") @Consumes("multipart/form-data") List<com.xebialabs.xlrelease.views.ImportResult> importTemplateAsXlr(@Context jakarta.servlet.http.HttpServletRequest request, @QueryParam("folderId") String folderId) throws IOException, org.apache.commons.fileupload.FileUploadException
      Imports a template, serialized in XLR format, or a Releasefile (Releasefile.groovy) inside a .zip file.
      Parameters:
      request - the HttpServletRequest
      Returns:
      the newly created release template
      Throws:
      IOException
      org.apache.commons.fileupload.FileUploadException
    • getTemplate

      @GET @Path("/{templateId:.*Release[^/]*}") com.xebialabs.xlrelease.domain.Release getTemplate(@PathParam("templateId") String templateId)
      Returns the template for the given identifier.
      Parameters:
      templateId - the template identifier.
      Returns:
      the release template.
    • deleteTemplate

      @DELETE @Path("/{templateId:.*Release[^/]*}") void deleteTemplate(@PathParam("templateId") String templateId)
      Deletes a template.
      Parameters:
      templateId - the template identifier
    • create

      @POST @Path("/{templateId:.*Release[^/]*}/create") com.xebialabs.xlrelease.domain.Release create(@PathParam("templateId") String templateId, com.xebialabs.xlrelease.api.v1.forms.CreateRelease createRelease)
      Creates a release from a template.
      Parameters:
      templateId - the template identifier of the template the release is based on.
      createRelease - the parameters for the new release.
      Returns:
      the newly created release.
    • start

      @POST @Path("/{templateId:.*Release[^/]*}/start") com.xebialabs.xlrelease.domain.Release start(@PathParam("templateId") String templateId, com.xebialabs.xlrelease.api.v1.forms.StartRelease startRelease)
      Starts a release from a template.
      Parameters:
      templateId - the template identifier of the template the release is based on.
      startRelease - the parameters for the new release.
      Returns:
      the newly created and started release.
    • getVariables

      @GET @Path("/{templateId:.*Release[^/]*}/variables") List<com.xebialabs.xlrelease.domain.variables.Variable> getVariables(@PathParam("templateId") String templateId)
      Get variables.
      Parameters:
      templateId - the identifier of the release or template.
      Returns:
      a list of variables.
    • getVariable

      @GET @Path("/{variableId:.*/Variable[^/]*}") com.xebialabs.xlrelease.domain.variables.Variable getVariable(@PathParam("variableId") String variableId)
      Returns the variable for the given identifier.
      Parameters:
      variableId - the identifier of the variable.
      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 template.
      Parameters:
      variableId - the variable ID.
      Returns:
      true if variable with the given identifier is used in the template.
    • replaceVariable

      @POST @Path("/{variableId:.*/Variable[^/]*}/replace") void replaceVariable(@PathParam("variableId") String variableId, com.xebialabs.xlrelease.api.v1.forms.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 template.
      Parameters:
      variableId - the variable ID.
    • createVariable

      @POST @Path("/{templateId:.*Release[^/]*}/variables") com.xebialabs.xlrelease.domain.variables.Variable createVariable(@PathParam("templateId") String templateId, com.xebialabs.xlrelease.api.v1.forms.Variable variable)
      Create a new variable.
      Parameters:
      templateId - the identifier of a template.
      variable - the Variable object describing the new variable.
      Returns:
      created Variable object.
    • updateVariables

      @PUT @Path("/{releaseId:.*Release[^/]*}/variables") List<com.xebialabs.xlrelease.domain.variables.Variable> updateVariables(@PathParam("releaseId") String releaseId, List<com.xebialabs.xlrelease.domain.variables.Variable> variables)
      Update the variable list.
      Parameters:
      releaseId - the identifier of the release.
      variables - the variable list to update.
      Returns:
      updated variables.
    • updateVariable

      @PUT @Path("/{variableId:.*/Variable[^/]*}") com.xebialabs.xlrelease.domain.variables.Variable updateVariable(@PathParam("variableId") String variableId, com.xebialabs.xlrelease.domain.variables.Variable variable)
    • updateVariable

      default com.xebialabs.xlrelease.domain.variables.Variable updateVariable(com.xebialabs.xlrelease.domain.variables.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 templates and releases
    • getTeams

      @GET @Path("/{templateId:.*Release[^/]*}/teams") List<com.xebialabs.xlrelease.api.v1.views.TeamView> getTeams(@PathParam("templateId") String templateId)
      Returns effective teams of the template.
      Parameters:
      templateId - the identifier of the template
      Returns:
      a list of effective teams
    • setTeams

      @POST @Path("/{templateId:.*Release[^/]*}/teams") List<com.xebialabs.xlrelease.api.v1.views.TeamView> setTeams(@PathParam("templateId") String templateId, List<com.xebialabs.xlrelease.api.v1.views.TeamView> teamDtos)
      Sets teams of the template.
      Parameters:
      templateId - the identifier of the template
      Returns:
      a list of updated teams
    • exportTemplateToZip

      @GET @Path("zip/{templateId:.*Release[^/]*}") @Produces("application/octet-stream") jakarta.ws.rs.core.Response exportTemplateToZip(@PathParam("templateId") String templateId)
      Exports template as a zip download, in xlr format
      Parameters:
      templateId - the identifier of the template
      Returns:
      zip archive of template
    • copyTemplate

      @POST @Path("/{templateId:.*Release[^/]*}/copy") com.xebialabs.xlrelease.domain.Release copyTemplate(@PathParam("templateId") String templateId, com.xebialabs.xlrelease.api.v1.forms.CopyTemplate copyTemplate)
      Makes a copy of the template on the current folder
      Parameters:
      templateId - : the full templateID: Applications/FolderXXXX/ReleaseYYYY
      copyTemplate - : new properties of the template
      Returns:
      the new template
      Since:
      10.0
    • copyTemplate

      default com.xebialabs.xlrelease.domain.Release copyTemplate(String templateId, String title, String description)
      Makes a copy of the template on the current folder
      Parameters:
      templateId - : the full templateID: Applications/FolderXXXX/ReleaseYYYY
      title - : the new template title
      description - : the new template description
      Returns:
      the new template
      Since:
      10.0
    • downloadTemplateLogo

      @GET @Path("logo/{logoId:.*/TemplateLogo[^/]*}") @Produces("application/octet-stream") jakarta.ws.rs.core.Response downloadTemplateLogo(@PathParam("logoId") String logoId) throws IOException
      Throws:
      IOException