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
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using CoreService.ServiceModel.Dtos.Audit.Crud;
using CoreService.ServiceModel.Dtos.Audit.Responses;
using YCO.Dune.Models.Enums;

namespace CoreService.ServiceModel.Dtos.Audit.Crud
{
    ///<summary>
    ///Returns a single changelog by its id
    ///</summary>
    [Api(Description="Returns a single changelog by its id")]
    [ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(CoreService.ServiceModel.Dtos.Audit.Responses.ChangeLogDto), StatusCode=200)]
    public partial class GetChangeLog
        : IBaseRequest, IHasId, IHasTenantName, IGet
    {
        ///<summary>
        ///The unique id of the object
        ///</summary>
        [ApiMember(DataType="string", Description="The unique id of the object", Format="guid", IsRequired=true, ParameterType="path")]
        public virtual Guid Id { get; set; }

        [ApiMember(DataType="string", IsRequired=true, ParameterType="header")]
        [Validate("NotEmpty")]
        public virtual string TenantName { get; set; }
    }

}

namespace CoreService.ServiceModel.Dtos.Audit.Responses
{
    public partial class ChangeLogDto
        : IHasTenantId
    {
        public virtual Guid Id { get; set; }
        public virtual Guid TenantId { get; set; }
        public virtual DateTime TimeStamp { get; set; }
        public virtual string ObjectId { get; set; }
        public virtual string ObjectName { get; set; }
        public virtual ObjectTypes ObjectType { get; set; }
        public virtual ChangeTypes ChangeType { get; set; }
        public virtual string Description { get; set; }
        public virtual Dictionary<string, ValueChangeDto> Changes { get; set; } = new();
        public virtual string ModifyUserId { get; set; }
        public virtual string ModifyUserEmail { get; set; }
    }

    public partial class ValueChangeDto
    {
        public virtual string? OldValue { get; set; }
        public virtual string? NewValue { get; set; }
    }

}

namespace YCO.Dune.Models.Enums
{
    public enum ChangeTypes
    {
        Create,
        Update,
        Delete,
    }

    public enum ObjectTypes
    {
        None,
        ConfigItem,
        Tenant,
        Collection,
        Resource,
        ComputeNode,
        VirtualMachine,
        PhysicalMachine,
        Disk,
        Subnet,
        IPAddress,
        Job,
        JobEvent,
        FreezePeriod,
        ResourceGroup,
        Deployment,
        ResourceGroupTemplate,
        DeploymentTemplate,
        ResourceProvider,
        GenericResource,
        Role,
        Permission,
        User,
        PatchingWindow,
        Update,
        ReportDefinition,
        TimeSeries,
        DataPoint,
        Action,
        ActionAssignment,
        UserNote,
    }

}

C# 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"}