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.*;

public class dtos
{

    /**
    * 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)
    public static class GetConfigItemHierarchy implements IBaseRequest, IHasTenantName, IGet
    {
        @ApiMember(DataType="string", Format="guid", IsRequired=true, ParameterType="path")
        public UUID id = null;

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

        @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
        @Validate(Validator="NotEmpty")
        public String tenantName = null;

        @ApiMember(DataType="string", Format="guid", ParameterType="query")
        public UUID txId = null;
        
        public UUID getId() { return id; }
        public GetConfigItemHierarchy setId(UUID value) { this.id = value; return this; }
        public ObjectTypes getConfigItemType() { return configItemType; }
        public GetConfigItemHierarchy setConfigItemType(ObjectTypes value) { this.configItemType = value; return this; }
        public String getTenantName() { return tenantName; }
        public GetConfigItemHierarchy setTenantName(String value) { this.tenantName = value; return this; }
        public UUID getTxId() { return txId; }
        public GetConfigItemHierarchy setTxId(UUID value) { this.txId = value; return this; }
    }

    public static 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;
    }

    public static class ItemsResponse<T>
    {
        public IList<VariableDto> items = null;
        public Integer offset = null;
        public Integer total = null;
        public Boolean isGrouped = null;
        public ResponseStatus responseStatus = null;
        public HashMap<String,String> meta = null;
        
        public IList<VariableDto> getItems() { return items; }
        public ItemsResponse<T> setItems(IList<VariableDto> value) { this.items = value; return this; }
        public Integer getOffset() { return offset; }
        public ItemsResponse<T> setOffset(Integer value) { this.offset = value; return this; }
        public Integer getTotal() { return total; }
        public ItemsResponse<T> setTotal(Integer value) { this.total = value; return this; }
        public Boolean getIsGrouped() { return isGrouped; }
        public ItemsResponse<T> setIsGrouped(Boolean value) { this.isGrouped = value; return this; }
        public ResponseStatus getResponseStatus() { return responseStatus; }
        public ItemsResponse<T> setResponseStatus(ResponseStatus value) { this.responseStatus = value; return this; }
        public HashMap<String,String> getMeta() { return meta; }
        public ItemsResponse<T> setMeta(HashMap<String,String> value) { this.meta = value; return this; }
    }

    public static class VariableDto
    {
        public String name = 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
        */
        public String value = null;
        /**
        * The data type of the value property
        */
        public ValueDataType type = null;
        public String description = null;
        public Boolean isInherited = null;
        public Environments environment = null;
        
        public String getName() { return name; }
        public VariableDto setName(String value) { this.name = value; return this; }
        public String getValue() { return value; }
        public VariableDto setValue(String value) { this.value = value; return this; }
        public ValueDataType getType() { return type; }
        public VariableDto setType(ValueDataType value) { this.type = value; return this; }
        public String getDescription() { return description; }
        public VariableDto setDescription(String value) { this.description = value; return this; }
        public Boolean getIsInherited() { return isInherited; }
        public VariableDto setIsInherited(Boolean value) { this.isInherited = value; return this; }
        public Environments getEnvironment() { return environment; }
        public VariableDto setEnvironment(Environments value) { this.environment = value; return this; }
    }

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

    public static enum Environments
    {
        Lab,
        Poc,
        Dev,
        Test,
        Int,
        Uat,
        Prod;
    }

}

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