CoreService

<back to all web services

CreatePatchingWindow

Patching - CRUD

Create a new patching window

Requires Authentication
Requires any of the roles:TenantReader, Admin, TenantAdmin
The following routes are available for this service:
POST/api/patching/windowsCreates a new patching window
POST/patching/windowsCreates a new patching window
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*


/**
* Create a new patching window
*/
@Api(Description="Create a new patching window")
@ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=PatchingWindowDto::class, StatusCode=201)
open class CreatePatchingWindow : IBaseRequest, IPost, IHasTenantName
{
    @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
    @Validate(Validator="NotEmpty")
    override var tenantName:String? = null

    /**
    * Occurence of week day in the month
    */
    @ApiMember(Description="Occurence of week day in the month", IsRequired=true)
    open var monthlyOccurence:MonthlyDayOccurence? = null

    /**
    * The day of the week, when patching will happen
    */
    @ApiMember(Description="The day of the week, when patching will happen", IsRequired=true)
    open var dayOfWeek:DayOfWeek? = null

    /**
    * The time, when the patching window will start
    */
    @ApiMember(DataType="string", Description="The time, when the patching window will start", Format="time", IsRequired=true, ParameterType="body")
    open var timeOfDay:TimeSpan? = null

    /**
    * The max duration (hours) of the window wherein patchings can be started
    */
    @ApiMember(DataType="string", Description="The max duration (hours) of the window wherein patchings can be started", Format="time", ParameterType="body")
    open var duration:TimeSpan? = null

    /**
    * It's the default patching window for new resource groups
    */
    @ApiMember(DataType="boolean", Description="It's the default patching window for new resource groups", ParameterType="body")
    open var isDefault:Boolean? = null
}

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

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
}

Kotlin CreatePatchingWindow 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.

POST /api/patching/windows HTTP/1.1 
Host: core.starburst.svc 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"tenantName":"String","monthlyOccurence":"First","dayOfWeek":"Sunday","timeOfDay":"00:00:00","duration":"00:00:00","isDefault":false,"txId":"00000000-0000-0000-0000-000000000000"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"id":"00000000-0000-0000-0000-000000000000","name":"String","dayOfWeek":"Sunday","monthlyOccurence":"First","timeOfDay":"00:00:00","duration":"00:00:00","isDefault":false}