CoreService

<back to all web services

GetPatchingWindowAssignment

Patching - CRUD

Returns a single patching window assignment by its id

Requires Authentication
Requires the role:TenantReader
The following routes are available for this service:
GET/api/patching/windows/assignments/{Id}Returns a single patching window assignment by its id
GET/patching/windows/assignments/{Id}Returns a single patching window assignment by its id
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 single patching window assignment by its id
*/
@Api(Description="Returns a single patching window assignment by its id")
@ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=PatchingWindowAssignmentDto::class, StatusCode=200)
open class GetPatchingWindowAssignment : IBaseRequest, IHasId, IHasTenantName, IGet
{
    /**
    * The primary key of every config item
    */
    @ApiMember(DataType="string", Description="The primary key of every config item", Format="guid", IsRequired=true, ParameterType="path")
    override var id:UUID? = null

    @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
    @Validate(Validator="NotEmpty")
    override var tenantName:String? = null
}

open class PatchingWindowAssignmentDto
{
    open var id:UUID? = null
    open var resourceId:UUID? = null
    open var resource:ResourceDto? = null
    open var patchingWindowId:UUID? = null
    open var patchingWindow:PatchingWindowDto? = null
}

open class ResourceDto : ConfigItemDto(), IResourceDto
{
    /**
    * Free text field to store an external resource id
    */
    override var extId:String? = null
    /**
    * Free text field to store an external resource type
    */
    override var extType:String? = null
    /**
    * Free text field to store an external resource name
    */
    open var extName:String? = null
    /**
    * The id of the tenant
    */
    open var tenantId:UUID? = null
    /**
    * The id of the parent (ResourceGroup)
    */
    open var parentId:UUID? = null
    /**
    * The parent (ResourceGroup
    */
    open var parent:ConfigItemDto? = null
    /**
    * The id of the parent (Deployment
    */
    override var deploymentId:UUID? = null
    /**
    * The parent (Deployement
    */
    override var deployment:DeploymentDto? = null
    /**
    * The id of the collection the resource belongs to
    */
    open var collectionId:UUID? = null
    /**
    * The collection the resource belongs to
    */
    open var collection:DeploymentCollectionDto? = null
    /**
    * The environment the resourcegroup is deployed in
    */
    open var environment:Environments? = null
    /**
    * The id of the provider of the resource (e.g. Azure, AWS, other DC provider
    */
    override var resourceProviderId:UUID? = null
    /**
    * The provider of the resource (e.g. Azure, AWS, other DC provider
    */
    override var resourceProvider:ResourceProviderDto? = null
    /**
    * State of the resource
    */
    override var state:OperationalStates? = null
    override var variables:IList<VariableDto>? = null
    /**
    * Can be used for dc location
    */
    override var location:String? = null
    /**
    * Last time the resource was seen/updated by a scan/cfgmgmt run etc.
    */
    override var lastSeen:Date? = null
    /**
    * Last time the resource has been patched successfully
    */
    open var lastPatchDate:Date? = null
    /**
    * Scheduled time for the next patching window
    */
    open var nextPatchDate:Date? = null
    /**
    * Time of the last successfull backup
    */
    open var lastBackupDate:Date? = null
    /**
    * True = scanned (not deployed from dune template), False = deployed from dune with template
    */
    override var isForeign:Boolean? = null
    /**
    * Is alerting in external monitoring activated
    */
    override var isAlerting:Boolean? = null
    /**
    * Used to identify external monitoring maintenance/downtime id
    */
    override var alertingDisabledId:String? = null
    /**
    * Reason why alerting is disabled
    */
    override var alertingDisabledReason:String? = null
    /**
    * Identifies the resource as vulnerable (security)
    */
    override var isVulnerable:Boolean? = null
    /**
    * Reason why the resource is vulnerable
    */
    override var vulnerabilityReason:String? = null
    /**
    * True if resource is in cmdb but missing on provider/infra
    */
    override var isMissingOnProvider:Boolean? = null
    /**
    * Shows if a resource can be started/stopped
    */
    override var supportsStartStop:Boolean? = null
    /**
    * The cost for the current month
    */
    override var costCurrentMonth:BigDecimal? = null
    /**
    * The cost for the last month
    */
    override var costLastMonth:BigDecimal? = null
    /**
    * The cost currency
    */
    override var costCurrency:String? = null
    /**
    * Additional generic configs
    */
    open var config:HashMap<String,Object> = HashMap<String,Object>()
    override var links:IList<LinkDto>? = null
}

open class ConfigItemDto : IConfigItem
{
    open var id:UUID? = null
    open var name:String? = null
    override var displayName:String? = null
    override var description:String? = null
    open var objectType:ObjectTypes? = null
    override var selfLink:String? = null
    override var tags:IList<TagDto>? = null
    open var path:IList<PathItemDto>? = null
    open var created:Date? = null
    open var createUser:String? = null
    open var createUserId:String? = null
    open var modified:Date? = null
    open var modifyUser:String? = null
    open var modifyUserId:String? = null
    open var isDeleted:Boolean? = null
    open var deleted:Date? = null
    open var deleteUser:String? = null
    open var deleteUserId:String? = null
    open var links:IList<LinkDto>? = 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 TagDto
{
    open var name:String? = null
    open var value:String? = null
    open var isProtected:Boolean? = null
}

open class PathItemDto
{
    open var label:String? = null
    open var link:String? = null
    open var objectType:ObjectTypes? = null
    open var objectId:UUID? = null
}

open class LinkDto
{
    open var caption:String? = null
    open var rel:String? = null
    open var hRef:String? = null
    open var method:String? = null
}

open class DeploymentDto : ConfigItemDto(), IHasParentDto, IHasTenantId, IEnvironmentSpecific
{
    /**
    * The operational state of the deployment (Running, Stopped, None, Unknown)
    */
    open var operationalState:OperationalStates? = null
    /**
    * How many start/stop-capable resources are currently running
    */
    open var resourcesRunning:Int? = null
    /**
    * Total number of start/stop-capable resources in this deployment
    */
    open var resourcesTotal:Int? = null
    /**
    * Shorter id than the guid which can be used for automation (tenant wide unique) prefixed with a 'd'. E.g. dr36x3
    */
    open var shortId:String? = null
    /**
    * The user defined part of the name property {userDefined}_{environment}
    */
    open var nameUserDefinedPart:String? = null
    /**
    * The id of the tenant
    */
    override var tenantId:UUID? = null
    /**
    * The state of the deployment
    */
    open var state:LifecycleStates? = null
    /**
    * The environment the deployment is deployed in
    */
    override var environment:Environments? = null
    /**
    * The id of the template which was used to create the deployment
    */
    open var templateId:UUID? = null
    /**
    * Shows if a deployment was rolled out through a dune template or not
    */
    open var isTemplateBased:Boolean? = null
    /**
    * The parameters which were used to create this deployment
    */
    open var parameters:IList<ParameterDto>? = null
    /**
    * A deployment scoped list of variables used for deployment of resources
    */
    open var variables:IList<VariableDto>? = null
    /**
    * A snapshot of the varialbs used to create the deployment
    */
    open var variablesSnapshot:IList<VariableDto>? = null
    /**
    * The id of the parent (collection) of the deployment
    */
    open var parentId:UUID? = null
    /**
    * The parent (collection) of the deployment
    */
    override var parent:ConfigItemDto? = null
    /**
    * The Date when the resources got deployed
    */
    open var validFrom:Date? = null
    /**
    * The Date when the deployment expires and has to be reevaluated
    */
    open var validUntil:Date? = null
    /**
    * The deployment will never expire
    */
    open var isNeverExpiring:Boolean? = null
    /**
    * The date, when the deployments resources will receive updates
    */
    open var nextPatchDate:Date? = null
    /**
    * The default resource provider where the resources are deployed
    */
    open var defaultResourceProviderId:UUID? = null
    /**
    * Deployments which have issues in Jobs are marked with NeedsAttention
    */
    open var needsAttention:Boolean? = null
    /**
    * Composition show if all resources in the deployment are dune native, dune foreign or a mix of both
    */
    open var composition:ResourceCompositions? = null
    /**
    * The monthly cost budget for the whole collection
    */
    open var monthlyBudget:BigDecimal? = null
    /**
    * Whether to send budget information mails to the collection owners
    */
    open var sendBudgetNotificationMails:Boolean? = null
    /**
    * A threshold, when to send the first budget warning mail
    */
    open var budgetWarningThresholdPercent:Int? = null
    override var links:IList<LinkDto>? = null
}

enum class OperationalStates
{
    None,
    Starting,
    Running,
    Stopping,
    Stopped,
    Restarting,
    Deleting,
    Unknown,
}

enum class LifecycleStates
{
    New,
    Deploying,
    Deployed,
    Removing,
    Removed,
    Failure,
    Imported,
}

enum class Environments
{
    Lab,
    Poc,
    Dev,
    Test,
    Int,
    Uat,
    Prod,
}

open class ParameterDto
{
    open var name:String? = null
    open var description:String? = null
    /**
    * Value in form of a json string (e.g. Number = 1234, String = "foo", Boolean = false). Note: string values need extra quotes
    */
    open var value:String? = null
    /**
    * Optional default value for the frontend. Needs to be in the same format as the value
    */
    @SerializedName("default") open var Default:String? = null
    /**
    * Optional parameters do not need to have a value. Default -> Optional=false
    */
    open var optional:Boolean? = null
    /**
    * The data type of the value and default property
    */
    @SerializedName("type") open var Type:ParameterValueType? = null
    open var validation:String? = null
}

enum class ParameterValueType
{
    String,
    Number,
    Boolean,
    SecureString,
}

open class VariableDto
{
    open var name:String? = 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
    */
    open var value:String? = null
    /**
    * The data type of the value property
    */
    @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,
}

enum class ResourceCompositions
{
    Native,
    Foreign,
    Mixed,
}

open class DeploymentCollectionDto : ConfigItemDto(), IHasTenantId
{
    override var tenantId:UUID? = null
    open var tenant:TenantDto? = null
    /**
    * A collection scoped list of variables
    */
    open var variables:IList<VariableDto>? = null
    /**
    * Defines the collection where scanned but not deployed resources will be stored
    */
    open var isLostAndFound:Boolean? = null
    /**
    * The monthly cost budget for the whole collection
    */
    open var monthlyBudget:BigDecimal? = null
    /**
    * Whether to send budget information mails to the collection owners
    */
    open var sendBudgetNotificationMails:Boolean? = null
    /**
    * A threshold, when to send the first budget warning mail
    */
    open var budgetWarningThresholdPercent:Int? = null
    override var links:IList<LinkDto>? = null
}

open class TenantDto : ConfigItemDto()
{
    /**
    * Variables defined on tenant level
    */
    open var variables:IList<VariableDto>? = null
    /**
    * Allowed email domains used for authentication
    */
    open var allowedMailDomains:IList<String>? = null
    /**
    * List of licensed modules for this tenant
    */
    open var licensedModules:IList<String>? = null
    /**
    * Amount of days until a Deployment expires
    */
    open var defaultDeploymentLifetimeDays:Short? = null
    /**
    * Max amount of days until a Deployment expires
    */
    open var maxDeploymentLifetimeDays:Short? = null
    /**
    * Amount of days without patching until a unpatched warning is shown
    */
    open var systemUnpatchedWarningDays:Short? = null
    /**
    * Amount of hours without backup until a backup missing warning is shown
    */
    open var systemBackupMissingWarningHours:Short? = null
    /**
    * Amount of days until a vulnerable resource is getting stopped
    */
    open var stopVulnerableResourceAfterDays:Short? = null
    /**
    * Amount of days before deployment expiration, which triggers the expiration warning
    */
    open var deploymentExpirationWarningDays:Short? = null
    /**
    * Amount of days the patch notification is sent out prior to the patch date
    */
    open var patchNotificationDays:Short? = null
    /**
    * Use a pool with your own hostnames (true) or let the hostname be auto generated (false)
    */
    open var useCustomHostnames:Boolean? = null
    /**
    * After how many days inactive vulnerabilities will be purged from database
    */
    open var removeInactiveVulnerabilitiesAfterDays:Short? = null
    override var links:IList<LinkDto>? = null
}

open class ResourceProviderDto : ConfigItemDto(), IHasTenantId
{
    override var tenantId:UUID? = null
    /**
    * If environment cannot be detected while scanning, default environment will be used
    */
    open var defaultEnvironment:Environments? = null
    /**
    * List off all allowed environments for this resource provider
    */
    open var allowedEnvironments:IList<Environments>? = null
    /**
    * Defines the provider type (e.g. Azure, Aws)
    */
    @SerializedName("type") open var Type:ResourceProviderTypes? = null
    /**
    * Additional generic data which varies depending on ProviderType
    */
    open var config:IList<ProviderConfigEntryDto>? = null
    /**
    * Disabled ResourceProviders cannot be selected for new deployments
    */
    open var isDisabled:Boolean? = null
    /**
    * Shows if a ResourceProvider has been initialized and can accept deployments (resources)
    */
    open var isReadyForDeployments:Boolean? = null
    /**
    * The cost for the current month
    */
    open var costCurrentMonth:BigDecimal? = null
    /**
    * The cost for the last month
    */
    open var costLastMonth:BigDecimal? = null
    /**
    * The cost currency
    */
    open var costCurrency:String? = null
}

enum class ResourceProviderTypes
{
    Azure,
    AmazonWebServices,
    GoogleCloudPlatform,
    ActiveDirectoryServices,
    DomainNameSystem,
    SwisscomESC,
    AzureKeyVault,
}

open class ProviderConfigEntryDto
{
    open var name:String? = null
    open var value:String? = null
    open var isSecure:Boolean? = null
}

open class PatchingWindowDto
{
    open var id:UUID? = null
    open var name:String? = null
    open var dayOfWeek:DayOfWeek? = null
    open var monthlyOccurence:MonthlyDayOccurence? = null
    open var timeOfDay:TimeSpan? = null
    open var duration:TimeSpan? = null
    open var isDefault:Boolean? = null
}

enum class MonthlyDayOccurence(val value:Int)
{
    First(1),
    Second(2),
    Third(3),
    Fourth(4),
}

Kotlin GetPatchingWindowAssignment 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/patching/windows/assignments/{Id} HTTP/1.1 
Host: core.starburst.svc 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"id":"00000000-0000-0000-0000-000000000000","resourceId":"00000000-0000-0000-0000-000000000000","resource":{"extId":"String","extType":"String","extName":"String","tenantId":"00000000-0000-0000-0000-000000000000","parentId":"00000000-0000-0000-0000-000000000000","parent":{"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","links":null},"deploymentId":"00000000-0000-0000-0000-000000000000","deployment":{"operationalState":"None","resourcesRunning":0,"resourcesTotal":0,"shortId":"String","nameUserDefinedPart":"String","tenantId":"00000000-0000-0000-0000-000000000000","state":"New","environment":"Lab","templateId":"00000000-0000-0000-0000-000000000000","isTemplateBased":true,"parameters":null,"variables":null,"variablesSnapshot":null,"parentId":"00000000-0000-0000-0000-000000000000","parent":{"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","links":null},"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,"links":[{"caption":"Index","rel":"index","hRef":"/deployments/","method":"GET"},{"caption":"Collection","rel":"up","hRef":"/collections/00000000-0000-0000-0000-000000000000","method":"GET"},{"caption":"Resourcegroups","rel":"down","hRef":"/resourcegroups?parentId=00000000-0000-0000-0000-000000000000","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"},"collectionId":"00000000-0000-0000-0000-000000000000","collection":{"tenantId":"00000000-0000-0000-0000-000000000000","tenant":{"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"},"variables":null,"isLostAndFound":false,"monthlyBudget":0,"sendBudgetNotificationMails":false,"budgetWarningThresholdPercent":0,"links":[{"caption":"Index","rel":"up","hRef":"/collections/","method":"GET"},{"caption":"Deployments","rel":"down","hRef":"/deployments?parentId=00000000-0000-0000-0000-000000000000","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"},"environment":"Lab","resourceProviderId":"00000000-0000-0000-0000-000000000000","resourceProvider":{"tenantId":"00000000-0000-0000-0000-000000000000","defaultEnvironment":"Lab","allowedEnvironments":null,"type":"Azure","config":null,"isDisabled":false,"isReadyForDeployments":false,"costCurrentMonth":0,"costLastMonth":0,"costCurrency":"String","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","links":null},"state":"None","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","isMissingOnProvider":false,"supportsStartStop":false,"costCurrentMonth":0,"costLastMonth":0,"costCurrency":"String","config":{"String":{}},"links":[{"caption":"Index","rel":"index","hRef":"/resources/","method":"GET"},{"caption":"ResourceGroup","rel":"up","hRef":"/resourcegroups/00000000-0000-0000-0000-000000000000","method":"GET"},{"caption":"Deployment","rel":"up","hRef":"/deployments/00000000-0000-0000-0000-000000000000","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"},"patchingWindowId":"00000000-0000-0000-0000-000000000000","patchingWindow":{"id":"00000000-0000-0000-0000-000000000000","name":"String","dayOfWeek":"Sunday","monthlyOccurence":"First","timeOfDay":"00:00:00","duration":"00:00:00","isDefault":false}}