Interface TemplateApi

  • All Superinterfaces:
    ApiService

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

      All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      com.xebialabs.xlrelease.domain.Release copyTemplate​(java.lang.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​(java.lang.String templateId, java.lang.String title, java.lang.String description)
      Makes a copy of the template on the current folder
      com.xebialabs.xlrelease.domain.Release create​(java.lang.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, java.lang.String folderId)
      Creates a template inside a folder.
      com.xebialabs.xlrelease.domain.variables.Variable createVariable​(java.lang.String templateId, com.xebialabs.xlrelease.api.v1.forms.Variable variable)
      Create a new variable.
      void deleteTemplate​(java.lang.String templateId)
      Deletes a template.
      void deleteVariable​(java.lang.String variableId)
      Delete variable from template.
      javax.ws.rs.core.Response downloadTemplateLogo​(java.lang.String logoId)  
      javax.ws.rs.core.Response exportTemplateToZip​(java.lang.String templateId)
      Exports template as a zip download, in xlr format
      java.util.List<java.lang.String> getPermissions()
      Returns possible permissions.
      java.util.List<com.xebialabs.xlrelease.api.v1.views.TeamView> getTeams​(java.lang.String templateId)
      Returns effective teams of the template.
      com.xebialabs.xlrelease.domain.Release getTemplate​(java.lang.String templateId)
      Returns the template for the given identifier.
      java.util.List<com.xebialabs.xlrelease.domain.Release> getTemplates​(java.lang.String filter)
      java.util.List<com.xebialabs.xlrelease.domain.Release> getTemplates​(java.lang.String title, java.util.List<java.lang.String> tags, java.lang.Long page, java.lang.Long resultsPerPage, java.lang.Integer depth)
      Returns the list of templates that are visible to the current user.
      com.xebialabs.xlrelease.domain.variables.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<com.xebialabs.xlrelease.domain.variables.Variable> getVariables​(java.lang.String templateId)
      Get variables.
      java.util.List<com.xebialabs.xlrelease.views.ImportResult> importTemplate​(java.lang.String json, java.lang.String folderId)
      Imports a template, serialized in JSON format.
      java.util.List<com.xebialabs.xlrelease.views.ImportResult> importTemplate​(java.lang.String json, java.lang.String folderId, java.lang.String version)
      Imports a template, serialized in JSON format.
      java.util.List<com.xebialabs.xlrelease.views.ImportResult> importTemplateAsXlr​(javax.servlet.http.HttpServletRequest request, java.lang.String folderId)
      Imports a template, serialized in XLR format, or a Releasefile (Releasefile.groovy) inside a .zip file.
      java.lang.Boolean isVariableUsed​(java.lang.String variableId)
      Returns true if variable with the given identifier is used in the template.
      void replaceVariable​(java.lang.String variableId, com.xebialabs.xlrelease.api.v1.forms.VariableOrValue variableOrValue)
      Replace variable occurrences with the given replacement.
      default java.lang.String serviceName()  
      java.util.List<com.xebialabs.xlrelease.api.v1.views.TeamView> setTeams​(java.lang.String templateId, java.util.List<com.xebialabs.xlrelease.api.v1.views.TeamView> teamDtos)
      Sets teams of the template.
      com.xebialabs.xlrelease.domain.Release start​(java.lang.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​(java.lang.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​(java.lang.String variableId, com.xebialabs.xlrelease.domain.variables.Variable variable)  
      java.util.List<com.xebialabs.xlrelease.domain.variables.Variable> updateVariables​(java.lang.String releaseId, java.util.List<com.xebialabs.xlrelease.domain.variables.Variable> variables)
      Update the variable list.
    • Method Detail

      • serviceName

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

        @GET
        java.util.List<com.xebialabs.xlrelease.domain.Release> getTemplates​(@QueryParam("title")
                                                                            java.lang.String title,
                                                                            @QueryParam("tag")
                                                                            java.util.List<java.lang.String> tags,
                                                                            @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 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
        java.util.List<com.xebialabs.xlrelease.domain.Release> getTemplates​(java.lang.String filter)
        Returns the list of the first 100 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")
                                                              java.lang.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")
                                                              java.lang.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")
        java.util.List<com.xebialabs.xlrelease.views.ImportResult> importTemplate​(java.lang.String json,
                                                                                  @QueryParam("folderId")
                                                                                  java.lang.String folderId,
                                                                                  @QueryParam("version")
                                                                                  java.lang.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

        java.util.List<com.xebialabs.xlrelease.views.ImportResult> importTemplate​(java.lang.String json,
                                                                                  java.lang.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")
        java.util.List<com.xebialabs.xlrelease.views.ImportResult> importTemplateAsXlr​(@Context
                                                                                       javax.servlet.http.HttpServletRequest request,
                                                                                       @QueryParam("folderId")
                                                                                       java.lang.String folderId)
                                                                                throws java.io.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:
        java.io.IOException
        org.apache.commons.fileupload.FileUploadException
      • getTemplate

        @GET
        @Path("/{templateId:.*Release[^/]*}")
        com.xebialabs.xlrelease.domain.Release getTemplate​(@PathParam("templateId")
                                                           java.lang.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")
                            java.lang.String templateId)
        Deletes a template.
        Parameters:
        templateId - the template identifier
      • create

        @POST
        @Path("/{templateId:.*Release[^/]*}/create")
        com.xebialabs.xlrelease.domain.Release create​(@PathParam("templateId")
                                                      java.lang.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")
                                                     java.lang.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")
        java.util.List<com.xebialabs.xlrelease.domain.variables.Variable> getVariables​(@PathParam("templateId")
                                                                                       java.lang.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")
                                                                      java.lang.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")
        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 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")
                             java.lang.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")
                            java.lang.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")
                                                                         java.lang.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")
        java.util.List<com.xebialabs.xlrelease.domain.variables.Variable> updateVariables​(@PathParam("releaseId")
                                                                                          java.lang.String releaseId,
                                                                                          java.util.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")
                                                                         java.lang.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")
        java.util.List<java.lang.String> getPermissions()
        Returns possible permissions.
        Returns:
        list of permissions for templates and releases
      • getTeams

        @GET
        @Path("/{templateId:.*Release[^/]*}/teams")
        java.util.List<com.xebialabs.xlrelease.api.v1.views.TeamView> getTeams​(@PathParam("templateId")
                                                                               java.lang.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")
        java.util.List<com.xebialabs.xlrelease.api.v1.views.TeamView> setTeams​(@PathParam("templateId")
                                                                               java.lang.String templateId,
                                                                               java.util.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")
        javax.ws.rs.core.Response exportTemplateToZip​(@PathParam("templateId")
                                                      java.lang.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")
                                                            java.lang.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​(java.lang.String templateId,
                                                                    java.lang.String title,
                                                                    java.lang.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")
        javax.ws.rs.core.Response downloadTemplateLogo​(@PathParam("logoId")
                                                       java.lang.String logoId)
                                                throws java.io.IOException
        Throws:
        java.io.IOException