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
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.JobEvents.Crud;
using CoreService.ServiceModel.Dtos.JobEvents.Responses;
using YCO.Dune.Models.Enums;
using CoreService.ServiceModel.Enums;

namespace CoreService.ServiceModel.Dtos.JobEvents.Crud
{
    ///<summary>
    ///Get jobevent
    ///</summary>
    [Api(Description="Get jobevent")]
    [ApiResponse(Description="The request endend successful", IsDefaultResponse=true, ResponseType=typeof(CoreService.ServiceModel.Dtos.JobEvents.Responses.JobEventDto), StatusCode=200)]
    public partial class GetJobEvent
        : IGetSingleRequest, IHasTenantName, IGet
    {
        [ApiMember(DataType="string", Format="guid", IsRequired=true, ParameterType="path")]
        [Validate("NotEmpty")]
        public virtual Guid Id { get; set; }

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

        ///<summary>
        ///If true, also soft deleted items will be returned
        ///</summary>
        [ApiMember(Description="If true, also soft deleted items will be returned", ParameterType="query")]
        public virtual bool? IncludeDeleted { get; set; }

        ///<summary>
        ///Returns all referenced object
        ///</summary>
        [ApiMember(Description="Returns all referenced object", ParameterType="query")]
        public virtual bool? IncludeReferencedObjects { get; set; }
    }

}

namespace CoreService.ServiceModel.Dtos.JobEvents.Responses
{
    public partial class JobEventDto
        : IHasIdName, IHasTenantId, IHasObjectType
    {
        ///<summary>
        ///The id of the job
        ///</summary>
        public virtual Guid Id { get; set; }
        ///<summary>
        ///The id of the the tenant
        ///</summary>
        public virtual Guid TenantId { get; set; }
        ///<summary>
        ///The id of the parent job
        ///</summary>
        public virtual Guid JobId { get; set; }
        ///<summary>
        ///The name of the event. Events will be grouped on the name
        ///</summary>
        public virtual string Name { get; set; }
        public virtual ObjectTypes ObjectType { get; set; }
        ///<summary>
        ///The current state of the event
        ///</summary>
        public virtual JobEventStates State { get; set; }
        ///<summary>
        ///Start time of the event
        ///</summary>
        public virtual DateTime StartTime { get; set; }
        ///<summary>
        ///End time of the event (optional)
        ///</summary>
        public virtual DateTime? EndTime { get; set; }
        ///<summary>
        ///A message with details to the current state
        ///</summary>
        public virtual string Message { get; set; }
        ///<summary>
        ///Api link pointing to this object
        ///</summary>
        public virtual string SelfLink { get; set; }
        ///<summary>
        ///The duration (in seconds) of the job event
        ///</summary>
        public virtual int Duration { get; set; }
    }

}

namespace CoreService.ServiceModel.Enums
{
    public enum JobEventStates
    {
        Started,
        Skipped,
        Completed,
        Failed,
    }

}

namespace YCO.Dune.Models.Enums
{
    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# 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}