CoreService

<back to all web services

GetJobEvent

JobEvent - CRUD

Get jobevent

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
GET/api/jobevents/{Id}Returns the jobevent
GET/jobevents/{Id}Returns the jobevent
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 JobEventStates(str, Enum):
    STARTED = 'Started'
    SKIPPED = 'Skipped'
    COMPLETED = 'Completed'
    FAILED = 'Failed'


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

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

    job_id: Optional[str] = None
    """
    The id of the parent job
    """

    name: Optional[str] = None
    """
    The name of the event. Events will be grouped on the name
    """

    object_type: Optional[ObjectTypes] = None
    state: Optional[JobEventStates] = None
    """
    The current state of the event
    """

    start_time: datetime.datetime = datetime.datetime(1, 1, 1)
    """
    Start time of the event
    """

    end_time: Optional[datetime.datetime] = None
    """
    End time of the event (optional)
    """

    message: Optional[str] = None
    """
    A message with details to the current state
    """

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

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


# @Api(Description="Get jobevent")
# @ApiResponse(Description="The request endend successful", IsDefaultResponse=true, ResponseType=typeof(JobEventDto), StatusCode=200)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetJobEvent(IGetSingleRequest, IHasTenantName, IGet):
    """
    Get jobevent
    """

    # @ApiMember(DataType="string", Format="guid", IsRequired=true, ParameterType="path")
    # @Validate(Validator="NotEmpty")
    id: Optional[str] = None

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

    # @ApiMember(Description="If true, also soft deleted items will be returned", ParameterType="query")
    include_deleted: Optional[bool] = None
    """
    If true, also soft deleted items will be returned
    """


    # @ApiMember(Description="Returns all referenced object", ParameterType="query")
    include_referenced_objects: Optional[bool] = None
    """
    Returns all referenced object
    """

Python GetJobEvent 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/jobevents/{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","tenantId":"00000000-0000-0000-0000-000000000000","jobId":"00000000-0000-0000-0000-000000000000","name":"String","objectType":"JobEvent","state":"Started","startTime":"0001-01-01T00:00:00.0000000Z","endTime":"0001-01-01T00:00:00.0000000Z","message":"String","selfLink":"String","duration":0}