CoreService

<back to all web services

GetPatchingWindow

Patching - CRUD

Returns a single patching window by its id

Requires Authentication
Requires the role:TenantReader
The following routes are available for this service:
GET/api/patching/windows/{Id}Returns a single patching window by its id
GET/patching/windows/{Id}Returns a single patching window by its id
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
Object = TypeVar('Object')


class MonthlyDayOccurence(IntEnum):
    FIRST = 1
    SECOND = 2
    THIRD = 3
    FOURTH = 4


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PatchingWindowDto:
    id: Optional[str] = None
    name: Optional[str] = None
    day_of_week: Optional[DayOfWeek] = None
    monthly_occurence: Optional[MonthlyDayOccurence] = None
    time_of_day: datetime.timedelta = datetime.timedelta()
    duration: datetime.timedelta = datetime.timedelta()
    is_default: bool = False


# @Api(Description="Returns a single patching window by its id")
# @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(PatchingWindowDto), StatusCode=200)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetPatchingWindow(IBaseRequest, IHasId, IHasTenantName, IGet):
    """
    Returns a single patching window by its id
    """

    # @ApiMember(DataType="string", Description="The primary key of every config item", Format="guid", IsRequired=true, ParameterType="path")
    id: Optional[str] = None
    """
    The primary key of every config item
    """


    # @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
    # @Validate(Validator="NotEmpty")
    tenant_name: Optional[str] = None

Python GetPatchingWindow 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/{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","name":"String","dayOfWeek":"Sunday","monthlyOccurence":"First","timeOfDay":"00:00:00","duration":"00:00:00","isDefault":false}