| Required role: | TenantReader |
| GET | /api/resourcegrouptemplates/{Id}/definition/ | Returns the template definition | |
|---|---|---|---|
| GET | /api/resourcegrouptemplates/{Name}/{Version}/definition | Returns the template definition | |
| GET | /resourcegrouptemplates/{Id}/definition/ | Returns the template definition | |
| GET | /resourcegrouptemplates/{Name}/{Version}/definition | Returns the template definition |
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using CoreService.ServiceModel.Dtos.Templates.ResourceGroup.Crud;
using CoreService.ServiceModel.Enums;
using CoreService.ServiceModel.Dtos.Base.Responses;
namespace CoreService.ServiceModel.Dtos.Base.Responses
{
public partial class TemplateDefinitionDto
{
///<summary>
///The schema version of the attached definition
///</summary>
public virtual int SchemaVersion { get; set; }
///<summary>
///The template definition/body either as json or yaml
///</summary>
public virtual string Definition { get; set; }
}
}
namespace CoreService.ServiceModel.Dtos.Templates.ResourceGroup.Crud
{
///<summary>
///Returns the template definition
///</summary>
[Api(Description="Returns the template definition")]
[ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(CoreService.ServiceModel.Dtos.Base.Responses.TemplateDefinitionDto), StatusCode=200)]
public partial class GetResourceGroupTemplateDefinition
: IGetSingleRequest, IHasTenantName, IGet
{
[ApiMember(DataType="string", Format="guid", IsRequired=true, ParameterType="path")]
public virtual Guid Id { get; set; }
///<summary>
///The templates name
///</summary>
[ApiMember(DataType="string", Description="The templates name", ParameterType="query")]
public virtual string? Name { get; set; }
///<summary>
///The templates version
///</summary>
[ApiMember(DataType="string", Description="The templates version", ParameterType="query")]
public virtual string? Version { get; set; }
[ApiMember(DataType="string", IsRequired=true, ParameterType="header")]
[Validate("NotEmpty")]
public virtual string TenantName { get; set; }
[ApiMember(IsRequired=true, ParameterType="query")]
public virtual TemplateLanguages DefinitionFormat { get; set; }
///<summary>
///If true, also soft deleted items will be returned
///</summary>
[ApiMember(Description="If true, also soft deleted items will be returned", ParameterType="query")]
public virtual bool? IncludeDeleted { get; set; }
[ApiMember(ParameterType="query", Verb="GET")]
public virtual bool? IncludeReferencedObjects { get; set; }
}
}
namespace CoreService.ServiceModel.Enums
{
public enum TemplateLanguages
{
Json,
Yaml,
}
}
C# GetResourceGroupTemplateDefinition 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/resourcegrouptemplates/{Id}/definition/ HTTP/1.1
Host: core.starburst.svc
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"schemaVersion":0,"definition":"String"}