| Required role: | TenantReader |
| GET | /api/jobs/ | Returns all jobs | |
|---|---|---|---|
| GET | /jobs/ | Returns all jobs |
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
import com.google.gson.annotations.*;
import com.google.gson.reflect.*;
public class dtos
{
/**
* Get jobs
*/
@Api(Description="Get jobs")
@ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=0, Culture=neutral, PublicKeyToken=null]].class, StatusCode=200)
public static class QueryJobs extends QueryDb<Job> implements IGetMultipleRequest, IHasTenantName, IGet, IGroupable
{
@ApiMember(DataType="string", IsRequired=true, ParameterType="header")
@Validate(Validator="NotEmpty")
public String tenantName = null;
/**
* If true, also soft deleted items will be returned
*/
@ApiMember(Description="If true, also soft deleted items will be returned", ParameterType="query")
public Boolean includeDeleted = null;
/**
* The property, the data will be grouped on
*/
@ApiMember(Description="The property, the data will be grouped on", ParameterType="query")
public String groupBy = null;
/**
* The property, used for aggregation
*/
@ApiMember(Description="The property, used for aggregation", ParameterType="query")
public String aggregateOn = null;
/**
* The aggregation function to use
*/
@ApiMember(Description="The aggregation function to use", ParameterType="query")
public Aggregations aggregation = null;
/**
* Returns all referenced object
*/
@ApiMember(Description="Returns all referenced object", ParameterType="query")
public Boolean includeReferencedObjects = null;
public String getTenantName() { return tenantName; }
public QueryJobs setTenantName(String value) { this.tenantName = value; return this; }
public Boolean isIncludeDeleted() { return includeDeleted; }
public QueryJobs setIncludeDeleted(Boolean value) { this.includeDeleted = value; return this; }
public String getGroupBy() { return groupBy; }
public QueryJobs setGroupBy(String value) { this.groupBy = value; return this; }
public String getAggregateOn() { return aggregateOn; }
public QueryJobs setAggregateOn(String value) { this.aggregateOn = value; return this; }
public Aggregations getAggregation() { return aggregation; }
public QueryJobs setAggregation(Aggregations value) { this.aggregation = value; return this; }
public Boolean isIncludeReferencedObjects() { return includeReferencedObjects; }
public QueryJobs setIncludeReferencedObjects(Boolean value) { this.includeReferencedObjects = value; return this; }
}
public static class QueryDb<T> extends QueryBase
{
}
@DataContract
public static class QueryBase
{
@DataMember(Order=1)
public Integer skip = null;
@DataMember(Order=2)
public Integer take = null;
@DataMember(Order=3)
public String orderBy = null;
@DataMember(Order=4)
public String orderByDesc = null;
@DataMember(Order=5)
public String include = null;
@DataMember(Order=6)
public String fields = null;
@DataMember(Order=7)
public HashMap<String,String> meta = null;
public Integer getSkip() { return skip; }
public QueryBase setSkip(Integer value) { this.skip = value; return this; }
public Integer getTake() { return take; }
public QueryBase setTake(Integer value) { this.take = value; return this; }
public String getOrderBy() { return orderBy; }
public QueryBase setOrderBy(String value) { this.orderBy = value; return this; }
public String getOrderByDesc() { return orderByDesc; }
public QueryBase setOrderByDesc(String value) { this.orderByDesc = value; return this; }
public String getInclude() { return include; }
public QueryBase setInclude(String value) { this.include = value; return this; }
public String getFields() { return fields; }
public QueryBase setFields(String value) { this.fields = value; return this; }
public HashMap<String,String> getMeta() { return meta; }
public QueryBase setMeta(HashMap<String,String> value) { this.meta = value; return this; }
}
public static class Job extends Auditable implements IHasTenantId, IHasIdName, IHasObjectType
{
public UUID id = null;
public UUID tenantId = null;
@Required()
@StringLength(MaximumLength=300)
public String name = null;
@StringLength(MaximumLength=500)
public String message = null;
@Ignore()
public ObjectTypes objectType = null;
@Ignore()
public String selfLink = null;
public UUID configItemId = null;
public ObjectTypes configItemType = null;
@Required()
public JobTypes jobType = null;
@Required()
public JobStates state = null;
@Required()
public Date startTime = null;
public Date endTime = null;
@Ignore()
public Integer duration = null;
@StringLength(MaximumLength=350)
public String workflowId = null;
@StringLength(MaximumLength=350)
public String schedulerId = null;
@Required()
public Double progress = null;
public HashMap<String,Object> config = new HashMap<String,Object>();
@Required()
@StringLength(MaximumLength=150)
public String createUserEmail = null;
@Required()
public Boolean sendNotifications = null;
@Ignore()
public Boolean isRunning = null;
@Required()
public Boolean needsAttention = null;
public UUID getId() { return id; }
public Job setId(UUID value) { this.id = value; return this; }
public UUID getTenantId() { return tenantId; }
public Job setTenantId(UUID value) { this.tenantId = value; return this; }
public String getName() { return name; }
public Job setName(String value) { this.name = value; return this; }
public String getMessage() { return message; }
public Job setMessage(String value) { this.message = value; return this; }
public ObjectTypes getObjectType() { return objectType; }
public Job setObjectType(ObjectTypes value) { this.objectType = value; return this; }
public String getSelfLink() { return selfLink; }
public Job setSelfLink(String value) { this.selfLink = value; return this; }
public UUID getConfigItemId() { return configItemId; }
public Job setConfigItemId(UUID value) { this.configItemId = value; return this; }
public ObjectTypes getConfigItemType() { return configItemType; }
public Job setConfigItemType(ObjectTypes value) { this.configItemType = value; return this; }
public JobTypes getJobType() { return jobType; }
public Job setJobType(JobTypes value) { this.jobType = value; return this; }
public JobStates getState() { return state; }
public Job setState(JobStates value) { this.state = value; return this; }
public Date getStartTime() { return startTime; }
public Job setStartTime(Date value) { this.startTime = value; return this; }
public Date getEndTime() { return endTime; }
public Job setEndTime(Date value) { this.endTime = value; return this; }
public Integer getDuration() { return duration; }
public Job setDuration(Integer value) { this.duration = value; return this; }
public String getWorkflowId() { return workflowId; }
public Job setWorkflowId(String value) { this.workflowId = value; return this; }
public String getSchedulerId() { return schedulerId; }
public Job setSchedulerId(String value) { this.schedulerId = value; return this; }
public Double getProgress() { return progress; }
public Job setProgress(Double value) { this.progress = value; return this; }
public HashMap<String,Object> getConfig() { return config; }
public Job setConfig(HashMap<String,Object> value) { this.config = value; return this; }
public String getCreateUserEmail() { return createUserEmail; }
public Job setCreateUserEmail(String value) { this.createUserEmail = value; return this; }
public Boolean isSendNotifications() { return sendNotifications; }
public Job setSendNotifications(Boolean value) { this.sendNotifications = value; return this; }
public Boolean getIsRunning() { return isRunning; }
public Job setIsRunning(Boolean value) { this.isRunning = value; return this; }
public Boolean isNeedsAttention() { return needsAttention; }
public Job setNeedsAttention(Boolean value) { this.needsAttention = value; return this; }
}
public static class Auditable implements IAuditable
{
@Required()
public Date created = null;
@Required()
public String createUser = null;
@Required()
public String createUserId = null;
@Required()
public Date modified = null;
@Required()
public String modifyUser = null;
@Required()
public String modifyUserId = null;
@Required()
public Boolean isDeleted = null;
public Date deleted = null;
public String deleteUser = null;
public String deleteUserId = null;
public Date getCreated() { return created; }
public Auditable setCreated(Date value) { this.created = value; return this; }
public String getCreateUser() { return createUser; }
public Auditable setCreateUser(String value) { this.createUser = value; return this; }
public String getCreateUserId() { return createUserId; }
public Auditable setCreateUserId(String value) { this.createUserId = value; return this; }
public Date getModified() { return modified; }
public Auditable setModified(Date value) { this.modified = value; return this; }
public String getModifyUser() { return modifyUser; }
public Auditable setModifyUser(String value) { this.modifyUser = value; return this; }
public String getModifyUserId() { return modifyUserId; }
public Auditable setModifyUserId(String value) { this.modifyUserId = value; return this; }
public Boolean getIsDeleted() { return isDeleted; }
public Auditable setIsDeleted(Boolean value) { this.isDeleted = value; return this; }
public Date getDeleted() { return deleted; }
public Auditable setDeleted(Date value) { this.deleted = value; return this; }
public String getDeleteUser() { return deleteUser; }
public Auditable setDeleteUser(String value) { this.deleteUser = value; return this; }
public String getDeleteUserId() { return deleteUserId; }
public Auditable setDeleteUserId(String value) { this.deleteUserId = value; return this; }
}
public static enum ObjectTypes
{
None,
ConfigItem,
Tenant,
Collection,
Resource,
ComputeNode,
VirtualMachine,
PhysicalMachine,
Disk,
Subnet,
IpAddress,
Job,
JobEvent,
FreezePeriod,
ResourceGroup,
Deployment,
ResourceGroupTemplate,
DeploymentTemplate,
ResourceProvider,
GenericResource,
Role,
Permission,
User,
PatchingWindow,
Update,
ReportDefinition,
TimeSeries,
DataPoint,
Action,
ActionAssignment,
UserNote;
}
public static enum JobTypes
{
Create,
Update,
Delete,
Start,
Stop,
Restart,
Backup,
Restore,
Patch,
Action;
}
public static enum JobStates
{
Pending,
Starting,
Running,
Suspended,
Stopping,
Completed,
Failed;
}
public static enum Aggregations
{
None,
Count,
DistinctCount,
Sum,
Min,
Max,
Avg,
First;
}
@DataContract
public static class QueryResponse<T>
{
@DataMember(Order=1)
public Integer offset = null;
@DataMember(Order=2)
public Integer total = null;
@DataMember(Order=3)
public ArrayList<TimeSeriesDefinition> results = new ArrayList<TimeSeriesDefinition>();
@DataMember(Order=4)
public HashMap<String,String> meta = null;
@DataMember(Order=5)
public ResponseStatus responseStatus = null;
public Integer getOffset() { return offset; }
public QueryResponse<T> setOffset(Integer value) { this.offset = value; return this; }
public Integer getTotal() { return total; }
public QueryResponse<T> setTotal(Integer value) { this.total = value; return this; }
public ArrayList<TimeSeriesDefinition> getResults() { return results; }
public QueryResponse<T> setResults(ArrayList<TimeSeriesDefinition> value) { this.results = value; return this; }
public HashMap<String,String> getMeta() { return meta; }
public QueryResponse<T> setMeta(HashMap<String,String> value) { this.meta = value; return this; }
public ResponseStatus getResponseStatus() { return responseStatus; }
public QueryResponse<T> setResponseStatus(ResponseStatus value) { this.responseStatus = value; return this; }
}
public static class TimeSeriesDefinition extends Auditable implements IHasIdName, IHasTenantId, IHasObjectType
{
public UUID id = null;
@References(Type=Tenant.class)
public UUID tenantId = null;
public Tenant tenant = null;
public String name = null;
public String displayName = null;
@Ignore()
public String selfLink = null;
@Required()
public ObjectTypes objectType = null;
public String description = null;
public ObjectTypes sourceType = null;
public Boolean autoCollection = null;
public String autoCollectionQuery = null;
public Integer autoCollectionInterval = null;
public IntervalUnits autoCollectionIntervalUnit = null;
public TimeSpan autoCollectionTime = null;
public Date lastAutoCollected = null;
public Integer retentionTimeMonths = null;
public UUID getId() { return id; }
public TimeSeriesDefinition setId(UUID value) { this.id = value; return this; }
public UUID getTenantId() { return tenantId; }
public TimeSeriesDefinition setTenantId(UUID value) { this.tenantId = value; return this; }
public Tenant getTenant() { return tenant; }
public TimeSeriesDefinition setTenant(Tenant value) { this.tenant = value; return this; }
public String getName() { return name; }
public TimeSeriesDefinition setName(String value) { this.name = value; return this; }
public String getDisplayName() { return displayName; }
public TimeSeriesDefinition setDisplayName(String value) { this.displayName = value; return this; }
public String getSelfLink() { return selfLink; }
public TimeSeriesDefinition setSelfLink(String value) { this.selfLink = value; return this; }
public ObjectTypes getObjectType() { return objectType; }
public TimeSeriesDefinition setObjectType(ObjectTypes value) { this.objectType = value; return this; }
public String getDescription() { return description; }
public TimeSeriesDefinition setDescription(String value) { this.description = value; return this; }
public ObjectTypes getSourceType() { return sourceType; }
public TimeSeriesDefinition setSourceType(ObjectTypes value) { this.sourceType = value; return this; }
public Boolean isAutoCollection() { return autoCollection; }
public TimeSeriesDefinition setAutoCollection(Boolean value) { this.autoCollection = value; return this; }
public String getAutoCollectionQuery() { return autoCollectionQuery; }
public TimeSeriesDefinition setAutoCollectionQuery(String value) { this.autoCollectionQuery = value; return this; }
public Integer getAutoCollectionInterval() { return autoCollectionInterval; }
public TimeSeriesDefinition setAutoCollectionInterval(Integer value) { this.autoCollectionInterval = value; return this; }
public IntervalUnits getAutoCollectionIntervalUnit() { return autoCollectionIntervalUnit; }
public TimeSeriesDefinition setAutoCollectionIntervalUnit(IntervalUnits value) { this.autoCollectionIntervalUnit = value; return this; }
public TimeSpan getAutoCollectionTime() { return autoCollectionTime; }
public TimeSeriesDefinition setAutoCollectionTime(TimeSpan value) { this.autoCollectionTime = value; return this; }
public Date getLastAutoCollected() { return lastAutoCollected; }
public TimeSeriesDefinition setLastAutoCollected(Date value) { this.lastAutoCollected = value; return this; }
public Integer getRetentionTimeMonths() { return retentionTimeMonths; }
public TimeSeriesDefinition setRetentionTimeMonths(Integer value) { this.retentionTimeMonths = value; return this; }
}
public static class Tenant extends ConfigItem implements IHasVariables
{
@Required()
@StringLength(MaximumLength=10)
public String name = null;
@Required()
public ObjectTypes objectType = null;
@Ignore()
public String selfLink = null;
@Required()
public IList<Variable> variables = null;
@Required()
public IList<String> allowedMailDomains = null;
@Required()
public IList<String> licensedModules = null;
@Required()
public Short defaultDeploymentLifetimeDays = null;
@Required()
public Short maxDeploymentLifetimeDays = null;
@Required()
public Short systemUnpatchedWarningDays = null;
@Required()
public Short systemBackupMissingWarningHours = null;
@Required()
public Short stopVulnerableResourceAfterDays = null;
@Required()
public Short deploymentExpirationWarningDays = null;
@Required()
public Short patchNotificationDays = null;
@Required()
public Boolean useCustomHostnames = null;
@Required()
public Short removeInactiveVulnerabilitiesAfterDays = null;
public String getName() { return name; }
public Tenant setName(String value) { this.name = value; return this; }
public ObjectTypes getObjectType() { return objectType; }
public Tenant setObjectType(ObjectTypes value) { this.objectType = value; return this; }
public String getSelfLink() { return selfLink; }
public Tenant setSelfLink(String value) { this.selfLink = value; return this; }
public IList<Variable> getVariables() { return variables; }
public Tenant setVariables(IList<Variable> value) { this.variables = value; return this; }
public IList<String> getAllowedMailDomains() { return allowedMailDomains; }
public Tenant setAllowedMailDomains(IList<String> value) { this.allowedMailDomains = value; return this; }
public IList<String> getLicensedModules() { return licensedModules; }
public Tenant setLicensedModules(IList<String> value) { this.licensedModules = value; return this; }
public Short getDefaultDeploymentLifetimeDays() { return defaultDeploymentLifetimeDays; }
public Tenant setDefaultDeploymentLifetimeDays(Short value) { this.defaultDeploymentLifetimeDays = value; return this; }
public Short getMaxDeploymentLifetimeDays() { return maxDeploymentLifetimeDays; }
public Tenant setMaxDeploymentLifetimeDays(Short value) { this.maxDeploymentLifetimeDays = value; return this; }
public Short getSystemUnpatchedWarningDays() { return systemUnpatchedWarningDays; }
public Tenant setSystemUnpatchedWarningDays(Short value) { this.systemUnpatchedWarningDays = value; return this; }
public Short getSystemBackupMissingWarningHours() { return systemBackupMissingWarningHours; }
public Tenant setSystemBackupMissingWarningHours(Short value) { this.systemBackupMissingWarningHours = value; return this; }
public Short getStopVulnerableResourceAfterDays() { return stopVulnerableResourceAfterDays; }
public Tenant setStopVulnerableResourceAfterDays(Short value) { this.stopVulnerableResourceAfterDays = value; return this; }
public Short getDeploymentExpirationWarningDays() { return deploymentExpirationWarningDays; }
public Tenant setDeploymentExpirationWarningDays(Short value) { this.deploymentExpirationWarningDays = value; return this; }
public Short getPatchNotificationDays() { return patchNotificationDays; }
public Tenant setPatchNotificationDays(Short value) { this.patchNotificationDays = value; return this; }
public Boolean isUseCustomHostnames() { return useCustomHostnames; }
public Tenant setUseCustomHostnames(Boolean value) { this.useCustomHostnames = value; return this; }
public Short getRemoveInactiveVulnerabilitiesAfterDays() { return removeInactiveVulnerabilitiesAfterDays; }
public Tenant setRemoveInactiveVulnerabilitiesAfterDays(Short value) { this.removeInactiveVulnerabilitiesAfterDays = value; return this; }
}
public static class ConfigItem extends Auditable implements IConfigItem
{
public UUID id = null;
@Required()
public String name = null;
@Required()
@StringLength(MaximumLength=250)
public String displayName = null;
@StringLength(MaximumLength=8000)
public String description = null;
public ObjectTypes objectType = null;
@Ignore()
public String selfLink = null;
@Required()
public IList<Tag> tags = null;
@Required()
public IList<PathItem> path = null;
public UUID getId() { return id; }
public ConfigItem setId(UUID value) { this.id = value; return this; }
public String getName() { return name; }
public ConfigItem setName(String value) { this.name = value; return this; }
public String getDisplayName() { return displayName; }
public ConfigItem setDisplayName(String value) { this.displayName = value; return this; }
public String getDescription() { return description; }
public ConfigItem setDescription(String value) { this.description = value; return this; }
public ObjectTypes getObjectType() { return objectType; }
public ConfigItem setObjectType(ObjectTypes value) { this.objectType = value; return this; }
public String getSelfLink() { return selfLink; }
public ConfigItem setSelfLink(String value) { this.selfLink = value; return this; }
public IList<Tag> getTags() { return tags; }
public ConfigItem setTags(IList<Tag> value) { this.tags = value; return this; }
public IList<PathItem> getPath() { return path; }
public ConfigItem setPath(IList<PathItem> value) { this.path = value; return this; }
}
public static class Tag
{
public String name = null;
public String value = null;
public Boolean isProtected = null;
public String getName() { return name; }
public Tag setName(String value) { this.name = value; return this; }
public String getValue() { return value; }
public Tag setValue(String value) { this.value = value; return this; }
public Boolean getIsProtected() { return isProtected; }
public Tag setIsProtected(Boolean value) { this.isProtected = value; return this; }
}
public static class PathItem
{
public String label = null;
public String link = null;
public ObjectTypes objectType = null;
public UUID objectId = null;
public String getLabel() { return label; }
public PathItem setLabel(String value) { this.label = value; return this; }
public String getLink() { return link; }
public PathItem setLink(String value) { this.link = value; return this; }
public ObjectTypes getObjectType() { return objectType; }
public PathItem setObjectType(ObjectTypes value) { this.objectType = value; return this; }
public UUID getObjectId() { return objectId; }
public PathItem setObjectId(UUID value) { this.objectId = value; return this; }
}
public static class Variable
{
public String name = null;
public String value = null;
public ValueDataType type = null;
public String description = null;
public Boolean isInherited = null;
public Environments environment = null;
public String getName() { return name; }
public Variable setName(String value) { this.name = value; return this; }
public String getValue() { return value; }
public Variable setValue(String value) { this.value = value; return this; }
public ValueDataType getType() { return type; }
public Variable setType(ValueDataType value) { this.type = value; return this; }
public String getDescription() { return description; }
public Variable setDescription(String value) { this.description = value; return this; }
public Boolean getIsInherited() { return isInherited; }
public Variable setIsInherited(Boolean value) { this.isInherited = value; return this; }
public Environments getEnvironment() { return environment; }
public Variable setEnvironment(Environments value) { this.environment = value; return this; }
}
public static enum ValueDataType
{
String,
Number,
Boolean,
List;
}
public static enum Environments
{
Lab,
Poc,
Dev,
Test,
Int,
Uat,
Prod;
}
public static enum IntervalUnits
{
Second,
Minute,
Hour,
Day,
Week,
Month,
Year;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /api/jobs/ HTTP/1.1 Host: core.starburst.svc Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"offset":0,"total":0,"results":[{"id":"00000000-0000-0000-0000-000000000000","tenantId":"00000000-0000-0000-0000-000000000000","name":"String","message":"String","objectType":"Job","selfLink":"/jobs/00000000-0000-0000-0000-000000000000","configItemId":"00000000-0000-0000-0000-000000000000","configItemType":"None","jobType":"Create","state":"Pending","startTime":"0001-01-01T00:00:00.0000000Z","endTime":"0001-01-01T00:00:00.0000000Z","duration":0,"workflowId":"String","schedulerId":"String","progress":0,"config":{"String":{}},"createUserEmail":"String","sendNotifications":false,"isRunning":true,"needsAttention":false,"created":"0001-01-01T00:00:00.0000000Z","createUser":"String","createUserId":"String","modified":"0001-01-01T00:00:00.0000000Z","modifyUser":"String","modifyUserId":"String","isDeleted":false,"deleted":"0001-01-01T00:00:00.0000000Z","deleteUser":"String","deleteUserId":"String"}],"meta":{"String":"String"},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}