Package com.atlassian.jira.rest.v2.index
Class ReindexResource
java.lang.Object
com.atlassian.jira.rest.v2.index.ReindexResource
@Consumes("application/json")
@Produces("application/json")
@Path("reindex")
public class ReindexResource
extends Object
REST resource for starting/stopping/querying indexing.
- Since:
- v6.1.4
-
Constructor Summary
ConstructorsConstructorDescriptionReindexResource
(IndexLifecycleManager indexLifecycleManager, TaskManager taskManager, JiraAuthenticationContext jiraAuthenticationContext, PermissionManager permissionManager, JiraBaseUrls jiraBaseUrls, I18nHelper.BeanFactory i18nBeanFactory, IssueIndexingService issueIndexingService, com.atlassian.core.util.Clock clock, IssueFinder issueFinder, JohnsonProvider johnsonProvider) -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.Response
getReindexInfo
(long taskId) Returns information on the system reindexes.javax.ws.rs.core.Response
getReindexProgress
(long taskId) Returns information on the system reindexes.javax.ws.rs.core.Response
Kicks off a reindex.javax.ws.rs.core.Response
reindexIssues
(List<String> issueIds, boolean indexComments, boolean indexChangeHistory, boolean indexWorklogs) Reindexes one or more individual issues.
-
Constructor Details
-
ReindexResource
@Inject public ReindexResource(@Qualifier("indexLifecycleManager") IndexLifecycleManager indexLifecycleManager, TaskManager taskManager, JiraAuthenticationContext jiraAuthenticationContext, PermissionManager permissionManager, JiraBaseUrls jiraBaseUrls, I18nHelper.BeanFactory i18nBeanFactory, IssueIndexingService issueIndexingService, com.atlassian.core.util.Clock clock, IssueFinder issueFinder, JohnsonProvider johnsonProvider)
-
-
Method Details
-
reindexIssues
@POST @Path("issue") public javax.ws.rs.core.Response reindexIssues(@QueryParam("issueId") List<String> issueIds, @QueryParam("indexComments") @DefaultValue("false") boolean indexComments, @QueryParam("indexChangeHistory") @DefaultValue("false") boolean indexChangeHistory, @QueryParam("indexWorklogs") @DefaultValue("false") boolean indexWorklogs) Reindexes one or more individual issues. Indexing is performed synchronously - the call returns when indexing of the issues has completed or a failure occurs.Use either explicitly specified issue IDs or a JQL query to select issues to reindex.
- Parameters:
issueIds
- the IDs or keys of one or more issues to reindex.indexComments
- Indicates that comments should also be reindexed.indexChangeHistory
- Indicates that changeHistory should also be reindexed.indexWorklogs
- Indicates that worklogs should also be reindexed.- Returns:
- response indicating reindex time.
- Since:
- 6.4
-
reindex
@POST public javax.ws.rs.core.Response reindex(@QueryParam("type") String type, @QueryParam("indexComments") @DefaultValue("false") boolean indexComments, @QueryParam("indexChangeHistory") @DefaultValue("false") boolean indexChangeHistory, @QueryParam("indexWorklogs") @DefaultValue("false") boolean indexWorklogs) Kicks off a reindex. Need Admin permissions to perform this reindex.- Parameters:
type
- Case insensitive String indicating type of reindex. If omitted, then defaults to BACKGROUND_PREFERRED.indexComments
- Indicates that comments should also be reindexed. Not relevant for foreground reindex, where comments are always reindexed.indexChangeHistory
- Indicates that changeHistory should also be reindexed. Not relevant for foreground reindex, where changeHistory is always reindexed.indexWorklogs
- Indicates that worklogs should also be reindexed. Not relevant for foreground reindex, where worklogs are always reindexed.- Returns:
- Response that provides a redirect to the GET.
-
getReindexInfo
@GET public javax.ws.rs.core.Response getReindexInfo(@QueryParam("taskId") long taskId) Returns information on the system reindexes. If a reindex is currently taking place then information about this reindex is returned. If there is no active index task, then returns information about the latest reindex task run, otherwise returns a 404 indicating that no reindex has taken place.- Parameters:
taskId
- the id of an indexing task you wish to obtain details on. If omitted, then defaults to the standard behaviour and returns information on the active reindex task, or the last task to run if no reindex is taking place. . If there is no reindexing task with that id then a 404 is returned.- Since:
- v6.1.4
-
getReindexProgress
@GET @Path("progress") public javax.ws.rs.core.Response getReindexProgress(@QueryParam("taskId") long taskId) Returns information on the system reindexes. If a reindex is currently taking place then information about this reindex is returned. If there is no active index task, then returns information about the latest reindex task run, otherwise returns a 404 indicating that no reindex has taken place.- Parameters:
taskId
- the id of an indexing task you wish to obtain details on. If omitted, then defaults to the standard behaviour and returns information on the active reindex task, or the last task to run if no reindex is taking place. . If there is no reindexing task with that id then a 404 is returned.- Since:
- v6.1.4
-