| Required role: | TenantReader |
| GET | /api/deploymenttemplates/{Id} | Returns a deployment template by its id | |
|---|---|---|---|
| GET | /deploymenttemplates/{Id} | Returns a deployment template by its id |
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 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;
}
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 ResourceProviderTypes
{
Azure,
AmazonWebServices,
GoogleCloudPlatform,
ActiveDirectoryServices,
DomainNameSystem,
SwisscomESC,
AzureKeyVault,
}
class ProviderConfigEntryDto implements IConvertible
{
String name = "";
String value = "";
bool isSecure;
ProviderConfigEntryDto({this.name,this.value,this.isSecure});
ProviderConfigEntryDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
name = json['name'];
value = json['value'];
isSecure = json['isSecure'];
return this;
}
Map<String, dynamic> toJson() => {
'name': name,
'value': value,
'isSecure': isSecure
};
getTypeName() => "ProviderConfigEntryDto";
TypeContext? context = _ctx;
}
class ResourceProviderDto extends ConfigItemDto implements IHasTenantId, IConvertible
{
String tenantId = "";
/**
* If environment cannot be detected while scanning, default environment will be used
*/
Environments defaultEnvironment;
/**
* List off all allowed environments for this resource provider
*/
List<Environments>? allowedEnvironments;
/**
* Defines the provider type (e.g. Azure, Aws)
*/
ResourceProviderTypes type;
/**
* Additional generic data which varies depending on ProviderType
*/
List<ProviderConfigEntryDto>? config;
/**
* Disabled ResourceProviders cannot be selected for new deployments
*/
bool isDisabled;
/**
* Shows if a ResourceProvider has been initialized and can accept deployments (resources)
*/
bool isReadyForDeployments;
/**
* The cost for the current month
*/
double costCurrentMonth = 0;
/**
* The cost for the last month
*/
double costLastMonth = 0;
/**
* The cost currency
*/
String costCurrency = "";
ResourceProviderDto({this.tenantId,this.defaultEnvironment,this.allowedEnvironments,this.type,this.config,this.isDisabled,this.isReadyForDeployments,this.costCurrentMonth,this.costLastMonth,this.costCurrency});
ResourceProviderDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
tenantId = json['tenantId'];
defaultEnvironment = JsonConverters.fromJson(json['defaultEnvironment'],'Environments',context!);
allowedEnvironments = JsonConverters.fromJson(json['allowedEnvironments'],'List<Environments>',context!);
type = JsonConverters.fromJson(json['type'],'ResourceProviderTypes',context!);
config = JsonConverters.fromJson(json['config'],'List<ProviderConfigEntryDto>',context!);
isDisabled = json['isDisabled'];
isReadyForDeployments = json['isReadyForDeployments'];
costCurrentMonth = JsonConverters.toDouble(json['costCurrentMonth']);
costLastMonth = JsonConverters.toDouble(json['costLastMonth']);
costCurrency = json['costCurrency'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'tenantId': tenantId,
'defaultEnvironment': JsonConverters.toJson(defaultEnvironment,'Environments',context!),
'allowedEnvironments': JsonConverters.toJson(allowedEnvironments,'List<Environments>',context!),
'type': JsonConverters.toJson(type,'ResourceProviderTypes',context!),
'config': JsonConverters.toJson(config,'List<ProviderConfigEntryDto>',context!),
'isDisabled': isDisabled,
'isReadyForDeployments': isReadyForDeployments,
'costCurrentMonth': costCurrentMonth,
'costLastMonth': costLastMonth,
'costCurrency': costCurrency
});
getTypeName() => "ResourceProviderDto";
TypeContext? context = _ctx;
}
class ResourceTemplateDto implements IConvertible
{
String name = "";
String displayName = "";
String description = "";
ObjectTypes type;
ResourceTemplateDto({this.name,this.displayName,this.description,this.type});
ResourceTemplateDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
name = json['name'];
displayName = json['displayName'];
description = json['description'];
type = JsonConverters.fromJson(json['type'],'ObjectTypes',context!);
return this;
}
Map<String, dynamic> toJson() => {
'name': name,
'displayName': displayName,
'description': description,
'type': JsonConverters.toJson(type,'ObjectTypes',context!)
};
getTypeName() => "ResourceTemplateDto";
TypeContext? context = _ctx;
}
class ResourceGroupTemplateDto extends ConfigItemDto implements IHasTenantId, IConvertible
{
String tenantId = "";
/**
* The schema version of the attached definition (json/yaml structure)
*/
int schemaVersion = 0;
/**
* The version of the template (changes with each change to the template)
*/
String version = "";
/**
* The version in a numeric (padded) form which can be used for sorting
*/
int versionNumeric = 0;
/**
* The template definition/body either as json or yaml
*/
String? definition;
/**
* Template variables
*/
List<VariableDto>? variables;
/**
* Template parameters
*/
List<ParameterDto>? parameters;
/**
* The template with the highest version number has IsLatest set to true
*/
bool isLatest;
/**
* List of contained resources
*/
List<ResourceTemplateDto>? resourceTemplates;
ResourceGroupTemplateDto({this.tenantId,this.schemaVersion,this.version,this.versionNumeric,this.definition,this.variables,this.parameters,this.isLatest,this.resourceTemplates});
ResourceGroupTemplateDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
tenantId = json['tenantId'];
schemaVersion = json['schemaVersion'];
version = json['version'];
versionNumeric = json['versionNumeric'];
definition = json['definition'];
variables = JsonConverters.fromJson(json['variables'],'List<VariableDto>',context!);
parameters = JsonConverters.fromJson(json['parameters'],'List<ParameterDto>',context!);
isLatest = json['isLatest'];
resourceTemplates = JsonConverters.fromJson(json['resourceTemplates'],'List<ResourceTemplateDto>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'tenantId': tenantId,
'schemaVersion': schemaVersion,
'version': version,
'versionNumeric': versionNumeric,
'definition': definition,
'variables': JsonConverters.toJson(variables,'List<VariableDto>',context!),
'parameters': JsonConverters.toJson(parameters,'List<ParameterDto>',context!),
'isLatest': isLatest,
'resourceTemplates': JsonConverters.toJson(resourceTemplates,'List<ResourceTemplateDto>',context!)
});
getTypeName() => "ResourceGroupTemplateDto";
TypeContext? context = _ctx;
}
class DeploymentTemplateDto extends ConfigItemDto implements IHasTenantId, IConvertible
{
String tenantId = "";
/**
* The schema version of the attached definition (json/yaml structure)
*/
int schemaVersion = 0;
/**
* The version of the template (changes with each change to the template)
*/
String version = "";
/**
* The version in a numeric (padded) form which can be used for sorting
*/
int versionNumeric = 0;
/**
* The template definition as json/yaml
*/
String? definition;
/**
* Template variables
*/
List<VariableDto>? variables;
/**
* Template parameters
*/
List<ParameterDto>? parameters;
/**
* Disabled templates should not be selected for deployments
*/
bool isDisabled;
/**
* The template with the highest version number has IsLatest set to true
*/
bool isLatest;
/**
* This template can be deployed only to the environments listed below
*/
List<Environments>? allowedEnvironments;
/**
* This template can be deployed only to the resource providers listed below
*/
List<ResourceProviderDto>? allowedResourceProviders;
/**
* An optional list of the child resource group templates
*/
List<ResourceGroupTemplateDto>? resourceGroupTemplates;
DeploymentTemplateDto({this.tenantId,this.schemaVersion,this.version,this.versionNumeric,this.definition,this.variables,this.parameters,this.isDisabled,this.isLatest,this.allowedEnvironments,this.allowedResourceProviders,this.resourceGroupTemplates});
DeploymentTemplateDto.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
tenantId = json['tenantId'];
schemaVersion = json['schemaVersion'];
version = json['version'];
versionNumeric = json['versionNumeric'];
definition = json['definition'];
variables = JsonConverters.fromJson(json['variables'],'List<VariableDto>',context!);
parameters = JsonConverters.fromJson(json['parameters'],'List<ParameterDto>',context!);
isDisabled = json['isDisabled'];
isLatest = json['isLatest'];
allowedEnvironments = JsonConverters.fromJson(json['allowedEnvironments'],'List<Environments>',context!);
allowedResourceProviders = JsonConverters.fromJson(json['allowedResourceProviders'],'List<ResourceProviderDto>',context!);
resourceGroupTemplates = JsonConverters.fromJson(json['resourceGroupTemplates'],'List<ResourceGroupTemplateDto>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'tenantId': tenantId,
'schemaVersion': schemaVersion,
'version': version,
'versionNumeric': versionNumeric,
'definition': definition,
'variables': JsonConverters.toJson(variables,'List<VariableDto>',context!),
'parameters': JsonConverters.toJson(parameters,'List<ParameterDto>',context!),
'isDisabled': isDisabled,
'isLatest': isLatest,
'allowedEnvironments': JsonConverters.toJson(allowedEnvironments,'List<Environments>',context!),
'allowedResourceProviders': JsonConverters.toJson(allowedResourceProviders,'List<ResourceProviderDto>',context!),
'resourceGroupTemplates': JsonConverters.toJson(resourceGroupTemplates,'List<ResourceGroupTemplateDto>',context!)
});
getTypeName() => "DeploymentTemplateDto";
TypeContext? context = _ctx;
}
/**
* Returns a deployment template by its id
*/
// @Api(Description="Returns a deployment template by its id")
// @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(DeploymentTemplateDto), StatusCode=200)
class GetDeploymentTemplate 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 = "";
/**
* If true, also soft deleted items will be returned
*/
// @ApiMember(Description="If true, also soft deleted items will be returned", ParameterType="query")
bool? includeDeleted;
/**
* If true, also include the json definition
*/
// @ApiMember(Description="If true, also include the json definition", ParameterType="query")
bool? includeDefinition;
// @ApiMember(ParameterType="query", Verb="GET")
bool? includeReferencedObjects;
GetDeploymentTemplate({this.id,this.tenantName,this.includeDeleted,this.includeDefinition,this.includeReferencedObjects});
GetDeploymentTemplate.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
tenantName = json['tenantName'];
includeDeleted = json['includeDeleted'];
includeDefinition = json['includeDefinition'];
includeReferencedObjects = json['includeReferencedObjects'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'tenantName': tenantName,
'includeDeleted': includeDeleted,
'includeDefinition': includeDefinition,
'includeReferencedObjects': includeReferencedObjects
};
getTypeName() => "GetDeploymentTemplate";
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>[]),
'ValueDataType': TypeInfo(TypeOf.Enum, enumValues:ValueDataType.values),
'Environments': TypeInfo(TypeOf.Enum, enumValues:Environments.values),
'VariableDto': TypeInfo(TypeOf.Class, create:() => VariableDto()),
'ParameterValueType': TypeInfo(TypeOf.Enum, enumValues:ParameterValueType.values),
'ParameterDto': TypeInfo(TypeOf.Class, create:() => ParameterDto()),
'ResourceProviderTypes': TypeInfo(TypeOf.Enum, enumValues:ResourceProviderTypes.values),
'ProviderConfigEntryDto': TypeInfo(TypeOf.Class, create:() => ProviderConfigEntryDto()),
'ResourceProviderDto': TypeInfo(TypeOf.Class, create:() => ResourceProviderDto()),
'List<Environments>': TypeInfo(TypeOf.Class, create:() => <Environments>[]),
'List<ProviderConfigEntryDto>': TypeInfo(TypeOf.Class, create:() => <ProviderConfigEntryDto>[]),
'ResourceTemplateDto': TypeInfo(TypeOf.Class, create:() => ResourceTemplateDto()),
'ResourceGroupTemplateDto': TypeInfo(TypeOf.Class, create:() => ResourceGroupTemplateDto()),
'List<VariableDto>': TypeInfo(TypeOf.Class, create:() => <VariableDto>[]),
'List<ParameterDto>': TypeInfo(TypeOf.Class, create:() => <ParameterDto>[]),
'List<ResourceTemplateDto>': TypeInfo(TypeOf.Class, create:() => <ResourceTemplateDto>[]),
'DeploymentTemplateDto': TypeInfo(TypeOf.Class, create:() => DeploymentTemplateDto()),
'List<ResourceProviderDto>': TypeInfo(TypeOf.Class, create:() => <ResourceProviderDto>[]),
'List<ResourceGroupTemplateDto>': TypeInfo(TypeOf.Class, create:() => <ResourceGroupTemplateDto>[]),
'GetDeploymentTemplate': TypeInfo(TypeOf.Class, create:() => GetDeploymentTemplate()),
});
Dart GetDeploymentTemplate 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/deploymenttemplates/{Id} HTTP/1.1
Host: core.starburst.svc
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"tenantId":"00000000-0000-0000-0000-000000000000","schemaVersion":0,"version":"String","versionNumeric":0,"definition":"String","variables":null,"parameters":null,"isDisabled":false,"isLatest":false,"allowedEnvironments":null,"allowedResourceProviders":null,"resourceGroupTemplates":null,"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}