| Required role: | TenantReader |
| GET | /api/resourcegrouptemplates/{Id} | Returns a resourcegroup template by its id | |
|---|---|---|---|
| GET | /resourcegrouptemplates/{Id} | Returns a resourcegroup template by its id |
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.Dtos.Templates.ResourceGroup.Responses;
using CoreService.ServiceModel.Dtos.Base.Responses;
using YCO.Dune.Models.Enums;
using CoreService.ServiceModel.Enums;
namespace CoreService.ServiceModel.Dtos.Base.Responses
{
public partial class ConfigItemDto
: IConfigItem
{
public virtual Guid Id { get; set; }
public virtual string Name { get; set; }
public virtual string DisplayName { get; set; }
public virtual string? Description { get; set; }
public virtual ObjectTypes ObjectType { get; set; }
public virtual string SelfLink { get; set; }
public virtual IList<TagDto> Tags { get; set; }
public virtual IList<PathItemDto> Path { get; set; }
public virtual DateTime Created { get; set; }
public virtual string CreateUser { get; set; }
public virtual string CreateUserId { get; set; }
public virtual DateTime Modified { get; set; }
public virtual string ModifyUser { get; set; }
public virtual string ModifyUserId { get; set; }
public virtual bool IsDeleted { get; set; }
public virtual DateTime? Deleted { get; set; }
public virtual string? DeleteUser { get; set; }
public virtual string? DeleteUserId { get; set; }
public virtual IList<LinkDto> Links { get; set; }
}
public partial class LinkDto
{
public virtual string Caption { get; set; }
public virtual string Rel { get; set; }
public virtual string HRef { get; set; }
public virtual string Method { get; set; }
}
public partial class ParameterDto
{
public virtual string Name { get; set; }
public virtual string? Description { get; set; }
///<summary>
///Value in form of a json string (e.g. Number = 1234, String = "foo", Boolean = false). Note: string values need extra quotes
///</summary>
public virtual string? Value { get; set; }
///<summary>
///Optional default value for the frontend. Needs to be in the same format as the value
///</summary>
public virtual string? Default { get; set; }
///<summary>
///Optional parameters do not need to have a value. Default -> Optional=false
///</summary>
public virtual bool Optional { get; set; }
///<summary>
///The data type of the value and default property
///</summary>
public virtual ParameterValueType Type { get; set; }
public virtual string? Validation { get; set; }
}
public partial class PathItemDto
{
public virtual string Label { get; set; }
public virtual string Link { get; set; }
public virtual ObjectTypes ObjectType { get; set; }
public virtual Guid ObjectId { get; set; }
}
public partial class TagDto
{
public virtual string Name { get; set; }
public virtual string? Value { get; set; }
public virtual bool IsProtected { get; set; }
}
public partial class VariableDto
{
public virtual string Name { get; set; }
///<summary>
///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
///</summary>
public virtual string Value { get; set; }
///<summary>
///The data type of the value property
///</summary>
public virtual ValueDataType Type { get; set; }
public virtual string? Description { get; set; }
public virtual bool IsInherited { get; set; }
public virtual Environments? Environment { get; set; }
}
}
namespace CoreService.ServiceModel.Dtos.Templates.ResourceGroup.Crud
{
///<summary>
///Returns a resourcegroup template by its id
///</summary>
[Api(Description="Returns a resourcegroup template by its id")]
[ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(CoreService.ServiceModel.Dtos.Templates.ResourceGroup.Responses.ResourceGroupTemplateDto), StatusCode=200)]
public partial class GetResourceGroupTemplate
: IGetSingleRequest, IHasTenantName, IGet
{
[ApiMember(DataType="string", Format="guid", IsRequired=true, ParameterType="path")]
public virtual Guid Id { get; set; }
[ApiMember(DataType="string", IsRequired=true, ParameterType="header")]
[Validate("NotEmpty")]
public virtual string TenantName { 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; }
///<summary>
///If true, also include the json definition
///</summary>
[ApiMember(Description="If true, also include the json definition", ParameterType="query")]
public virtual bool? IncludeDefinition { get; set; }
[ApiMember(ParameterType="query", Verb="GET")]
public virtual bool? IncludeReferencedObjects { get; set; }
}
}
namespace CoreService.ServiceModel.Dtos.Templates.ResourceGroup.Responses
{
public partial class ResourceGroupTemplateDto
: ConfigItemDto, IHasTenantId
{
public virtual Guid TenantId { get; set; }
///<summary>
///The schema version of the attached definition (json/yaml structure)
///</summary>
public virtual int SchemaVersion { get; set; }
///<summary>
///The version of the template (changes with each change to the template)
///</summary>
public virtual string Version { get; set; }
///<summary>
///The version in a numeric (padded) form which can be used for sorting
///</summary>
public virtual int VersionNumeric { get; set; }
///<summary>
///The template definition/body either as json or yaml
///</summary>
public virtual string? Definition { get; set; }
///<summary>
///Template variables
///</summary>
public virtual IList<VariableDto> Variables { get; set; }
///<summary>
///Template parameters
///</summary>
public virtual IList<ParameterDto> Parameters { get; set; }
///<summary>
///The template with the highest version number has IsLatest set to true
///</summary>
public virtual bool IsLatest { get; set; }
///<summary>
///List of contained resources
///</summary>
public virtual IList<ResourceTemplateDto> ResourceTemplates { get; set; }
}
public partial class ResourceTemplateDto
{
public virtual string Name { get; set; }
public virtual string DisplayName { get; set; }
public virtual string Description { get; set; }
public virtual ObjectTypes Type { get; set; }
}
}
namespace CoreService.ServiceModel.Enums
{
public enum Environments
{
Lab,
Poc,
Dev,
Test,
Int,
Uat,
Prod,
}
public enum ParameterValueType
{
String,
Number,
Boolean,
SecureString,
}
public enum ValueDataType
{
String,
Number,
Boolean,
List,
}
}
namespace YCO.Dune.Models.Enums
{
public 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,
}
}
C# 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
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}