CoreService

<back to all web services

GetConfigItemHierarchy

Common - Requests

Return the object hierarchy of a configitem

Requires Authentication
Requires the role:TenantReader
The following routes are available for this service:
GET/api/configitems/{Id}/hierarchyReturns a list with ids of all parent items
GET/configitems/{Id}/hierarchyReturns a list with ids of all parent items
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using YCO.Dune.Models.Dtos.Core;
using YCO.Dune.Models.Enums;
using YCO.Dune.Models.Dtos.Common.Responses;
using CoreService.ServiceModel.Dtos.Base.Responses;
using CoreService.ServiceModel.Enums;

namespace CoreService.ServiceModel.Dtos.Base.Responses
{
    public partial class VariableDto
    {
        public virtual string Name { get; set; }
        ///<summary>
        ///Value in form of a json string (e.g. Number = 1234, String = "foo", Boolean = false, List = [1,2,3,4]). Note: string values need extra quotes
        ///</summary>
        public virtual string Value { get; set; }
        ///<summary>
        ///The data type of the value property
        ///</summary>
        public virtual ValueDataType Type { get; set; }
        public virtual string? Description { get; set; }
        public virtual bool IsInherited { get; set; }
        public virtual Environments? Environment { get; set; }
    }

}

namespace CoreService.ServiceModel.Enums
{
    public enum Environments
    {
        Lab,
        Poc,
        Dev,
        Test,
        Int,
        Uat,
        Prod,
    }

    public enum ValueDataType
    {
        String,
        Number,
        Boolean,
        List,
    }

}

namespace YCO.Dune.Models.Dtos.Common.Responses
{
    public partial class ItemsResponse<T>
    {
        public virtual IList<VariableDto> Items { get; set; }
        public virtual int Offset { get; set; }
        public virtual int Total { get; set; }
        public virtual bool IsGrouped { get; set; }
        public virtual ResponseStatus? ResponseStatus { get; set; }
        public virtual Dictionary<string, string>? Meta { get; set; }
    }

}

namespace YCO.Dune.Models.Dtos.Core
{
    ///<summary>
    ///Return the object hierarchy of a configitem
    ///</summary>
    [Api(Description="Return the object hierarchy of a configitem")]
    [ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(YCO.Dune.Models.Dtos.Common.Responses.ItemsResponse`1[[YCO.Dune.Models.Dtos.Core.HierarchyItemDto, YCO.Dune.Models, Version=1.4.0.0, Culture=neutral, PublicKeyToken=null]]), StatusCode=200)]
    [ApiResponse(Description="Check log for more info", StatusCode=500)]
    public partial class GetConfigItemHierarchy
        : IBaseRequest, IHasTenantName, IGet
    {
        [ApiMember(DataType="string", Format="guid", IsRequired=true, ParameterType="path")]
        public virtual Guid Id { get; set; }

        ///<summary>
        ///objecttype of searched configitem
        ///</summary>
        [ApiMember(Description="objecttype of searched configitem", IsRequired=true, ParameterType="query")]
        [Validate("NotNull")]
        public virtual ObjectTypes ConfigItemType { get; set; }

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

        [ApiMember(DataType="string", Format="guid", ParameterType="query")]
        public virtual Guid TxId { get; set; }
    }

}

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# GetConfigItemHierarchy 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/configitems/{Id}/hierarchy HTTP/1.1 
Host: core.starburst.svc 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"items":null,"offset":0,"total":0,"isGrouped":false,"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"meta":{"String":"String"}}