public class TasksResources extends AbstractBulkResources<TaskResourceRep>
Base URL: /vdc/task
Modifier and Type | Class and Description |
---|---|
static class |
TasksResources.State |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
END_TIME_PARAM |
static java.lang.Integer |
FETCH_ALL |
static java.lang.String |
MAX_COUNT_PARAM |
static java.lang.String |
RESOURCE_PARAM |
static java.lang.String |
START_TIME_PARAM |
static java.lang.String |
STATE_PARAM |
static java.net.URI |
SYSTEM_TENANT |
static java.lang.String |
TENANT_PARAM |
static java.net.URI |
USER_TENANT |
Constructor and Description |
---|
TasksResources(RestClient client) |
Modifier and Type | Method and Description |
---|---|
void |
delete(java.net.URI taskId)
Delete a task
|
java.util.List<TaskResourceRep> |
findByResource(java.net.URI resourceId) |
java.util.List<TaskResourceRep> |
findByState(java.net.URI tenantId,
TasksResources.State state)
Returns tasks matching a particular state for the given tenant
|
java.util.List<TaskResourceRep> |
findCreatedSince(java.net.URI tenantId,
long startTime,
int maxCount)
Returns the specified number of tasks that have been created for the given client since startTime
|
TaskStatsRestRep |
getStats() |
TaskStatsRestRep |
getStatsByTenant(java.net.URI tenantId)
Returns task statistics for the given tenant
|
java.util.List<NamedRelatedResourceRep> |
listAll() |
java.util.List<NamedRelatedResourceRep> |
listByTenant(java.net.URI tenantId)
List ALL tasks for a specific tenant (use
SYSTEM_TENANT for System level tasks). |
java.util.List<NamedRelatedResourceRep> |
listByTenant(java.net.URI tenantId,
int maxCount)
List specified number of tasks for a specific tenant (use
SYSTEM_TENANT for System level tasks). |
java.util.List<NamedRelatedResourceRep> |
listByTenant(java.net.URI tenantId,
int maxCount,
java.lang.Long startTime,
java.lang.Long endTime)
List all tasks for a specific tenant (use
SYSTEM_TENANT for System level tasks) that were started between
startTime and endTime
Tasks are returned sorted with the most recent task first |
void |
resume(java.net.URI taskId)
Resume a task
|
void |
rollback(java.net.URI taskId)
Rollback a task
|
TasksResources |
withInactive(boolean inactive)
Configures the fetch operations to include inactive resources.
|
TasksResources |
withInternal(boolean internal)
Configures the fetch operations to include internal resources.
|
getByIds, getByRefs, listBulkIds
addTags, get, get, getByIds, getByRefs, getTags, performSearch, performSearchBy, removeTags, search, updateTags
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getByIds, getByRefs
addTags, get, get, getTags, removeTags, search, updateTags
public static final java.net.URI SYSTEM_TENANT
public static final java.net.URI USER_TENANT
public static final java.lang.Integer FETCH_ALL
public static final java.lang.String TENANT_PARAM
public static final java.lang.String RESOURCE_PARAM
public static final java.lang.String MAX_COUNT_PARAM
public static final java.lang.String START_TIME_PARAM
public static final java.lang.String END_TIME_PARAM
public static final java.lang.String STATE_PARAM
public TasksResources(RestClient client)
public java.util.List<NamedRelatedResourceRep> listAll()
public java.util.List<NamedRelatedResourceRep> listByTenant(java.net.URI tenantId)
SYSTEM_TENANT
for System level tasks).
Tasks are returned sorted with the most recent task firsttenantId
- The tenant tasks are required forpublic java.util.List<NamedRelatedResourceRep> listByTenant(java.net.URI tenantId, int maxCount)
SYSTEM_TENANT
for System level tasks).
Tasks are returned sorted with the most recent task firsttenantId
- The tenant tasks are required formaxCount
- The maximum number of tasks to return. Use FETCH_ALL
for all taskspublic java.util.List<NamedRelatedResourceRep> listByTenant(java.net.URI tenantId, int maxCount, java.lang.Long startTime, java.lang.Long endTime)
SYSTEM_TENANT
for System level tasks) that were started between
startTime and endTime
Tasks are returned sorted with the most recent task firsttenantId
- The tenant tasks are required formaxCount
- Number of tasks to return or FETCH_ALL
for all matching tasksstartTime
- Time in milliseconds (Null if not required)endTime
- End time in milliseconds (Null if not required)public java.util.List<TaskResourceRep> findByResource(java.net.URI resourceId)
public java.util.List<TaskResourceRep> findByState(java.net.URI tenantId, TasksResources.State state)
public java.util.List<TaskResourceRep> findCreatedSince(java.net.URI tenantId, long startTime, int maxCount)
tenantId
- The tenant (use USER_TENANT
for current users tasks, or SYSTEM_TENANT
for system level tasksstartTime
- Number of milliseconds since Jan 1 (or Date().getTime())maxCount
- Number of tasks to return or FETCH_ALL
for all matching taskspublic TaskStatsRestRep getStats()
public void delete(java.net.URI taskId)
taskId
- task to deletepublic void resume(java.net.URI taskId)
taskId
- task to resumepublic void rollback(java.net.URI taskId)
taskId
- task to rollbackpublic TaskStatsRestRep getStatsByTenant(java.net.URI tenantId)
public TasksResources withInactive(boolean inactive)
AbstractResources
withInactive
in class AbstractResources<TaskResourceRep>
inactive
- whether to include inactive resources.public TasksResources withInternal(boolean internal)
AbstractResources
withInternal
in class AbstractResources<TaskResourceRep>
internal
- whether to include internal resources.