CoreService

<back to all web services

QueryResourceProviders

ResourceProvider - CRUD

Returns all resourceproviders of a tenant

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
GET/api/resourceproviders/Returns all resourceproviders
GET/api/resourceproviders/searchReturns all resourceproviders
GET/resourceproviders/searchReturns all resourceproviders
GET/resourceproviders/Returns all resourceproviders
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 all resourceproviders of a tenant
    */
    @Api(Description="Returns all resourceproviders of a tenant")
    @ApiResponse(Description="The request endend successful", IsDefaultResponse=true, ResponseType=0, Culture=neutral, PublicKeyToken=null]].class, StatusCode=200)
    public static class QueryResourceProviders extends QueryDb<ResourceProvider> 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 QueryResourceProviders setTenantName(String value) { this.tenantName = value; return this; }
        public Boolean isIncludeDeleted() { return includeDeleted; }
        public QueryResourceProviders setIncludeDeleted(Boolean value) { this.includeDeleted = value; return this; }
        public String getGroupBy() { return groupBy; }
        public QueryResourceProviders setGroupBy(String value) { this.groupBy = value; return this; }
        public String getAggregateOn() { return aggregateOn; }
        public QueryResourceProviders setAggregateOn(String value) { this.aggregateOn = value; return this; }
        public Aggregations getAggregation() { return aggregation; }
        public QueryResourceProviders setAggregation(Aggregations value) { this.aggregation = value; return this; }
        public Boolean isIncludeReferencedObjects() { return includeReferencedObjects; }
        public QueryResourceProviders 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 ResourceProvider extends ConfigItem implements IHasTenantId
    {
        @Required()
        public UUID tenantId = null;

        @Required()
        @StringLength(MaximumLength=50)
        public String name = null;

        @Required()
        public Environments defaultEnvironment = null;

        @Required()
        public IList<Environments> allowedEnvironments = null;

        @Required()
        public ObjectTypes objectType = null;

        @Required()
        public ResourceProviderTypes type = null;

        @Ignore()
        public String selfLink = null;

        @Required()
        public IList<ProviderConfigEntry> config = null;

        @Required()
        public Boolean isDisabled = null;

        @Required()
        public Boolean isReadyForDeployments = null;

        public BigDecimal costCurrentMonth = null;
        public BigDecimal costLastMonth = null;
        public String costCurrency = null;
        
        public UUID getTenantId() { return tenantId; }
        public ResourceProvider setTenantId(UUID value) { this.tenantId = value; return this; }
        public String getName() { return name; }
        public ResourceProvider setName(String value) { this.name = value; return this; }
        public Environments getDefaultEnvironment() { return defaultEnvironment; }
        public ResourceProvider setDefaultEnvironment(Environments value) { this.defaultEnvironment = value; return this; }
        public IList<Environments> getAllowedEnvironments() { return allowedEnvironments; }
        public ResourceProvider setAllowedEnvironments(IList<Environments> value) { this.allowedEnvironments = value; return this; }
        public ObjectTypes getObjectType() { return objectType; }
        public ResourceProvider setObjectType(ObjectTypes value) { this.objectType = value; return this; }
        public ResourceProviderTypes getType() { return type; }
        public ResourceProvider setType(ResourceProviderTypes value) { this.type = value; return this; }
        public String getSelfLink() { return selfLink; }
        public ResourceProvider setSelfLink(String value) { this.selfLink = value; return this; }
        public IList<ProviderConfigEntry> getConfig() { return config; }
        public ResourceProvider setConfig(IList<ProviderConfigEntry> value) { this.config = value; return this; }
        public Boolean getIsDisabled() { return isDisabled; }
        public ResourceProvider setIsDisabled(Boolean value) { this.isDisabled = value; return this; }
        public Boolean getIsReadyForDeployments() { return isReadyForDeployments; }
        public ResourceProvider setIsReadyForDeployments(Boolean value) { this.isReadyForDeployments = value; return this; }
        public BigDecimal getCostCurrentMonth() { return costCurrentMonth; }
        public ResourceProvider setCostCurrentMonth(BigDecimal value) { this.costCurrentMonth = value; return this; }
        public BigDecimal getCostLastMonth() { return costLastMonth; }
        public ResourceProvider setCostLastMonth(BigDecimal value) { this.costLastMonth = value; return this; }
        public String getCostCurrency() { return costCurrency; }
        public ResourceProvider setCostCurrency(String value) { this.costCurrency = 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 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 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 enum Environments
    {
        Lab,
        Poc,
        Dev,
        Test,
        Int,
        Uat,
        Prod;
    }

    public static enum ResourceProviderTypes
    {
        Azure,
        AmazonWebServices,
        GoogleCloudPlatform,
        ActiveDirectoryServices,
        DomainNameSystem,
        SwisscomESC,
        AzureKeyVault;
    }

    public static class ProviderConfigEntry
    {
        public String name = null;
        public String value = null;
        public Boolean isSecure = null;
        
        public String getName() { return name; }
        public ProviderConfigEntry setName(String value) { this.name = value; return this; }
        public String getValue() { return value; }
        public ProviderConfigEntry setValue(String value) { this.value = value; return this; }
        public Boolean getIsSecure() { return isSecure; }
        public ProviderConfigEntry setIsSecure(Boolean value) { this.isSecure = value; return this; }
    }

    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 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 IntervalUnits
    {
        Second,
        Minute,
        Hour,
        Day,
        Week,
        Month,
        Year;
    }

}

Java QueryResourceProviders 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/resourceproviders/ 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":[{"tenantId":"00000000-0000-0000-0000-000000000000","name":"String","defaultEnvironment":"Lab","allowedEnvironments":null,"objectType":"ResourceProvider","type":"Azure","selfLink":"/resourceproviders/00000000-0000-0000-0000-000000000000","config":null,"isDisabled":false,"isReadyForDeployments":false,"costCurrentMonth":0,"costLastMonth":0,"costCurrency":"String","id":"00000000-0000-0000-0000-000000000000","displayName":"String","description":"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"}],"meta":{"String":"String"},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}