| Required role: | TenantReader |
| GET | /api/resourceaddons/facts | Returns a list of facts | |
|---|---|---|---|
| GET | /resourceaddons/facts | Returns a list of facts |
import 'package:servicestack/servicestack.dart';
// @DataContract
abstract class QueryBase
{
// @DataMember(Order=1)
int? skip;
// @DataMember(Order=2)
int? take;
// @DataMember(Order=3)
String? orderBy;
// @DataMember(Order=4)
String? orderByDesc;
// @DataMember(Order=5)
String? include;
// @DataMember(Order=6)
String? fields;
// @DataMember(Order=7)
Map<String,String?>? meta;
QueryBase({this.skip,this.take,this.orderBy,this.orderByDesc,this.include,this.fields,this.meta});
QueryBase.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
skip = json['skip'];
take = json['take'];
orderBy = json['orderBy'];
orderByDesc = json['orderByDesc'];
include = json['include'];
fields = json['fields'];
meta = JsonConverters.toStringMap(json['meta']);
return this;
}
Map<String, dynamic> toJson() => {
'skip': skip,
'take': take,
'orderBy': orderBy,
'orderByDesc': orderByDesc,
'include': include,
'fields': fields,
'meta': meta
};
getTypeName() => "QueryBase";
TypeContext? context = _ctx;
}
abstract class QueryDb<T> extends QueryBase
{
QueryDb();
QueryDb.fromJson(Map<String, dynamic> json) : super.fromJson(json);
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
return this;
}
Map<String, dynamic> toJson() => super.toJson();
getTypeName() => "QueryDb<$T>";
TypeContext? context = _ctx;
}
class Fact implements IHasTenantId, IHasIdName, INotSoftDeletable, IConvertible
{
String id = "";
// @required()
String tenantId = "";
// @required()
String resourceId = "";
// @required()
// @StringLength(100)
String name = "";
// @required()
// @StringLength(250)
String displayName = "";
// @StringLength(20000)
String? value;
// @ignore()
String selfLink = "";
// @required()
DateTime lastSeen = DateTime(0);
Fact({this.id,this.tenantId,this.resourceId,this.name,this.displayName,this.value,this.selfLink,this.lastSeen});
Fact.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
tenantId = json['tenantId'];
resourceId = json['resourceId'];
name = json['name'];
displayName = json['displayName'];
value = json['value'];
selfLink = json['selfLink'];
lastSeen = JsonConverters.fromJson(json['lastSeen'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'tenantId': tenantId,
'resourceId': resourceId,
'name': name,
'displayName': displayName,
'value': value,
'selfLink': selfLink,
'lastSeen': JsonConverters.toJson(lastSeen,'DateTime',context!)
};
getTypeName() => "Fact";
TypeContext? context = _ctx;
}
enum Aggregations
{
None,
Count,
DistinctCount,
Sum,
Min,
Max,
Avg,
First,
}
/**
* Returns a list of facts
*/
// @Api(Description="Returns a list of facts")
// @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(0, Culture=neutral, PublicKeyToken=null]]), StatusCode=200)
class QueryFacts extends QueryDb<Fact> implements IHasTenantName, IGroupable, IGet, IConvertible
{
// @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
// @Validate(Validator="NotEmpty")
String tenantName = "";
/**
* The property, the data will be grouped on
*/
// @ApiMember(Description="The property, the data will be grouped on", ParameterType="query")
String? groupBy;
/**
* The property, used for aggregation
*/
// @ApiMember(Description="The property, used for aggregation", ParameterType="query")
String? aggregateOn;
/**
* The aggregation function to use
*/
// @ApiMember(Description="The aggregation function to use", ParameterType="query")
Aggregations? aggregation;
/**
* Returns all referenced object
*/
// @ApiMember(Description="Returns all referenced object", ParameterType="query")
bool? includeReferencedObjects;
QueryFacts({this.tenantName,this.groupBy,this.aggregateOn,this.aggregation,this.includeReferencedObjects});
QueryFacts.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
tenantName = json['tenantName'];
groupBy = json['groupBy'];
aggregateOn = json['aggregateOn'];
aggregation = JsonConverters.fromJson(json['aggregation'],'Aggregations',context!);
includeReferencedObjects = json['includeReferencedObjects'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'tenantName': tenantName,
'groupBy': groupBy,
'aggregateOn': aggregateOn,
'aggregation': JsonConverters.toJson(aggregation,'Aggregations',context!),
'includeReferencedObjects': includeReferencedObjects
});
getTypeName() => "QueryFacts";
TypeContext? context = _ctx;
}
class Auditable implements IAuditable, IConvertible
{
// @required()
DateTime created = DateTime(0);
// @required()
String createUser = "";
// @required()
String createUserId = "";
// @required()
DateTime modified = DateTime(0);
// @required()
String modifyUser = "";
// @required()
String modifyUserId = "";
// @required()
bool isDeleted;
DateTime? deleted;
String? deleteUser;
String? deleteUserId;
Auditable({this.created,this.createUser,this.createUserId,this.modified,this.modifyUser,this.modifyUserId,this.isDeleted,this.deleted,this.deleteUser,this.deleteUserId});
Auditable.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
created = JsonConverters.fromJson(json['created'],'DateTime',context!);
createUser = json['createUser'];
createUserId = json['createUserId'];
modified = JsonConverters.fromJson(json['modified'],'DateTime',context!);
modifyUser = json['modifyUser'];
modifyUserId = json['modifyUserId'];
isDeleted = json['isDeleted'];
deleted = JsonConverters.fromJson(json['deleted'],'DateTime',context!);
deleteUser = json['deleteUser'];
deleteUserId = json['deleteUserId'];
return this;
}
Map<String, dynamic> toJson() => {
'created': JsonConverters.toJson(created,'DateTime',context!),
'createUser': createUser,
'createUserId': createUserId,
'modified': JsonConverters.toJson(modified,'DateTime',context!),
'modifyUser': modifyUser,
'modifyUserId': modifyUserId,
'isDeleted': isDeleted,
'deleted': JsonConverters.toJson(deleted,'DateTime',context!),
'deleteUser': deleteUser,
'deleteUserId': deleteUserId
};
getTypeName() => "Auditable";
TypeContext? context = _ctx;
}
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,
}
class Tag implements IConvertible
{
String name = "";
String? value;
bool isProtected;
Tag({this.name,this.value,this.isProtected});
Tag.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
name = json['name'];
value = json['value'];
isProtected = json['isProtected'];
return this;
}
Map<String, dynamic> toJson() => {
'name': name,
'value': value,
'isProtected': isProtected
};
getTypeName() => "Tag";
TypeContext? context = _ctx;
}
class PathItem implements IConvertible
{
String label = "";
String link = "";
ObjectTypes objectType;
String objectId = "";
PathItem({this.label,this.link,this.objectType,this.objectId});
PathItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
label = json['label'];
link = json['link'];
objectType = JsonConverters.fromJson(json['objectType'],'ObjectTypes',context!);
objectId = json['objectId'];
return this;
}
Map<String, dynamic> toJson() => {
'label': label,
'link': link,
'objectType': JsonConverters.toJson(objectType,'ObjectTypes',context!),
'objectId': objectId
};
getTypeName() => "PathItem";
TypeContext? context = _ctx;
}
class ConfigItem extends Auditable implements IConfigItem, IConvertible
{
String id = "";
// @required()
String name = "";
// @required()
// @StringLength(250)
String displayName = "";
// @StringLength(8000)
String? description;
ObjectTypes objectType;
// @ignore()
String selfLink = "";
// @required()
List<Tag>? tags;
// @required()
List<PathItem>? path;
ConfigItem({this.id,this.name,this.displayName,this.description,this.objectType,this.selfLink,this.tags,this.path});
ConfigItem.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
id = json['id'];
name = json['name'];
displayName = json['displayName'];
description = json['description'];
objectType = JsonConverters.fromJson(json['objectType'],'ObjectTypes',context!);
selfLink = json['selfLink'];
tags = JsonConverters.fromJson(json['tags'],'List<Tag>',context!);
path = JsonConverters.fromJson(json['path'],'List<PathItem>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'id': id,
'name': name,
'displayName': displayName,
'description': description,
'objectType': JsonConverters.toJson(objectType,'ObjectTypes',context!),
'selfLink': selfLink,
'tags': JsonConverters.toJson(tags,'List<Tag>',context!),
'path': JsonConverters.toJson(path,'List<PathItem>',context!)
});
getTypeName() => "ConfigItem";
TypeContext? context = _ctx;
}
enum ValueDataType
{
String,
Number,
Boolean,
List,
}
enum Environments
{
Lab,
Poc,
Dev,
Test,
Int,
Uat,
Prod,
}
class Variable implements IConvertible
{
String name = "";
String value = "";
ValueDataType type;
String? description;
bool isInherited;
Environments? environment;
Variable({this.name,this.value,this.type,this.description,this.isInherited,this.environment});
Variable.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() => "Variable";
TypeContext? context = _ctx;
}
class Tenant extends ConfigItem implements IHasVariables, IConvertible
{
// @required()
// @StringLength(10)
String name = "";
// @required()
ObjectTypes objectType;
// @ignore()
String selfLink = "";
// @required()
List<Variable>? variables;
// @required()
List<String>? allowedMailDomains;
// @required()
List<String>? licensedModules;
// @required()
int defaultDeploymentLifetimeDays = 0;
// @required()
int maxDeploymentLifetimeDays = 0;
// @required()
int systemUnpatchedWarningDays = 0;
// @required()
int systemBackupMissingWarningHours = 0;
// @required()
int stopVulnerableResourceAfterDays = 0;
// @required()
int deploymentExpirationWarningDays = 0;
// @required()
int patchNotificationDays = 0;
// @required()
bool useCustomHostnames;
// @required()
int removeInactiveVulnerabilitiesAfterDays = 0;
Tenant({this.name,this.objectType,this.selfLink,this.variables,this.allowedMailDomains,this.licensedModules,this.defaultDeploymentLifetimeDays,this.maxDeploymentLifetimeDays,this.systemUnpatchedWarningDays,this.systemBackupMissingWarningHours,this.stopVulnerableResourceAfterDays,this.deploymentExpirationWarningDays,this.patchNotificationDays,this.useCustomHostnames,this.removeInactiveVulnerabilitiesAfterDays});
Tenant.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
name = json['name'];
objectType = JsonConverters.fromJson(json['objectType'],'ObjectTypes',context!);
selfLink = json['selfLink'];
variables = JsonConverters.fromJson(json['variables'],'List<Variable>',context!);
allowedMailDomains = JsonConverters.fromJson(json['allowedMailDomains'],'List<String>',context!);
licensedModules = JsonConverters.fromJson(json['licensedModules'],'List<String>',context!);
defaultDeploymentLifetimeDays = json['defaultDeploymentLifetimeDays'];
maxDeploymentLifetimeDays = json['maxDeploymentLifetimeDays'];
systemUnpatchedWarningDays = json['systemUnpatchedWarningDays'];
systemBackupMissingWarningHours = json['systemBackupMissingWarningHours'];
stopVulnerableResourceAfterDays = json['stopVulnerableResourceAfterDays'];
deploymentExpirationWarningDays = json['deploymentExpirationWarningDays'];
patchNotificationDays = json['patchNotificationDays'];
useCustomHostnames = json['useCustomHostnames'];
removeInactiveVulnerabilitiesAfterDays = json['removeInactiveVulnerabilitiesAfterDays'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'name': name,
'objectType': JsonConverters.toJson(objectType,'ObjectTypes',context!),
'selfLink': selfLink,
'variables': JsonConverters.toJson(variables,'List<Variable>',context!),
'allowedMailDomains': JsonConverters.toJson(allowedMailDomains,'List<String>',context!),
'licensedModules': JsonConverters.toJson(licensedModules,'List<String>',context!),
'defaultDeploymentLifetimeDays': defaultDeploymentLifetimeDays,
'maxDeploymentLifetimeDays': maxDeploymentLifetimeDays,
'systemUnpatchedWarningDays': systemUnpatchedWarningDays,
'systemBackupMissingWarningHours': systemBackupMissingWarningHours,
'stopVulnerableResourceAfterDays': stopVulnerableResourceAfterDays,
'deploymentExpirationWarningDays': deploymentExpirationWarningDays,
'patchNotificationDays': patchNotificationDays,
'useCustomHostnames': useCustomHostnames,
'removeInactiveVulnerabilitiesAfterDays': removeInactiveVulnerabilitiesAfterDays
});
getTypeName() => "Tenant";
TypeContext? context = _ctx;
}
enum IntervalUnits
{
Second,
Minute,
Hour,
Day,
Week,
Month,
Year,
}
class TimeSeriesDefinition extends Auditable implements IHasIdName, IHasTenantId, IHasObjectType, IConvertible
{
String id = "";
// @References(typeof(Tenant))
String tenantId = "";
Tenant? tenant;
String name = "";
String? displayName;
// @ignore()
String selfLink = "";
// @required()
ObjectTypes objectType;
String? description;
ObjectTypes sourceType;
bool autoCollection;
String? autoCollectionQuery;
int? autoCollectionInterval;
IntervalUnits? autoCollectionIntervalUnit;
Duration? autoCollectionTime;
DateTime? lastAutoCollected;
int retentionTimeMonths = 0;
TimeSeriesDefinition({this.id,this.tenantId,this.tenant,this.name,this.displayName,this.selfLink,this.objectType,this.description,this.sourceType,this.autoCollection,this.autoCollectionQuery,this.autoCollectionInterval,this.autoCollectionIntervalUnit,this.autoCollectionTime,this.lastAutoCollected,this.retentionTimeMonths});
TimeSeriesDefinition.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
id = json['id'];
tenantId = json['tenantId'];
tenant = JsonConverters.fromJson(json['tenant'],'Tenant',context!);
name = json['name'];
displayName = json['displayName'];
selfLink = json['selfLink'];
objectType = JsonConverters.fromJson(json['objectType'],'ObjectTypes',context!);
description = json['description'];
sourceType = JsonConverters.fromJson(json['sourceType'],'ObjectTypes',context!);
autoCollection = json['autoCollection'];
autoCollectionQuery = json['autoCollectionQuery'];
autoCollectionInterval = json['autoCollectionInterval'];
autoCollectionIntervalUnit = JsonConverters.fromJson(json['autoCollectionIntervalUnit'],'IntervalUnits',context!);
autoCollectionTime = JsonConverters.fromJson(json['autoCollectionTime'],'Duration',context!);
lastAutoCollected = JsonConverters.fromJson(json['lastAutoCollected'],'DateTime',context!);
retentionTimeMonths = json['retentionTimeMonths'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'id': id,
'tenantId': tenantId,
'tenant': JsonConverters.toJson(tenant,'Tenant',context!),
'name': name,
'displayName': displayName,
'selfLink': selfLink,
'objectType': JsonConverters.toJson(objectType,'ObjectTypes',context!),
'description': description,
'sourceType': JsonConverters.toJson(sourceType,'ObjectTypes',context!),
'autoCollection': autoCollection,
'autoCollectionQuery': autoCollectionQuery,
'autoCollectionInterval': autoCollectionInterval,
'autoCollectionIntervalUnit': JsonConverters.toJson(autoCollectionIntervalUnit,'IntervalUnits',context!),
'autoCollectionTime': JsonConverters.toJson(autoCollectionTime,'Duration',context!),
'lastAutoCollected': JsonConverters.toJson(lastAutoCollected,'DateTime',context!),
'retentionTimeMonths': retentionTimeMonths
});
getTypeName() => "TimeSeriesDefinition";
TypeContext? context = _ctx;
}
// @DataContract
class QueryResponse<T> implements IConvertible
{
// @DataMember(Order=1)
int offset = 0;
// @DataMember(Order=2)
int total = 0;
// @DataMember(Order=3)
List<TimeSeriesDefinition> results = [];
// @DataMember(Order=4)
Map<String,String?>? meta;
// @DataMember(Order=5)
ResponseStatus? responseStatus;
QueryResponse({this.offset,this.total,this.results,this.meta,this.responseStatus});
QueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
offset = json['offset'];
total = json['total'];
results = JsonConverters.fromJson(json['results'],'List<TimeSeriesDefinition>',context!);
meta = JsonConverters.toStringMap(json['meta']);
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'offset': offset,
'total': total,
'results': JsonConverters.toJson(results,'List<TimeSeriesDefinition>',context!),
'meta': meta,
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
};
getTypeName() => "QueryResponse<$T>";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'duneframework.com', types: <String, TypeInfo> {
'Fact': TypeInfo(TypeOf.Class, create:() => Fact()),
'Aggregations': TypeInfo(TypeOf.Enum, enumValues:Aggregations.values),
'QueryFacts': TypeInfo(TypeOf.Class, create:() => QueryFacts()),
'List<Fact>': TypeInfo(TypeOf.Class, create:() => <Fact>[]),
'Auditable': TypeInfo(TypeOf.Class, create:() => Auditable()),
'ObjectTypes': TypeInfo(TypeOf.Enum, enumValues:ObjectTypes.values),
'Tag': TypeInfo(TypeOf.Class, create:() => Tag()),
'PathItem': TypeInfo(TypeOf.Class, create:() => PathItem()),
'ConfigItem': TypeInfo(TypeOf.Class, create:() => ConfigItem()),
'List<Tag>': TypeInfo(TypeOf.Class, create:() => <Tag>[]),
'List<PathItem>': TypeInfo(TypeOf.Class, create:() => <PathItem>[]),
'ValueDataType': TypeInfo(TypeOf.Enum, enumValues:ValueDataType.values),
'Environments': TypeInfo(TypeOf.Enum, enumValues:Environments.values),
'Variable': TypeInfo(TypeOf.Class, create:() => Variable()),
'Tenant': TypeInfo(TypeOf.Class, create:() => Tenant()),
'List<Variable>': TypeInfo(TypeOf.Class, create:() => <Variable>[]),
'IntervalUnits': TypeInfo(TypeOf.Enum, enumValues:IntervalUnits.values),
'TimeSeriesDefinition': TypeInfo(TypeOf.Class, create:() => TimeSeriesDefinition()),
'List<TimeSeriesDefinition>': TypeInfo(TypeOf.Class, create:() => <TimeSeriesDefinition>[]),
});
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/resourceaddons/facts HTTP/1.1 Host: core.starburst.svc Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"offset":0,"total":0,"results":[{"id":"00000000-0000-0000-0000-000000000000","tenantId":"00000000-0000-0000-0000-000000000000","resourceId":"00000000-0000-0000-0000-000000000000","name":"String","displayName":"String","value":"String","selfLink":"/resourceaddons/facts/00000000-0000-0000-0000-000000000000","lastSeen":"0001-01-01T00:00:00.0000000Z"}],"meta":{"String":"String"},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}