| Requires the role: | TenantReader |
| GET | /api/configitems/{Id}/hierarchy | Returns a list with ids of all parent items | |
|---|---|---|---|
| GET | /configitems/{Id}/hierarchy | Returns a list with ids of all parent items |
import 'package:servicestack/servicestack.dart';
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,
}
/**
* Return the object hierarchy of a configitem
*/
// @Api(Description="Return the object hierarchy of a configitem")
// @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(0, Culture=neutral, PublicKeyToken=null]]), StatusCode=200)
// @ApiResponse(Description="Check log for more info", StatusCode=500)
class GetConfigItemHierarchy implements IBaseRequest, IHasTenantName, IGet, IConvertible
{
// @ApiMember(DataType="string", Format="guid", IsRequired=true, ParameterType="path")
String id = "";
/**
* objecttype of searched configitem
*/
// @ApiMember(Description="objecttype of searched configitem", IsRequired=true, ParameterType="query")
// @Validate(Validator="NotNull")
ObjectTypes configItemType;
// @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
// @Validate(Validator="NotEmpty")
String tenantName = "";
// @ApiMember(DataType="string", Format="guid", ParameterType="query")
String txId = "";
GetConfigItemHierarchy({this.id,this.configItemType,this.tenantName,this.txId});
GetConfigItemHierarchy.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
configItemType = JsonConverters.fromJson(json['configItemType'],'ObjectTypes',context!);
tenantName = json['tenantName'];
txId = json['txId'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'configItemType': JsonConverters.toJson(configItemType,'ObjectTypes',context!),
'tenantName': tenantName,
'txId': txId
};
getTypeName() => "GetConfigItemHierarchy";
TypeContext? context = _ctx;
}
enum ValueDataType
{
String,
Number,
Boolean,
List,
}
enum Environments
{
Lab,
Poc,
Dev,
Test,
Int,
Uat,
Prod,
}
class VariableDto implements IConvertible
{
String name = "";
/**
* 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
*/
String value = "";
/**
* The data type of the value property
*/
ValueDataType type;
String? description;
bool isInherited;
Environments? environment;
VariableDto({this.name,this.value,this.type,this.description,this.isInherited,this.environment});
VariableDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
name = json['name'];
value = json['value'];
type = JsonConverters.fromJson(json['type'],'ValueDataType',context!);
description = json['description'];
isInherited = json['isInherited'];
environment = JsonConverters.fromJson(json['environment'],'Environments',context!);
return this;
}
Map<String, dynamic> toJson() => {
'name': name,
'value': value,
'type': JsonConverters.toJson(type,'ValueDataType',context!),
'description': description,
'isInherited': isInherited,
'environment': JsonConverters.toJson(environment,'Environments',context!)
};
getTypeName() => "VariableDto";
TypeContext? context = _ctx;
}
class ItemsResponse<T> implements IConvertible
{
List<VariableDto>? items;
int offset = 0;
int total = 0;
bool isGrouped;
ResponseStatus? responseStatus;
Map<String,String?>? meta;
ItemsResponse({this.items,this.offset,this.total,this.isGrouped,this.responseStatus,this.meta});
ItemsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
items = JsonConverters.fromJson(json['items'],'List<VariableDto>',context!);
offset = json['offset'];
total = json['total'];
isGrouped = json['isGrouped'];
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
meta = JsonConverters.toStringMap(json['meta']);
return this;
}
Map<String, dynamic> toJson() => {
'items': JsonConverters.toJson(items,'List<VariableDto>',context!),
'offset': offset,
'total': total,
'isGrouped': isGrouped,
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!),
'meta': meta
};
getTypeName() => "ItemsResponse<$T>";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'duneframework.com', types: <String, TypeInfo> {
'ObjectTypes': TypeInfo(TypeOf.Enum, enumValues:ObjectTypes.values),
'GetConfigItemHierarchy': TypeInfo(TypeOf.Class, create:() => GetConfigItemHierarchy()),
'ValueDataType': TypeInfo(TypeOf.Enum, enumValues:ValueDataType.values),
'Environments': TypeInfo(TypeOf.Enum, enumValues:Environments.values),
'VariableDto': TypeInfo(TypeOf.Class, create:() => VariableDto()),
'ItemsResponse<T>': TypeInfo(TypeOf.Class, create:() => ItemsResponse<T>()),
'List<VariableDto>': TypeInfo(TypeOf.Class, create:() => <VariableDto>[]),
});
Dart 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
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"}}