| Requires the role: | TenantReader |
| GET | /api/patching/windows/assignments | Returns a list of patch window assignments | |
|---|---|---|---|
| GET | /patching/windows/assignments | Returns a list of patch window assignments |
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*
/**
* Returns a list of patching windows
*/
@Api(Description="Returns a list of patching windows")
@ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=0, Culture=neutral, PublicKeyToken=null]]::class, StatusCode=200)
open class QueryPatchingWindowAssignments : QueryDb<PatchingWindowAssignment>(), IBaseRequest, IHasTenantName, IGet, IGroupable
{
@ApiMember(DataType="string", IsRequired=true, ParameterType="header")
@Validate(Validator="NotEmpty")
override var tenantName:String? = null
/**
* The property, the data will be grouped on
*/
@ApiMember(Description="The property, the data will be grouped on", ParameterType="query")
override var groupBy:String? = null
/**
* The property, used for aggregation
*/
@ApiMember(Description="The property, used for aggregation", ParameterType="query")
override var aggregateOn:String? = null
/**
* The aggregation function to use
*/
@ApiMember(Description="The aggregation function to use", ParameterType="query")
override var aggregation:Aggregations? = null
}
open class QueryDb<T> : QueryBase()
{
}
@DataContract
open class QueryBase
{
@DataMember(Order=1)
open var skip:Int? = null
@DataMember(Order=2)
open var take:Int? = null
@DataMember(Order=3)
open var orderBy:String? = null
@DataMember(Order=4)
open var orderByDesc:String? = null
@DataMember(Order=5)
open var include:String? = null
@DataMember(Order=6)
open var fields:String? = null
@DataMember(Order=7)
open var meta:HashMap<String,String>? = null
}
open class PatchingWindowAssignment : INotSoftDeletable, IHasId
{
override var id:UUID? = null
@References(Type=Resource::class)
open var resourceId:UUID? = null
open var resource:Resource? = null
@References(Type=PatchingWindow::class)
open var patchingWindowId:UUID? = null
open var patchingWindow:PatchingWindow? = null
@Ignore()
open var selfLink:String? = null
}
open class Resource : ConfigItem(), IHasTenantId, IHasVariables, IEnvironmentSpecific
{
@Required()
override var tenantId:UUID? = null
@StringLength(MaximumLength=350)
open var extId:String? = null
@StringLength(MaximumLength=350)
open var extType:String? = null
@StringLength(MaximumLength=350)
open var extName:String? = null
@Required()
@StringLength(MaximumLength=50)
override var name:String? = null
@Required()
override var objectType:ObjectTypes? = null
@Required()
override var selfLink:String? = null
@Required()
@References(Type=ResourceGroup::class)
open var parentId:UUID? = null
open var parent:ResourceGroup? = null
@Required()
@References(Type=Deployment::class)
open var deploymentId:UUID? = null
open var deployment:Deployment? = null
@Required()
@References(Type=DeploymentCollection::class)
open var collectionId:UUID? = null
open var collection:DeploymentCollection? = null
@Required()
@References(Type=ResourceProvider::class)
open var resourceProviderId:UUID? = null
open var resourceProvider:ResourceProvider? = null
@Required()
open var state:OperationalStates? = null
@Required()
override var environment:Environments? = null
@Required()
override var variables:IList<Variable>? = null
@StringLength(MaximumLength=350)
open var location:String? = null
open var lastSeen:Date? = null
open var lastPatchDate:Date? = null
open var nextPatchDate:Date? = null
open var lastBackupDate:Date? = null
@Required()
open var isForeign:Boolean? = null
@Required()
open var isAlerting:Boolean? = null
@StringLength(MaximumLength=200)
open var alertingDisabledId:String? = null
@StringLength(MaximumLength=1000)
open var alertingDisabledReason:String? = null
@Required()
open var isVulnerable:Boolean? = null
@StringLength(MaximumLength=1000)
open var vulnerabilityReason:String? = null
open var vulnerableSince:Date? = null
@Required()
open var isMissingOnProvider:Boolean? = null
@Required()
open var supportsStartStop:Boolean? = null
open var costCurrentMonth:BigDecimal? = null
open var costLastMonth:BigDecimal? = null
open var costCurrency:String? = null
@Required()
open var config:HashMap<String,Object> = HashMap<String,Object>()
}
open class ConfigItem : Auditable(), IConfigItem
{
open var id:UUID? = null
@Required()
open var name:String? = null
@Required()
@StringLength(MaximumLength=250)
override var displayName:String? = null
@StringLength(MaximumLength=8000)
override var description:String? = null
open var objectType:ObjectTypes? = null
@Ignore()
override var selfLink:String? = null
@Required()
override var tags:IList<Tag>? = null
@Required()
override var path:IList<PathItem>? = null
}
open class Auditable : IAuditable
{
@Required()
override var created:Date? = null
@Required()
override var createUser:String? = null
@Required()
override var createUserId:String? = null
@Required()
override var modified:Date? = null
@Required()
override var modifyUser:String? = null
@Required()
override var modifyUserId:String? = null
@Required()
override var isDeleted:Boolean? = null
override var deleted:Date? = null
override var deleteUser:String? = null
override var deleteUserId:String? = null
}
enum class 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,
}
open class Tag
{
open var name:String? = null
open var value:String? = null
open var isProtected:Boolean? = null
}
open class PathItem
{
open var label:String? = null
open var link:String? = null
open var objectType:ObjectTypes? = null
open var objectId:UUID? = null
}
open class ResourceGroup : ConfigItem(), IHasTenantId, IHasVariables, IEnvironmentSpecific, IHasSequence
{
@Required()
open var shortId:String? = null
@Required()
override var tenantId:UUID? = null
@Required()
@StringLength(MaximumLength=50)
override var name:String? = null
@Required()
override var objectType:ObjectTypes? = null
@Ignore()
override var selfLink:String? = null
@Required()
override var environment:Environments? = null
@Required()
open var state:LifecycleStates? = null
@Required()
@References(Type=Deployment::class)
open var parentId:UUID? = null
open var parent:Deployment? = null
open var templateId:UUID? = null
@Required()
open var parameters:IList<Parameter>? = null
@Required()
override var variables:IList<Variable>? = null
open var nextPatchDate:Date? = null
open var composition:ResourceCompositions? = null
}
enum class Environments
{
Lab,
Poc,
Dev,
Test,
Int,
Uat,
Prod,
}
enum class LifecycleStates
{
New,
Deploying,
Deployed,
Removing,
Removed,
Failure,
Imported,
}
open class Deployment : ConfigItem(), IHasTenantId, IHasVariables, IEnvironmentSpecific, IHasSequence
{
@Required()
open var shortId:String? = null
@Required()
override var tenantId:UUID? = null
@Required()
@StringLength(MaximumLength=100)
override var name:String? = null
@Required()
open var nameUserDefinedPart:String? = null
@Required()
override var objectType:ObjectTypes? = null
@Ignore()
override var selfLink:String? = null
@Required()
open var state:LifecycleStates? = null
@Required()
override var environment:Environments? = null
open var templateId:UUID? = null
@Required()
open var parameters:IList<Parameter>? = null
@Required()
override var variables:IList<Variable>? = null
@Required()
open var variablesSnapshot:IList<Variable>? = null
@Required()
@References(Type=DeploymentCollection::class)
open var parentId:UUID? = null
open var parent:DeploymentCollection? = null
@Required()
open var validFrom:Date? = null
open var validUntil:Date? = null
@Required()
open var isNeverExpiring:Boolean? = null
open var nextPatchDate:Date? = null
@Required()
open var defaultResourceProviderId:UUID? = null
@Required()
open var needsAttention:Boolean? = null
open var composition:ResourceCompositions? = null
open var monthlyBudget:BigDecimal? = null
open var sendBudgetNotificationMails:Boolean? = null
open var budgetWarningThresholdPercent:Int? = null
open var operationalState:OperationalStates? = null
open var resourcesRunning:Int? = null
open var resourcesTotal:Int? = null
}
open class Parameter
{
open var name:String? = null
open var description:String? = null
open var value:String? = null
@SerializedName("default") open var Default:String? = null
open var optional:Boolean? = null
@SerializedName("type") open var Type:ParameterValueType? = null
open var validation:String? = null
}
enum class ParameterValueType
{
String,
Number,
Boolean,
SecureString,
}
open class Variable
{
open var name:String? = null
open var value:String? = null
@SerializedName("type") open var Type:ValueDataType? = null
open var description:String? = null
open var isInherited:Boolean? = null
open var environment:Environments? = null
}
enum class ValueDataType
{
String,
Number,
Boolean,
List,
}
open class DeploymentCollection : ConfigItem(), IHasTenantId, IHasVariables
{
@Required()
override var tenantId:UUID? = null
@Required()
@StringLength(MaximumLength=50)
override var name:String? = null
@Required()
override var objectType:ObjectTypes? = null
@Ignore()
override var selfLink:String? = null
@Required()
override var variables:IList<Variable>? = null
@Required()
open var isLostAndFound:Boolean? = null
open var monthlyBudget:BigDecimal? = null
open var sendBudgetNotificationMails:Boolean? = null
open var budgetWarningThresholdPercent:Int? = null
}
enum class ResourceCompositions
{
Native,
Foreign,
Mixed,
}
enum class OperationalStates
{
None,
Starting,
Running,
Stopping,
Stopped,
Restarting,
Deleting,
Unknown,
}
open class ResourceProvider : ConfigItem(), IHasTenantId
{
@Required()
override var tenantId:UUID? = null
@Required()
@StringLength(MaximumLength=50)
override var name:String? = null
@Required()
open var defaultEnvironment:Environments? = null
@Required()
open var allowedEnvironments:IList<Environments>? = null
@Required()
override var objectType:ObjectTypes? = null
@Required()
@SerializedName("type") open var Type:ResourceProviderTypes? = null
@Ignore()
override var selfLink:String? = null
@Required()
open var config:IList<ProviderConfigEntry>? = null
@Required()
open var isDisabled:Boolean? = null
@Required()
open var isReadyForDeployments:Boolean? = null
open var costCurrentMonth:BigDecimal? = null
open var costLastMonth:BigDecimal? = null
open var costCurrency:String? = null
}
enum class ResourceProviderTypes
{
Azure,
AmazonWebServices,
GoogleCloudPlatform,
ActiveDirectoryServices,
DomainNameSystem,
SwisscomESC,
AzureKeyVault,
}
open class ProviderConfigEntry
{
open var name:String? = null
open var value:String? = null
open var isSecure:Boolean? = null
}
open class PatchingWindow : IHasTenantId, IHasIdName, IHasObjectType, INotSoftDeletable
{
open var id:UUID? = null
override var name:String? = null
open var dayOfWeek:DayOfWeek? = null
open var monthlyOccurence:MonthlyDayOccurence? = null
open var timeOfDay:TimeSpan? = null
open var duration:TimeSpan? = null
override var tenantId:UUID? = null
open var isDefault:Boolean? = null
@Ignore()
open var selfLink:String? = null
override var objectType:ObjectTypes? = null
}
enum class MonthlyDayOccurence(val value:Int)
{
First(1),
Second(2),
Third(3),
Fourth(4),
}
enum class Aggregations
{
None,
Count,
DistinctCount,
Sum,
Min,
Max,
Avg,
First,
}
@DataContract
open class QueryResponse<T>
{
@DataMember(Order=1)
open var offset:Int? = null
@DataMember(Order=2)
open var total:Int? = null
@DataMember(Order=3)
open var results:ArrayList<TimeSeriesDefinition> = ArrayList<TimeSeriesDefinition>()
@DataMember(Order=4)
open var meta:HashMap<String,String>? = null
@DataMember(Order=5)
open var responseStatus:ResponseStatus? = null
}
open class TimeSeriesDefinition : Auditable(), IHasIdName, IHasTenantId, IHasObjectType
{
open var id:UUID? = null
@References(Type=Tenant::class)
override var tenantId:UUID? = null
open var tenant:Tenant? = null
override var name:String? = null
open var displayName:String? = null
@Ignore()
open var selfLink:String? = null
@Required()
override var objectType:ObjectTypes? = null
open var description:String? = null
open var sourceType:ObjectTypes? = null
open var autoCollection:Boolean? = null
open var autoCollectionQuery:String? = null
open var autoCollectionInterval:Int? = null
open var autoCollectionIntervalUnit:IntervalUnits? = null
open var autoCollectionTime:TimeSpan? = null
open var lastAutoCollected:Date? = null
open var retentionTimeMonths:Int? = null
}
open class Tenant : ConfigItem(), IHasVariables
{
@Required()
@StringLength(MaximumLength=10)
override var name:String? = null
@Required()
override var objectType:ObjectTypes? = null
@Ignore()
override var selfLink:String? = null
@Required()
override var variables:IList<Variable>? = null
@Required()
open var allowedMailDomains:IList<String>? = null
@Required()
open var licensedModules:IList<String>? = null
@Required()
open var defaultDeploymentLifetimeDays:Short? = null
@Required()
open var maxDeploymentLifetimeDays:Short? = null
@Required()
open var systemUnpatchedWarningDays:Short? = null
@Required()
open var systemBackupMissingWarningHours:Short? = null
@Required()
open var stopVulnerableResourceAfterDays:Short? = null
@Required()
open var deploymentExpirationWarningDays:Short? = null
@Required()
open var patchNotificationDays:Short? = null
@Required()
open var useCustomHostnames:Boolean? = null
@Required()
open var removeInactiveVulnerabilitiesAfterDays:Short? = null
}
enum class IntervalUnits
{
Second,
Minute,
Hour,
Day,
Week,
Month,
Year,
}
Kotlin QueryPatchingWindowAssignments 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
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /api/patching/windows/assignments 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","resourceId":"00000000-0000-0000-0000-000000000000","resource":{"tenantId":"00000000-0000-0000-0000-000000000000","extId":"String","extType":"String","extName":"String","name":"String","objectType":"None","selfLink":"String","parentId":"00000000-0000-0000-0000-000000000000","parent":{"shortId":"String","tenantId":"00000000-0000-0000-0000-000000000000","name":"String","objectType":"ResourceGroup","selfLink":"/resourcegroups/00000000-0000-0000-0000-000000000000","environment":"Lab","state":"New","parentId":"00000000-0000-0000-0000-000000000000","parent":{"shortId":"String","tenantId":"00000000-0000-0000-0000-000000000000","name":"String","nameUserDefinedPart":"String","objectType":"Deployment","selfLink":"/deployments/00000000-0000-0000-0000-000000000000","state":"New","environment":"Lab","templateId":"00000000-0000-0000-0000-000000000000","parameters":null,"variables":null,"variablesSnapshot":null,"parentId":"00000000-0000-0000-0000-000000000000","parent":{"tenantId":"00000000-0000-0000-0000-000000000000","name":"String","objectType":"Collection","selfLink":"/collections/00000000-0000-0000-0000-000000000000","variables":null,"isLostAndFound":false,"monthlyBudget":0,"sendBudgetNotificationMails":false,"budgetWarningThresholdPercent":0,"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"},"validFrom":"0001-01-01T00:00:00.0000000Z","validUntil":"0001-01-01T00:00:00.0000000Z","isNeverExpiring":false,"nextPatchDate":"0001-01-01T00:00:00.0000000Z","defaultResourceProviderId":"00000000-0000-0000-0000-000000000000","needsAttention":false,"composition":"Native","monthlyBudget":0,"sendBudgetNotificationMails":false,"budgetWarningThresholdPercent":0,"operationalState":"None","resourcesRunning":0,"resourcesTotal":0,"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"},"templateId":"00000000-0000-0000-0000-000000000000","parameters":null,"variables":null,"nextPatchDate":"0001-01-01T00:00:00.0000000Z","composition":"Native","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"},"deploymentId":"00000000-0000-0000-0000-000000000000","deployment":{"shortId":"String","tenantId":"00000000-0000-0000-0000-000000000000","name":"String","nameUserDefinedPart":"String","objectType":"Deployment","selfLink":"/deployments/00000000-0000-0000-0000-000000000000","state":"New","environment":"Lab","templateId":"00000000-0000-0000-0000-000000000000","parameters":null,"variables":null,"variablesSnapshot":null,"parentId":"00000000-0000-0000-0000-000000000000","parent":{"tenantId":"00000000-0000-0000-0000-000000000000","name":"String","objectType":"Collection","selfLink":"/collections/00000000-0000-0000-0000-000000000000","variables":null,"isLostAndFound":false,"monthlyBudget":0,"sendBudgetNotificationMails":false,"budgetWarningThresholdPercent":0,"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"},"validFrom":"0001-01-01T00:00:00.0000000Z","validUntil":"0001-01-01T00:00:00.0000000Z","isNeverExpiring":false,"nextPatchDate":"0001-01-01T00:00:00.0000000Z","defaultResourceProviderId":"00000000-0000-0000-0000-000000000000","needsAttention":false,"composition":"Native","monthlyBudget":0,"sendBudgetNotificationMails":false,"budgetWarningThresholdPercent":0,"operationalState":"None","resourcesRunning":0,"resourcesTotal":0,"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"},"collectionId":"00000000-0000-0000-0000-000000000000","collection":{"tenantId":"00000000-0000-0000-0000-000000000000","name":"String","objectType":"Collection","selfLink":"/collections/00000000-0000-0000-0000-000000000000","variables":null,"isLostAndFound":false,"monthlyBudget":0,"sendBudgetNotificationMails":false,"budgetWarningThresholdPercent":0,"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"},"resourceProviderId":"00000000-0000-0000-0000-000000000000","resourceProvider":{"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"},"state":"None","environment":"Lab","variables":null,"location":"String","lastSeen":"0001-01-01T00:00:00.0000000Z","lastPatchDate":"0001-01-01T00:00:00.0000000Z","nextPatchDate":"0001-01-01T00:00:00.0000000Z","lastBackupDate":"0001-01-01T00:00:00.0000000Z","isForeign":false,"isAlerting":false,"alertingDisabledId":"String","alertingDisabledReason":"String","isVulnerable":false,"vulnerabilityReason":"String","vulnerableSince":"0001-01-01T00:00:00.0000000Z","isMissingOnProvider":false,"supportsStartStop":false,"costCurrentMonth":0,"costLastMonth":0,"costCurrency":"String","config":{"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"},"patchingWindowId":"00000000-0000-0000-0000-000000000000","patchingWindow":{"id":"00000000-0000-0000-0000-000000000000","name":"First_Sunday_0000UTC","dayOfWeek":"Sunday","monthlyOccurence":"First","timeOfDay":"00:00:00","duration":"00:00:00","tenantId":"00000000-0000-0000-0000-000000000000","isDefault":false,"selfLink":"/patching/windows/00000000-0000-0000-0000-000000000000","objectType":"PatchingWindow"},"selfLink":"/patching/windows/assignments/00000000-0000-0000-0000-000000000000"}],"meta":{"String":"String"},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}