CoreService

<back to all web services

GetResourceGroupTemplate

ResourceGroupTemplate - CRUD

Returns a resourcegroup template by its id

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
GET/api/resourcegrouptemplates/{Id}Returns a resourcegroup template by its id
GET/resourcegrouptemplates/{Id}Returns a resourcegroup 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;
}

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

/**
* Returns a resourcegroup template by its id
*/
// @Api(Description="Returns a resourcegroup template by its id")
// @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(ResourceGroupTemplateDto), StatusCode=200)
class GetResourceGroupTemplate 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;

    GetResourceGroupTemplate({this.id,this.tenantName,this.includeDeleted,this.includeDefinition,this.includeReferencedObjects});
    GetResourceGroupTemplate.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() => "GetResourceGroupTemplate";
    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()),
    '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>[]),
    'GetResourceGroupTemplate': TypeInfo(TypeOf.Class, create:() => GetResourceGroupTemplate()),
});

Dart GetResourceGroupTemplate 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/resourcegrouptemplates/{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,"isLatest":false,"resourceTemplates":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}