CoreService

<back to all web services

UnAssignPatchingWindowComputeNodes

Patching - CRUD

Unassign ComputeNodes from a PatchingWindow. Starts a workflow for the unassignment and returns a Job to track progress

Requires Authentication
Requires the role:TenantReader
The following routes are available for this service:
DELETE/api/patching/windows/{Id}/unassignUnassign ComputeNodes from a PatchingWindow
DELETE/patching/windows/{Id}/unassignUnassign ComputeNodes from a PatchingWindow
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 ObjectTypes(str, Enum):
    NONE = 'None'
    CONFIG_ITEM = 'ConfigItem'
    TENANT = 'Tenant'
    COLLECTION = 'Collection'
    RESOURCE = 'Resource'
    COMPUTE_NODE = 'ComputeNode'
    VIRTUAL_MACHINE = 'VirtualMachine'
    PHYSICAL_MACHINE = 'PhysicalMachine'
    DISK = 'Disk'
    SUBNET = 'Subnet'
    IP_ADDRESS = 'IPAddress'
    JOB = 'Job'
    JOB_EVENT = 'JobEvent'
    FREEZE_PERIOD = 'FreezePeriod'
    RESOURCE_GROUP = 'ResourceGroup'
    DEPLOYMENT = 'Deployment'
    RESOURCE_GROUP_TEMPLATE = 'ResourceGroupTemplate'
    DEPLOYMENT_TEMPLATE = 'DeploymentTemplate'
    RESOURCE_PROVIDER = 'ResourceProvider'
    GENERIC_RESOURCE = 'GenericResource'
    ROLE = 'Role'
    PERMISSION = 'Permission'
    USER = 'User'
    PATCHING_WINDOW = 'PatchingWindow'
    UPDATE = 'Update'
    REPORT_DEFINITION = 'ReportDefinition'
    TIME_SERIES = 'TimeSeries'
    DATA_POINT = 'DataPoint'
    ACTION = 'Action'
    ACTION_ASSIGNMENT = 'ActionAssignment'
    USER_NOTE = 'UserNote'


class JobTypes(str, Enum):
    CREATE = 'Create'
    UPDATE = 'Update'
    DELETE = 'Delete'
    START = 'Start'
    STOP = 'Stop'
    RESTART = 'Restart'
    BACKUP = 'Backup'
    RESTORE = 'Restore'
    PATCH = 'Patch'
    ACTION = 'Action'


class JobStates(str, Enum):
    PENDING = 'Pending'
    STARTING = 'Starting'
    RUNNING = 'Running'
    SUSPENDED = 'Suspended'
    STOPPING = 'Stopping'
    COMPLETED = 'Completed'
    FAILED = 'Failed'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class JobDto(IHasIdName, IHasTenantId, IAuditable, IHasObjectType):
    id: Optional[str] = None
    """
    The id of the job
    """

    tenant_id: Optional[str] = None
    """
    The id of the tenant
    """

    name: Optional[str] = None
    """
    The name of the job
    """

    object_type: Optional[ObjectTypes] = None
    message: Optional[str] = None
    """
    An additional message
    """

    self_link: Optional[str] = None
    """
    Api link pointing to this object
    """

    config_item_id: Optional[str] = None
    """
    The id of the configitem the job belongs to
    """

    config_item_type: Optional[ObjectTypes] = None
    """
    The type of the configitem the job belongs to
    """

    job_type: Optional[JobTypes] = None
    """
    The job type
    """

    state: Optional[JobStates] = None
    """
    The current state of the job
    """

    start_time: datetime.datetime = datetime.datetime(1, 1, 1)
    """
    The timestamp, when the job got started
    """

    end_time: Optional[datetime.datetime] = None
    """
    The timestamp, when the job has finished
    """

    duration: int = 0
    """
    The duration (in seconds) of the job
    """

    workflow_id: Optional[str] = None
    """
    The id of the related workflow
    """

    scheduler_id: Optional[str] = None
    """
    The id of the related scheduled task
    """

    progress: float = 0.0
    """
    The jobs progress in percent (0...100)
    """

    config: Dict[str, Object] = field(default_factory=dict)
    """
    Contains various infos about the job
    """

    created: datetime.datetime = datetime.datetime(1, 1, 1)
    """
    The time the job was created
    """

    create_user: Optional[str] = None
    """
    The user the job was created with
    """

    create_user_id: Optional[str] = None
    """
    The user id the job was created with
    """

    create_user_email: Optional[str] = None
    """
    The user email the job was created with
    """

    modified: datetime.datetime = datetime.datetime(1, 1, 1)
    """
    The time the job was last modified
    """

    modify_user: Optional[str] = None
    """
    The user the job was modified with
    """

    modify_user_id: Optional[str] = None
    """
    The user id the job was modified with
    """

    is_deleted: bool = False
    """
    True if the job is deleted
    """

    deleted: Optional[datetime.datetime] = None
    """
    The time the job was deleted
    """

    delete_user: Optional[str] = None
    """
    The user the job was deleted with
    """

    delete_user_id: Optional[str] = None
    """
    The user id the job was deleted with
    """

    send_notifications: bool = False
    """
    Will be evaluated by event endpoints
    """

    is_running: bool = False
    """
    True if it is in any of the 'running' states
    """

    needs_attention: bool = False
    """
    Jobs with failed JobEvents are marked with NeedsAttention
    """


# @Api(Description="Unassign ComputeNodes from a PatchingWindow. Starts a workflow for the unassignment and returns a Job to track progress")
# @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(JobDto), StatusCode=202)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UnAssignPatchingWindowComputeNodes(IBaseRequest, IHasId, IHasTenantName, IDelete):
    """
    Unassign ComputeNodes from a PatchingWindow. Starts a workflow for the unassignment and returns a Job to track progress
    """

    # @ApiMember(DataType="string", Description="The id of the pachting window", Format="guid", IsRequired=true, ParameterType="path")
    id: Optional[str] = None
    """
    The id of the pachting window
    """


    # @ApiMember(DataType="list", Description="List of one or more ComputeNodes", Format="guid", IsRequired=true, ParameterType="body")
    # @Validate(Validator="NotNull")
    # @Validate(Validator="NotEmpty")
    compute_node_ids: List[str] = field(default_factory=list)
    """
    List of one or more ComputeNodes
    """


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

Python UnAssignPatchingWindowComputeNodes 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.

DELETE /api/patching/windows/{Id}/unassign 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","tenantId":"00000000-0000-0000-0000-000000000000","name":"String","objectType":"Job","message":"String","selfLink":"String","configItemId":"00000000-0000-0000-0000-000000000000","configItemType":"None","jobType":"Create","state":"Pending","startTime":"0001-01-01T00:00:00.0000000Z","endTime":"0001-01-01T00:00:00.0000000Z","duration":0,"workflowId":"String","schedulerId":"String","progress":0,"config":{"String":{}},"created":"0001-01-01T00:00:00.0000000Z","createUser":"String","createUserId":"String","createUserEmail":"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","sendNotifications":false,"isRunning":false,"needsAttention":false}