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
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports CoreService.ServiceModel.Dtos.Patching.Crud
Imports CoreService.ServiceModel.Enums
Imports CoreService.ServiceModel.Dtos.Patching.Responses

Namespace Global

    Namespace CoreService.ServiceModel.Dtos.Patching.Crud

        '''<Summary>
        '''Create a new patching window
        '''</Summary>
        <Api(Description:="Create a new patching window")>
        <ApiResponse(Description:="Success", IsDefaultResponse:=true, ResponseType:=GetType(PatchingWindowDto), StatusCode:=201)>
        Public Partial Class CreatePatchingWindow
            Implements IBaseRequest
            Implements IPost
            Implements IHasTenantName
            <ApiMember(DataType:="string", IsRequired:=true, ParameterType:="header")>
            <Validate(Validator:="NotEmpty")>
            Public Overridable Property TenantName As String Implements IHasTenantName.TenantName

            '''<Summary>
            '''Occurence of week day in the month
            '''</Summary>
            <ApiMember(Description:="Occurence of week day in the month", IsRequired:=true)>
            Public Overridable Property MonthlyOccurence As MonthlyDayOccurence

            '''<Summary>
            '''The day of the week, when patching will happen
            '''</Summary>
            <ApiMember(Description:="The day of the week, when patching will happen", IsRequired:=true)>
            Public Overridable Property DayOfWeek As DayOfWeek

            '''<Summary>
            '''The time, when the patching window will start
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The time, when the patching window will start", Format:="time", IsRequired:=true, ParameterType:="body")>
            Public Overridable Property TimeOfDay As TimeOnly

            '''<Summary>
            '''The max duration (hours) of the window wherein patchings can be started
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The max duration (hours) of the window wherein patchings can be started", Format:="time", ParameterType:="body")>
            Public Overridable Property Duration As TimeSpan?

            '''<Summary>
            '''It's the default patching window for new resource groups
            '''</Summary>
            <ApiMember(DataType:="boolean", Description:="It's the default patching window for new resource groups", ParameterType:="body")>
            Public Overridable Property IsDefault As Boolean
        End Class
    End Namespace

    Namespace CoreService.ServiceModel.Dtos.Patching.Responses

        Public Partial Class PatchingWindowDto
            Public Overridable Property Id As Guid
            Public Overridable Property Name As String
            Public Overridable Property DayOfWeek As DayOfWeek
            Public Overridable Property MonthlyOccurence As MonthlyDayOccurence
            Public Overridable Property TimeOfDay As TimeOnly
            Public Overridable Property Duration As TimeSpan
            Public Overridable Property IsDefault As Boolean
        End Class
    End Namespace

    Namespace CoreService.ServiceModel.Enums

        Public Enum MonthlyDayOccurence
            First = 1
            Second = 2
            Third = 3
            Fourth = 4
        End Enum
    End Namespace
End Namespace

VB.NET 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}