| Required role: | TenantReader |
| GET | /api/tenants/ | Returns a specific tenant | |
|---|---|---|---|
| GET | /tenants/ | Returns a specific tenant |
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
/**
* Returns a single tenant
*/
@Api(Description="Returns a single tenant")
@ApiResponse(Description="The tenant", IsDefaultResponse=true, ResponseType=TenantDto.class, StatusCode=200)
public static class GetTenant implements IGetSingleRequest, IHasTenantName, IGet
{
@ApiMember(DataType="string", IsRequired=true, ParameterType="header")
@Validate(Validator="NotEmpty")
public String tenantName = null;
@ApiMember(ParameterType="query", Verb="GET")
public Boolean includeReferencedObjects = null;
@ApiMember(ParameterType="query", Verb="GET")
public Boolean includeDeleted = null;
public String getTenantName() { return tenantName; }
public GetTenant setTenantName(String value) { this.tenantName = value; return this; }
public Boolean isIncludeReferencedObjects() { return includeReferencedObjects; }
public GetTenant setIncludeReferencedObjects(Boolean value) { this.includeReferencedObjects = value; return this; }
public Boolean isIncludeDeleted() { return includeDeleted; }
public GetTenant setIncludeDeleted(Boolean value) { this.includeDeleted = value; return this; }
}
public static class TenantDto extends ConfigItemDto
{
/**
* Variables defined on tenant level
*/
public IList<VariableDto> variables = null;
/**
* Allowed email domains used for authentication
*/
public IList<String> allowedMailDomains = null;
/**
* List of licensed modules for this tenant
*/
public IList<String> licensedModules = null;
/**
* Amount of days until a Deployment expires
*/
public Short defaultDeploymentLifetimeDays = null;
/**
* Max amount of days until a Deployment expires
*/
public Short maxDeploymentLifetimeDays = null;
/**
* Amount of days without patching until a unpatched warning is shown
*/
public Short systemUnpatchedWarningDays = null;
/**
* Amount of hours without backup until a backup missing warning is shown
*/
public Short systemBackupMissingWarningHours = null;
/**
* Amount of days until a vulnerable resource is getting stopped
*/
public Short stopVulnerableResourceAfterDays = null;
/**
* Amount of days before deployment expiration, which triggers the expiration warning
*/
public Short deploymentExpirationWarningDays = null;
/**
* Amount of days the patch notification is sent out prior to the patch date
*/
public Short patchNotificationDays = null;
/**
* Use a pool with your own hostnames (true) or let the hostname be auto generated (false)
*/
public Boolean useCustomHostnames = null;
/**
* After how many days inactive vulnerabilities will be purged from database
*/
public Short removeInactiveVulnerabilitiesAfterDays = null;
public IList<LinkDto> links = null;
public IList<VariableDto> getVariables() { return variables; }
public TenantDto setVariables(IList<VariableDto> value) { this.variables = value; return this; }
public IList<String> getAllowedMailDomains() { return allowedMailDomains; }
public TenantDto setAllowedMailDomains(IList<String> value) { this.allowedMailDomains = value; return this; }
public IList<String> getLicensedModules() { return licensedModules; }
public TenantDto setLicensedModules(IList<String> value) { this.licensedModules = value; return this; }
public Short getDefaultDeploymentLifetimeDays() { return defaultDeploymentLifetimeDays; }
public TenantDto setDefaultDeploymentLifetimeDays(Short value) { this.defaultDeploymentLifetimeDays = value; return this; }
public Short getMaxDeploymentLifetimeDays() { return maxDeploymentLifetimeDays; }
public TenantDto setMaxDeploymentLifetimeDays(Short value) { this.maxDeploymentLifetimeDays = value; return this; }
public Short getSystemUnpatchedWarningDays() { return systemUnpatchedWarningDays; }
public TenantDto setSystemUnpatchedWarningDays(Short value) { this.systemUnpatchedWarningDays = value; return this; }
public Short getSystemBackupMissingWarningHours() { return systemBackupMissingWarningHours; }
public TenantDto setSystemBackupMissingWarningHours(Short value) { this.systemBackupMissingWarningHours = value; return this; }
public Short getStopVulnerableResourceAfterDays() { return stopVulnerableResourceAfterDays; }
public TenantDto setStopVulnerableResourceAfterDays(Short value) { this.stopVulnerableResourceAfterDays = value; return this; }
public Short getDeploymentExpirationWarningDays() { return deploymentExpirationWarningDays; }
public TenantDto setDeploymentExpirationWarningDays(Short value) { this.deploymentExpirationWarningDays = value; return this; }
public Short getPatchNotificationDays() { return patchNotificationDays; }
public TenantDto setPatchNotificationDays(Short value) { this.patchNotificationDays = value; return this; }
public Boolean isUseCustomHostnames() { return useCustomHostnames; }
public TenantDto setUseCustomHostnames(Boolean value) { this.useCustomHostnames = value; return this; }
public Short getRemoveInactiveVulnerabilitiesAfterDays() { return removeInactiveVulnerabilitiesAfterDays; }
public TenantDto setRemoveInactiveVulnerabilitiesAfterDays(Short value) { this.removeInactiveVulnerabilitiesAfterDays = value; return this; }
public IList<LinkDto> getLinks() { return links; }
public TenantDto setLinks(IList<LinkDto> value) { this.links = value; return this; }
}
public static class ConfigItemDto implements IConfigItem
{
public UUID id = null;
public String name = null;
public String displayName = null;
public String description = null;
public ObjectTypes objectType = null;
public String selfLink = null;
public IList<TagDto> tags = null;
public IList<PathItemDto> path = null;
public Date created = null;
public String createUser = null;
public String createUserId = null;
public Date modified = null;
public String modifyUser = null;
public String modifyUserId = null;
public Boolean isDeleted = null;
public Date deleted = null;
public String deleteUser = null;
public String deleteUserId = null;
public IList<LinkDto> links = null;
public UUID getId() { return id; }
public ConfigItemDto setId(UUID value) { this.id = value; return this; }
public String getName() { return name; }
public ConfigItemDto setName(String value) { this.name = value; return this; }
public String getDisplayName() { return displayName; }
public ConfigItemDto setDisplayName(String value) { this.displayName = value; return this; }
public String getDescription() { return description; }
public ConfigItemDto setDescription(String value) { this.description = value; return this; }
public ObjectTypes getObjectType() { return objectType; }
public ConfigItemDto setObjectType(ObjectTypes value) { this.objectType = value; return this; }
public String getSelfLink() { return selfLink; }
public ConfigItemDto setSelfLink(String value) { this.selfLink = value; return this; }
public IList<TagDto> getTags() { return tags; }
public ConfigItemDto setTags(IList<TagDto> value) { this.tags = value; return this; }
public IList<PathItemDto> getPath() { return path; }
public ConfigItemDto setPath(IList<PathItemDto> value) { this.path = value; return this; }
public Date getCreated() { return created; }
public ConfigItemDto setCreated(Date value) { this.created = value; return this; }
public String getCreateUser() { return createUser; }
public ConfigItemDto setCreateUser(String value) { this.createUser = value; return this; }
public String getCreateUserId() { return createUserId; }
public ConfigItemDto setCreateUserId(String value) { this.createUserId = value; return this; }
public Date getModified() { return modified; }
public ConfigItemDto setModified(Date value) { this.modified = value; return this; }
public String getModifyUser() { return modifyUser; }
public ConfigItemDto setModifyUser(String value) { this.modifyUser = value; return this; }
public String getModifyUserId() { return modifyUserId; }
public ConfigItemDto setModifyUserId(String value) { this.modifyUserId = value; return this; }
public Boolean getIsDeleted() { return isDeleted; }
public ConfigItemDto setIsDeleted(Boolean value) { this.isDeleted = value; return this; }
public Date getDeleted() { return deleted; }
public ConfigItemDto setDeleted(Date value) { this.deleted = value; return this; }
public String getDeleteUser() { return deleteUser; }
public ConfigItemDto setDeleteUser(String value) { this.deleteUser = value; return this; }
public String getDeleteUserId() { return deleteUserId; }
public ConfigItemDto setDeleteUserId(String value) { this.deleteUserId = value; return this; }
public IList<LinkDto> getLinks() { return links; }
public ConfigItemDto setLinks(IList<LinkDto> value) { this.links = 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 class TagDto
{
public String name = null;
public String value = null;
public Boolean isProtected = null;
public String getName() { return name; }
public TagDto setName(String value) { this.name = value; return this; }
public String getValue() { return value; }
public TagDto setValue(String value) { this.value = value; return this; }
public Boolean getIsProtected() { return isProtected; }
public TagDto setIsProtected(Boolean value) { this.isProtected = value; return this; }
}
public static class PathItemDto
{
public String label = null;
public String link = null;
public ObjectTypes objectType = null;
public UUID objectId = null;
public String getLabel() { return label; }
public PathItemDto setLabel(String value) { this.label = value; return this; }
public String getLink() { return link; }
public PathItemDto setLink(String value) { this.link = value; return this; }
public ObjectTypes getObjectType() { return objectType; }
public PathItemDto setObjectType(ObjectTypes value) { this.objectType = value; return this; }
public UUID getObjectId() { return objectId; }
public PathItemDto setObjectId(UUID value) { this.objectId = value; return this; }
}
public static class LinkDto
{
public String caption = null;
public String rel = null;
public String hRef = null;
public String method = null;
public String getCaption() { return caption; }
public LinkDto setCaption(String value) { this.caption = value; return this; }
public String getRel() { return rel; }
public LinkDto setRel(String value) { this.rel = value; return this; }
public String getHRef() { return hRef; }
public LinkDto setHRef(String value) { this.hRef = value; return this; }
public String getMethod() { return method; }
public LinkDto setMethod(String value) { this.method = value; return this; }
}
public static class VariableDto
{
public String name = null;
/**
* Value in form of a json string (e.g. Number = 1234, String = "foo", Boolean = false, List = [1,2,3,4]). Note: string values need extra quotes
*/
public String value = null;
/**
* The data type of the value property
*/
public ValueDataType type = null;
public String description = null;
public Boolean isInherited = null;
public Environments environment = null;
public String getName() { return name; }
public VariableDto setName(String value) { this.name = value; return this; }
public String getValue() { return value; }
public VariableDto setValue(String value) { this.value = value; return this; }
public ValueDataType getType() { return type; }
public VariableDto setType(ValueDataType value) { this.type = value; return this; }
public String getDescription() { return description; }
public VariableDto setDescription(String value) { this.description = value; return this; }
public Boolean getIsInherited() { return isInherited; }
public VariableDto setIsInherited(Boolean value) { this.isInherited = value; return this; }
public Environments getEnvironment() { return environment; }
public VariableDto 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;
}
}
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/tenants/ HTTP/1.1 Host: core.starburst.svc Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"variables":null,"allowedMailDomains":null,"licensedModules":null,"defaultDeploymentLifetimeDays":0,"maxDeploymentLifetimeDays":0,"systemUnpatchedWarningDays":0,"systemBackupMissingWarningHours":0,"stopVulnerableResourceAfterDays":0,"deploymentExpirationWarningDays":0,"patchNotificationDays":0,"useCustomHostnames":false,"removeInactiveVulnerabilitiesAfterDays":0,"links":[{"caption":"Collections","rel":"down","hRef":"/collections/","method":"GET"}],"id":"00000000-0000-0000-0000-000000000000","name":"String","displayName":"String","description":"String","objectType":"None","selfLink":"String","tags":null,"path":null,"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"}