CoreService

<back to all web services

GetChangeLog

ChangeLog - CRUD

Returns a single changelog by its id

Requires Authentication
Required role:TenantAdmin
The following routes are available for this service:
GET/api/changelogs/{Id}Returns a changelog
GET/changelogs/{Id}Returns a changelog
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 ChangeTypes(str, Enum):
    CREATE = 'Create'
    UPDATE = 'Update'
    DELETE = 'Delete'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ValueChangeDto:
    old_value: Optional[str] = None
    new_value: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ChangeLogDto(IHasTenantId):
    id: Optional[str] = None
    tenant_id: Optional[str] = None
    time_stamp: datetime.datetime = datetime.datetime(1, 1, 1)
    object_id: Optional[str] = None
    object_name: Optional[str] = None
    object_type: Optional[ObjectTypes] = None
    change_type: Optional[ChangeTypes] = None
    description: Optional[str] = None
    changes: Dict[str, ValueChangeDto] = field(default_factory=dict)
    modify_user_id: Optional[str] = None
    modify_user_email: Optional[str] = None


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

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


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

Python GetChangeLog 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/changelogs/{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","timeStamp":"0001-01-01T00:00:00.0000000Z","objectId":"String","objectName":"String","objectType":"None","changeType":"Create","description":"String","changes":{"String":{"oldValue":"String","newValue":"String"}},"modifyUserId":"String","modifyUserEmail":"String"}