CoreService

<back to all web services

QueryUserNotes

UserNote - CRUD

Returns a list of user notes

Requires Authentication
Required roles:TenantReader, TenantReader
The following routes are available for this service:
GET/api/usernotesReturns a list of user notes, filterable by ConfigItemId
GET/usernotesReturns a list of user notes, filterable by ConfigItemId
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
{

    /**
    * Returns a list of user notes
    */
    @Api(Description="Returns a list of user notes")
    @ApiResponse(Description="Ok", ResponseType=0, Culture=neutral, PublicKeyToken=null]].class, StatusCode=200)
    public static class QueryUserNotes extends QueryDb<UserNote> implements IGetMultipleRequest, IHasTenantName, IGet
    {
        @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
        @Validate(Validator="NotEmpty")
        public String tenantName = null;

        /**
        * Filter notes by the config item they are attached to
        */
        @ApiMember(DataType="string", Description="Filter notes by the config item they are attached to", Format="guid", ParameterType="query")
        public UUID configItemId = 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;
        
        public String getTenantName() { return tenantName; }
        public QueryUserNotes setTenantName(String value) { this.tenantName = value; return this; }
        public UUID getConfigItemId() { return configItemId; }
        public QueryUserNotes setConfigItemId(UUID value) { this.configItemId = value; return this; }
        public Boolean isIncludeDeleted() { return includeDeleted; }
        public QueryUserNotes setIncludeDeleted(Boolean value) { this.includeDeleted = 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 UserNote extends Auditable implements IHasId, IHasObjectType, IHasTenantId
    {
        public UUID id = null;
        @Required()
        @StringLength(MaximumLength=1000)
        public String message = null;

        @Required()
        public UUID configItemId = null;

        @Required()
        public ObjectTypes configItemType = null;

        @Required()
        public String configItemName = null;

        @Required()
        public UUID tenantId = null;

        @Ignore()
        public ObjectTypes objectType = null;
        
        public UUID getId() { return id; }
        public UserNote setId(UUID value) { this.id = value; return this; }
        public String getMessage() { return message; }
        public UserNote setMessage(String value) { this.message = value; return this; }
        public UUID getConfigItemId() { return configItemId; }
        public UserNote setConfigItemId(UUID value) { this.configItemId = value; return this; }
        public ObjectTypes getConfigItemType() { return configItemType; }
        public UserNote setConfigItemType(ObjectTypes value) { this.configItemType = value; return this; }
        public String getConfigItemName() { return configItemName; }
        public UserNote setConfigItemName(String value) { this.configItemName = value; return this; }
        public UUID getTenantId() { return tenantId; }
        public UserNote setTenantId(UUID value) { this.tenantId = value; return this; }
        public ObjectTypes getObjectType() { return objectType; }
        public UserNote setObjectType(ObjectTypes value) { this.objectType = 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;
    }

    @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;
    }

}

Java QueryUserNotes DTOs

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

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /api/usernotes 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","message":"String","configItemId":"00000000-0000-0000-0000-000000000000","configItemType":"None","configItemName":"String","tenantId":"00000000-0000-0000-0000-000000000000","objectType":"UserNote","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"}}}