Package com.xebialabs.xlrelease.api.v1
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
FieldsFields 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 TypeMethodDescriptioncom.xebialabs.xlrelease.domain.ReleasecopyTemplate(String templateId, com.xebialabs.xlrelease.api.v1.forms.CopyTemplate copyTemplate) Makes a copy of the template on the current folderdefault com.xebialabs.xlrelease.domain.ReleasecopyTemplate(String templateId, String title, String description) Makes a copy of the template on the current foldercom.xebialabs.xlrelease.domain.ReleaseCreates a release from a template.com.xebialabs.xlrelease.domain.ReleasecreateTemplate(com.xebialabs.xlrelease.domain.Release template, String folderId) Creates a template inside a folder.com.xebialabs.xlrelease.domain.variables.VariablecreateVariable(String templateId, com.xebialabs.xlrelease.api.v1.forms.Variable variable) Create a new variable.voiddeleteTemplate(String templateId) Deletes a template.voiddeleteVariable(String variableId) Delete variable from template.jakarta.ws.rs.core.ResponsedownloadTemplateLogo(String logoId) jakarta.ws.rs.core.ResponseexportTemplateToZip(String templateId) Exports template as a zip download, in xlr formatReturns possible permissions.List<com.xebialabs.xlrelease.api.v1.views.TeamView>Returns effective teams of the template.com.xebialabs.xlrelease.domain.ReleasegetTemplate(String templateId) Returns the template for the given identifier.List<com.xebialabs.xlrelease.domain.Release>getTemplates(String filter) Deprecated.default List<com.xebialabs.xlrelease.domain.Release>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.VariablegetVariable(String variableId) Returns the variable for the given identifier.getVariablePossibleValues(String variableId) 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.voidreplaceVariable(String variableId, com.xebialabs.xlrelease.api.v1.forms.VariableOrValue variableOrValue) Replace variable occurrences with the given replacement.default StringList<com.xebialabs.xlrelease.api.v1.views.TeamView>Sets teams of the template.com.xebialabs.xlrelease.domain.ReleaseStarts a release from a template.default com.xebialabs.xlrelease.domain.ReleaseupdateTemplate(com.xebialabs.xlrelease.domain.Release template) Updates the properties of a template.com.xebialabs.xlrelease.domain.ReleaseupdateTemplate(String templateId, com.xebialabs.xlrelease.domain.Release template) Updates the properties of a template.default com.xebialabs.xlrelease.domain.variables.VariableupdateVariable(com.xebialabs.xlrelease.domain.variables.Variable variable) Updates the properties of a variable.com.xebialabs.xlrelease.domain.variables.VariableupdateVariable(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
-
SERVICE_NAME
- See Also:
-
-
Method Details
-
serviceName
- Specified by:
serviceNamein interfaceApiService
-
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.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
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:
IOExceptionorg.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- theVariableobject describing the new variable.- Returns:
- created
Variableobject.
-
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
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/ReleaseYYYYcopyTemplate- : 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/ReleaseYYYYtitle- : the new template titledescription- : 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
-
getTemplates(String, List, Long, Long, Integer)