CoreService

<back to all web services

GetResourceGroupTemplateDefinitions

ResourceGroupTemplate - CRUD

Returns the template definitions

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
GET/api/resourcegrouptemplates/definitionsReturns the template definitions
GET/resourcegrouptemplates/definitionsReturns the template definitions
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports CoreService.ServiceModel.Dtos.Templates.ResourceGroup.Crud
Imports CoreService.ServiceModel.Enums
Imports YCO.Dune.Models.Dtos.Common.Responses
Imports CoreService.ServiceModel.Dtos.Base.Responses

Namespace Global

    Namespace CoreService.ServiceModel.Dtos.Base.Responses

        Public Partial Class VariableDto
            Public Overridable Property Name As String
            '''<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 Overridable Property Value As String
            '''<Summary>
            '''The data type of the value property
            '''</Summary>
            Public Overridable Property Type As ValueDataType
            Public Overridable Property Description As String
            Public Overridable Property IsInherited As Boolean
            Public Overridable Property Environment As Environments?
        End Class
    End Namespace

    Namespace CoreService.ServiceModel.Dtos.Templates.ResourceGroup.Crud

        '''<Summary>
        '''Returns the template definitions
        '''</Summary>
        <Api(Description:="Returns the template definitions")>
        <ApiResponse(Description:="Success", IsDefaultResponse:=true, ResponseType:=GetType(0, Culture=neutral, PublicKeyToken=null]]), StatusCode:=200)>
        Public Partial Class GetResourceGroupTemplateDefinitions
            Implements IGetMultipleRequest
            Implements IHasTenantName
            Implements IGet
            <ApiMember(DataType:="string", IsRequired:=true, ParameterType:="header")>
            <Validate(Validator:="NotEmpty")>
            Public Overridable Property TenantName As String Implements IHasTenantName.TenantName

            <ApiMember(IsRequired:=true, ParameterType:="query")>
            Public Overridable Property DefinitionFormat As TemplateLanguages

            '''<Summary>
            '''The templates name
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The templates name", IsRequired:=true, ParameterType:="query")>
            <Validate(Validator:="NotEmpty")>
            Public Overridable Property Name As String

            '''<Summary>
            '''The templates version
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The templates version", ParameterType:="query")>
            Public Overridable Property Version As String

            '''<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 Overridable Property IncludeDeleted As Boolean? Implements IGetMultipleRequest.IncludeDeleted
        End Class
    End Namespace

    Namespace CoreService.ServiceModel.Enums

        Public Enum Environments
            Lab
            Poc
            Dev
            Test
            Int
            Uat
            Prod
        End Enum

        Public Enum TemplateLanguages
            Json
            Yaml
        End Enum

        Public Enum ValueDataType
            [String]
            Number
            [Boolean]
            List
        End Enum
    End Namespace

    Namespace YCO.Dune.Models.Dtos.Common.Responses

        Public Partial Class ItemsResponse(Of T)
            Public Overridable Property Items As IList(Of VariableDto)
            Public Overridable Property Offset As Integer
            Public Overridable Property Total As Integer
            Public Overridable Property IsGrouped As Boolean
            Public Overridable Property ResponseStatus As ResponseStatus
            Public Overridable Property Meta As Dictionary(Of String, String)
        End Class
    End Namespace
End Namespace

VB.NET GetResourceGroupTemplateDefinitions 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/definitions HTTP/1.1 
Host: core.starburst.svc 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"items":null,"offset":0,"total":0,"isGrouped":false,"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"meta":{"String":"String"}}