| Required role: | TenantReader |
| GET | /api/deployments/{Id} | Returns a deployment | |
|---|---|---|---|
| GET | /deployments/{Id} | Returns a deployment |
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,
}
class TagDto implements IConvertible
{
String name = "";
String? value;
bool isProtected;
TagDto({this.name,this.value,this.isProtected});
TagDto.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() => "TagDto";
TypeContext? context = _ctx;
}
class PathItemDto implements IConvertible
{
String label = "";
String link = "";
ObjectTypes objectType;
String objectId = "";
PathItemDto({this.label,this.link,this.objectType,this.objectId});
PathItemDto.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() => "PathItemDto";
TypeContext? context = _ctx;
}
class LinkDto implements IConvertible
{
String caption = "";
String rel = "";
String hRef = "";
String method = "";
LinkDto({this.caption,this.rel,this.hRef,this.method});
LinkDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
caption = json['caption'];
rel = json['rel'];
hRef = json['hRef'];
method = json['method'];
return this;
}
Map<String, dynamic> toJson() => {
'caption': caption,
'rel': rel,
'hRef': hRef,
'method': method
};
getTypeName() => "LinkDto";
TypeContext? context = _ctx;
}
class ConfigItemDto implements IConfigItem, IConvertible
{
String id = "";
String name = "";
String displayName = "";
String? description;
ObjectTypes objectType;
String selfLink = "";
List<TagDto>? tags;
List<PathItemDto>? path;
DateTime created = DateTime(0);
String createUser = "";
String createUserId = "";
DateTime modified = DateTime(0);
String modifyUser = "";
String modifyUserId = "";
bool isDeleted;
DateTime? deleted;
String? deleteUser;
String? deleteUserId;
List<LinkDto>? links;
ConfigItemDto({this.id,this.name,this.displayName,this.description,this.objectType,this.selfLink,this.tags,this.path,this.created,this.createUser,this.createUserId,this.modified,this.modifyUser,this.modifyUserId,this.isDeleted,this.deleted,this.deleteUser,this.deleteUserId,this.links});
ConfigItemDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> 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<TagDto>',context!);
path = JsonConverters.fromJson(json['path'],'List<PathItemDto>',context!);
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'];
links = JsonConverters.fromJson(json['links'],'List<LinkDto>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'name': name,
'displayName': displayName,
'description': description,
'objectType': JsonConverters.toJson(objectType,'ObjectTypes',context!),
'selfLink': selfLink,
'tags': JsonConverters.toJson(tags,'List<TagDto>',context!),
'path': JsonConverters.toJson(path,'List<PathItemDto>',context!),
'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,
'links': JsonConverters.toJson(links,'List<LinkDto>',context!)
};
getTypeName() => "ConfigItemDto";
TypeContext? context = _ctx;
}
enum OperationalStates
{
None,
Starting,
Running,
Stopping,
Stopped,
Restarting,
Deleting,
Unknown,
}
enum LifecycleStates
{
New,
Deploying,
Deployed,
Removing,
Removed,
Failure,
Imported,
}
enum Environments
{
Lab,
Poc,
Dev,
Test,
Int,
Uat,
Prod,
}
enum ParameterValueType
{
String,
Number,
Boolean,
SecureString,
}
class ParameterDto implements IConvertible
{
String name = "";
String? description;
/**
* Value in form of a json string (e.g. Number = 1234, String = "foo", Boolean = false). Note: string values need extra quotes
*/
String? value;
/**
* Optional default value for the frontend. Needs to be in the same format as the value
*/
String? Default;
/**
* Optional parameters do not need to have a value. Default -> Optional=false
*/
bool optional;
/**
* The data type of the value and default property
*/
ParameterValueType type;
String? validation;
ParameterDto({this.name,this.description,this.value,this.Default,this.optional,this.type,this.validation});
ParameterDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
name = json['name'];
description = json['description'];
value = json['value'];
Default = json['default'];
optional = json['optional'];
type = JsonConverters.fromJson(json['type'],'ParameterValueType',context!);
validation = json['validation'];
return this;
}
Map<String, dynamic> toJson() => {
'name': name,
'description': description,
'value': value,
'default': Default,
'optional': optional,
'type': JsonConverters.toJson(type,'ParameterValueType',context!),
'validation': validation
};
getTypeName() => "ParameterDto";
TypeContext? context = _ctx;
}
enum ValueDataType
{
String,
Number,
Boolean,
List,
}
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;
}
enum ResourceCompositions
{
Native,
Foreign,
Mixed,
}
class DeploymentDto extends ConfigItemDto implements IHasParentDto, IHasTenantId, IEnvironmentSpecific, IConvertible
{
/**
* The operational state of the deployment (Running, Stopped, None, Unknown)
*/
OperationalStates operationalState;
/**
* How many start/stop-capable resources are currently running
*/
int resourcesRunning = 0;
/**
* Total number of start/stop-capable resources in this deployment
*/
int resourcesTotal = 0;
/**
* Shorter id than the guid which can be used for automation (tenant wide unique) prefixed with a 'd'. E.g. dr36x3
*/
String shortId = "";
/**
* The user defined part of the name property {userDefined}_{environment}
*/
String nameUserDefinedPart = "";
/**
* The id of the tenant
*/
String tenantId = "";
/**
* The state of the deployment
*/
LifecycleStates state;
/**
* The environment the deployment is deployed in
*/
Environments environment;
/**
* The id of the template which was used to create the deployment
*/
String? templateId;
/**
* Shows if a deployment was rolled out through a dune template or not
*/
bool isTemplateBased;
/**
* The parameters which were used to create this deployment
*/
List<ParameterDto>? parameters;
/**
* A deployment scoped list of variables used for deployment of resources
*/
List<VariableDto>? variables;
/**
* A snapshot of the varialbs used to create the deployment
*/
List<VariableDto>? variablesSnapshot;
/**
* The id of the parent (collection) of the deployment
*/
String parentId = "";
/**
* The parent (collection) of the deployment
*/
ConfigItemDto? parent;
/**
* The Date when the resources got deployed
*/
DateTime validFrom = DateTime(0);
/**
* The Date when the deployment expires and has to be reevaluated
*/
DateTime? validUntil;
/**
* The deployment will never expire
*/
bool isNeverExpiring;
/**
* The date, when the deployments resources will receive updates
*/
DateTime? nextPatchDate;
/**
* The default resource provider where the resources are deployed
*/
String defaultResourceProviderId = "";
/**
* Deployments which have issues in Jobs are marked with NeedsAttention
*/
bool needsAttention;
/**
* Composition show if all resources in the deployment are dune native, dune foreign or a mix of both
*/
ResourceCompositions composition;
/**
* The monthly cost budget for the whole collection
*/
double? monthlyBudget;
/**
* Whether to send budget information mails to the collection owners
*/
bool? sendBudgetNotificationMails;
/**
* A threshold, when to send the first budget warning mail
*/
int? budgetWarningThresholdPercent;
List<LinkDto>? links;
DeploymentDto({this.operationalState,this.resourcesRunning,this.resourcesTotal,this.shortId,this.nameUserDefinedPart,this.tenantId,this.state,this.environment,this.templateId,this.isTemplateBased,this.parameters,this.variables,this.variablesSnapshot,this.parentId,this.parent,this.validFrom,this.validUntil,this.isNeverExpiring,this.nextPatchDate,this.defaultResourceProviderId,this.needsAttention,this.composition,this.monthlyBudget,this.sendBudgetNotificationMails,this.budgetWarningThresholdPercent,this.links});
DeploymentDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
operationalState = JsonConverters.fromJson(json['operationalState'],'OperationalStates',context!);
resourcesRunning = json['resourcesRunning'];
resourcesTotal = json['resourcesTotal'];
shortId = json['shortId'];
nameUserDefinedPart = json['nameUserDefinedPart'];
tenantId = json['tenantId'];
state = JsonConverters.fromJson(json['state'],'LifecycleStates',context!);
environment = JsonConverters.fromJson(json['environment'],'Environments',context!);
templateId = json['templateId'];
isTemplateBased = json['isTemplateBased'];
parameters = JsonConverters.fromJson(json['parameters'],'List<ParameterDto>',context!);
variables = JsonConverters.fromJson(json['variables'],'List<VariableDto>',context!);
variablesSnapshot = JsonConverters.fromJson(json['variablesSnapshot'],'List<VariableDto>',context!);
parentId = json['parentId'];
parent = JsonConverters.fromJson(json['parent'],'ConfigItemDto',context!);
validFrom = JsonConverters.fromJson(json['validFrom'],'DateTime',context!);
validUntil = JsonConverters.fromJson(json['validUntil'],'DateTime',context!);
isNeverExpiring = json['isNeverExpiring'];
nextPatchDate = JsonConverters.fromJson(json['nextPatchDate'],'DateTime',context!);
defaultResourceProviderId = json['defaultResourceProviderId'];
needsAttention = json['needsAttention'];
composition = JsonConverters.fromJson(json['composition'],'ResourceCompositions',context!);
monthlyBudget = JsonConverters.toDouble(json['monthlyBudget']);
sendBudgetNotificationMails = json['sendBudgetNotificationMails'];
budgetWarningThresholdPercent = json['budgetWarningThresholdPercent'];
links = JsonConverters.fromJson(json['links'],'List<LinkDto>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'operationalState': JsonConverters.toJson(operationalState,'OperationalStates',context!),
'resourcesRunning': resourcesRunning,
'resourcesTotal': resourcesTotal,
'shortId': shortId,
'nameUserDefinedPart': nameUserDefinedPart,
'tenantId': tenantId,
'state': JsonConverters.toJson(state,'LifecycleStates',context!),
'environment': JsonConverters.toJson(environment,'Environments',context!),
'templateId': templateId,
'isTemplateBased': isTemplateBased,
'parameters': JsonConverters.toJson(parameters,'List<ParameterDto>',context!),
'variables': JsonConverters.toJson(variables,'List<VariableDto>',context!),
'variablesSnapshot': JsonConverters.toJson(variablesSnapshot,'List<VariableDto>',context!),
'parentId': parentId,
'parent': JsonConverters.toJson(parent,'ConfigItemDto',context!),
'validFrom': JsonConverters.toJson(validFrom,'DateTime',context!),
'validUntil': JsonConverters.toJson(validUntil,'DateTime',context!),
'isNeverExpiring': isNeverExpiring,
'nextPatchDate': JsonConverters.toJson(nextPatchDate,'DateTime',context!),
'defaultResourceProviderId': defaultResourceProviderId,
'needsAttention': needsAttention,
'composition': JsonConverters.toJson(composition,'ResourceCompositions',context!),
'monthlyBudget': monthlyBudget,
'sendBudgetNotificationMails': sendBudgetNotificationMails,
'budgetWarningThresholdPercent': budgetWarningThresholdPercent,
'links': JsonConverters.toJson(links,'List<LinkDto>',context!)
});
getTypeName() => "DeploymentDto";
TypeContext? context = _ctx;
}
/**
* Returns a deployment by its ID
*/
// @Api(Description="Returns a deployment by its ID")
// @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(DeploymentDto), StatusCode=200)
class GetDeployment implements IGetSingleRequest, IHasTenantName, IGet, IConvertible
{
// @ApiMember(DataType="string", Format="guid", IsRequired=true, ParameterType="path")
String id = "";
// @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
// @Validate(Validator="NotEmpty")
String tenantName = "";
// @ApiMember(ParameterType="query", Verb="GET")
bool? includeReferencedObjects;
/**
* If true, also soft deleted items will be returned
*/
// @ApiMember(Description="If true, also soft deleted items will be returned", ParameterType="query")
bool? includeDeleted;
GetDeployment({this.id,this.tenantName,this.includeReferencedObjects,this.includeDeleted});
GetDeployment.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
tenantName = json['tenantName'];
includeReferencedObjects = json['includeReferencedObjects'];
includeDeleted = json['includeDeleted'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'tenantName': tenantName,
'includeReferencedObjects': includeReferencedObjects,
'includeDeleted': includeDeleted
};
getTypeName() => "GetDeployment";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'duneframework.com', types: <String, TypeInfo> {
'ObjectTypes': TypeInfo(TypeOf.Enum, enumValues:ObjectTypes.values),
'TagDto': TypeInfo(TypeOf.Class, create:() => TagDto()),
'PathItemDto': TypeInfo(TypeOf.Class, create:() => PathItemDto()),
'LinkDto': TypeInfo(TypeOf.Class, create:() => LinkDto()),
'ConfigItemDto': TypeInfo(TypeOf.Class, create:() => ConfigItemDto()),
'List<TagDto>': TypeInfo(TypeOf.Class, create:() => <TagDto>[]),
'List<PathItemDto>': TypeInfo(TypeOf.Class, create:() => <PathItemDto>[]),
'List<LinkDto>': TypeInfo(TypeOf.Class, create:() => <LinkDto>[]),
'OperationalStates': TypeInfo(TypeOf.Enum, enumValues:OperationalStates.values),
'LifecycleStates': TypeInfo(TypeOf.Enum, enumValues:LifecycleStates.values),
'Environments': TypeInfo(TypeOf.Enum, enumValues:Environments.values),
'ParameterValueType': TypeInfo(TypeOf.Enum, enumValues:ParameterValueType.values),
'ParameterDto': TypeInfo(TypeOf.Class, create:() => ParameterDto()),
'ValueDataType': TypeInfo(TypeOf.Enum, enumValues:ValueDataType.values),
'VariableDto': TypeInfo(TypeOf.Class, create:() => VariableDto()),
'ResourceCompositions': TypeInfo(TypeOf.Enum, enumValues:ResourceCompositions.values),
'DeploymentDto': TypeInfo(TypeOf.Class, create:() => DeploymentDto()),
'List<ParameterDto>': TypeInfo(TypeOf.Class, create:() => <ParameterDto>[]),
'List<VariableDto>': TypeInfo(TypeOf.Class, create:() => <VariableDto>[]),
'GetDeployment': TypeInfo(TypeOf.Class, create:() => GetDeployment()),
});
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/deployments/{Id} HTTP/1.1
Host: core.starburst.svc
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"operationalState":"None","resourcesRunning":0,"resourcesTotal":0,"shortId":"String","nameUserDefinedPart":"String","tenantId":"00000000-0000-0000-0000-000000000000","state":"New","environment":"Lab","templateId":"00000000-0000-0000-0000-000000000000","isTemplateBased":true,"parameters":null,"variables":null,"variablesSnapshot":null,"parentId":"00000000-0000-0000-0000-000000000000","parent":{"id":"00000000-0000-0000-0000-000000000000","name":"String","displayName":"String","description":"String","objectType":"None","selfLink":"String","tags":null,"path":null,"created":"0001-01-01T00:00:00.0000000Z","createUser":"String","createUserId":"String","modified":"0001-01-01T00:00:00.0000000Z","modifyUser":"String","modifyUserId":"String","isDeleted":false,"deleted":"0001-01-01T00:00:00.0000000Z","deleteUser":"String","deleteUserId":"String","links":null},"validFrom":"0001-01-01T00:00:00.0000000Z","validUntil":"0001-01-01T00:00:00.0000000Z","isNeverExpiring":false,"nextPatchDate":"0001-01-01T00:00:00.0000000Z","defaultResourceProviderId":"00000000-0000-0000-0000-000000000000","needsAttention":false,"composition":"Native","monthlyBudget":0,"sendBudgetNotificationMails":false,"budgetWarningThresholdPercent":0,"links":[{"caption":"Index","rel":"index","hRef":"/deployments/","method":"GET"},{"caption":"Collection","rel":"up","hRef":"/collections/00000000-0000-0000-0000-000000000000","method":"GET"},{"caption":"Resourcegroups","rel":"down","hRef":"/resourcegroups?parentId=00000000-0000-0000-0000-000000000000","method":"GET"}],"id":"00000000-0000-0000-0000-000000000000","name":"String","displayName":"String","description":"String","objectType":"None","selfLink":"String","tags":null,"path":null,"created":"0001-01-01T00:00:00.0000000Z","createUser":"String","createUserId":"String","modified":"0001-01-01T00:00:00.0000000Z","modifyUser":"String","modifyUserId":"String","isDeleted":false,"deleted":"0001-01-01T00:00:00.0000000Z","deleteUser":"String","deleteUserId":"String"}