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
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*


/**
* Return the object hierarchy of a configitem
*/
@Api(Description="Return the object hierarchy of a configitem")
@ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=0, Culture=neutral, PublicKeyToken=null]]::class, StatusCode=200)
// @ApiResponse(Description="Check log for more info", StatusCode=500)
open class GetConfigItemHierarchy : IBaseRequest, IHasTenantName, IGet
{
    @ApiMember(DataType="string", Format="guid", IsRequired=true, ParameterType="path")
    open var id:UUID? = null

    /**
    * objecttype of searched configitem
    */
    @ApiMember(Description="objecttype of searched configitem", IsRequired=true, ParameterType="query")
    @Validate(Validator="NotNull")
    open var configItemType:ObjectTypes? = null

    @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
    @Validate(Validator="NotEmpty")
    override var tenantName:String? = null

    @ApiMember(DataType="string", Format="guid", ParameterType="query")
    override var txId:UUID? = null
}

enum class 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,
}

open class ItemsResponse<T>
{
    open var items:IList<VariableDto>? = null
    open var offset:Int? = null
    open var total:Int? = null
    open var isGrouped:Boolean? = null
    open var responseStatus:ResponseStatus? = null
    open var meta:HashMap<String,String>? = null
}

open class VariableDto
{
    open var name:String? = null
    /**
    * 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
    */
    open var value:String? = null
    /**
    * The data type of the value property
    */
    @SerializedName("type") open var Type:ValueDataType? = null
    open var description:String? = null
    open var isInherited:Boolean? = null
    open var environment:Environments? = null
}

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

enum class Environments
{
    Lab,
    Poc,
    Dev,
    Test,
    Int,
    Uat,
    Prod,
}

Kotlin 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"}}