CoreService

<back to all web services

GetDeploymentTemplate

DeploymentTemplate - CRUD

Returns a deployment template by its id

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
GET/api/deploymenttemplates/{Id}Returns a deployment template by its id
GET/deploymenttemplates/{Id}Returns a deployment template by its id
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.Deployment.Crud
Imports CoreService.ServiceModel.Dtos.Templates.Deployment.Responses
Imports CoreService.ServiceModel.Dtos.Base.Responses
Imports YCO.Dune.Models.Enums
Imports CoreService.ServiceModel.Enums
Imports CoreService.ServiceModel.Dtos.ResourceProviders.Responses
Imports CoreService.ServiceModel.Dtos.Templates.ResourceGroup.Responses

Namespace Global

    Namespace CoreService.ServiceModel.Dtos.Base.Responses

        Public Partial Class ConfigItemDto
            Implements IConfigItem
            Public Overridable Property Id As Guid
            Public Overridable Property Name As String
            Public Overridable Property DisplayName As String Implements IConfigItem.DisplayName
            Public Overridable Property Description As String Implements IConfigItem.Description
            Public Overridable Property ObjectType As ObjectTypes
            Public Overridable Property SelfLink As String Implements IConfigItem.SelfLink
            Public Overridable Property Tags As IList(Of TagDto) Implements IConfigItem.Tags
            Public Overridable Property Path As IList(Of PathItemDto)
            Public Overridable Property Created As Date
            Public Overridable Property CreateUser As String
            Public Overridable Property CreateUserId As String
            Public Overridable Property Modified As Date
            Public Overridable Property ModifyUser As String
            Public Overridable Property ModifyUserId As String
            Public Overridable Property IsDeleted As Boolean
            Public Overridable Property Deleted As Date?
            Public Overridable Property DeleteUser As String
            Public Overridable Property DeleteUserId As String
            Public Overridable Property Links As IList(Of LinkDto)
        End Class

        Public Partial Class LinkDto
            Public Overridable Property Caption As String
            Public Overridable Property Rel As String
            Public Overridable Property HRef As String
            Public Overridable Property Method As String
        End Class

        Public Partial Class ParameterDto
            Public Overridable Property Name As String
            Public Overridable Property Description As String
            '''<Summary>
            '''Value in form of a json string (e.g. Number = 1234, String = "foo", Boolean = false). Note: string values need extra quotes
            '''</Summary>
            Public Overridable Property Value As String
            '''<Summary>
            '''Optional default value for the frontend. Needs to be in the same format as the value
            '''</Summary>
            Public Overridable Property [Default] As String
            '''<Summary>
            '''Optional parameters do not need to have a value. Default -> Optional=false
            '''</Summary>
            Public Overridable Property [Optional] As Boolean
            '''<Summary>
            '''The data type of the value and default property
            '''</Summary>
            Public Overridable Property Type As ParameterValueType
            Public Overridable Property Validation As String
        End Class

        Public Partial Class PathItemDto
            Public Overridable Property Label As String
            Public Overridable Property Link As String
            Public Overridable Property ObjectType As ObjectTypes
            Public Overridable Property ObjectId As Guid
        End Class

        Public Partial Class TagDto
            Public Overridable Property Name As String
            Public Overridable Property Value As String
            Public Overridable Property IsProtected As Boolean
        End Class

        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.ResourceProviders.Responses

        Public Partial Class ProviderConfigEntryDto
            Public Overridable Property Name As String
            Public Overridable Property Value As String
            Public Overridable Property isSecure As Boolean
        End Class

        Public Partial Class ResourceProviderDto
            Inherits ConfigItemDto
            Implements IHasTenantId
            Public Overridable Property TenantId As Guid Implements IHasTenantId.TenantId
            '''<Summary>
            '''If environment cannot be detected while scanning, default environment will be used
            '''</Summary>
            Public Overridable Property DefaultEnvironment As Environments
            '''<Summary>
            '''List off all allowed environments for this resource provider
            '''</Summary>
            Public Overridable Property AllowedEnvironments As IList(Of Environments)
            '''<Summary>
            '''Defines the provider type (e.g. Azure, Aws)
            '''</Summary>
            Public Overridable Property Type As ResourceProviderTypes
            '''<Summary>
            '''Additional generic data which varies depending on ProviderType
            '''</Summary>
            Public Overridable Property Config As IList(Of ProviderConfigEntryDto)
            '''<Summary>
            '''Disabled ResourceProviders cannot be selected for new deployments
            '''</Summary>
            Public Overridable Property IsDisabled As Boolean
            '''<Summary>
            '''Shows if a ResourceProvider has been initialized and can accept deployments (resources)
            '''</Summary>
            Public Overridable Property IsReadyForDeployments As Boolean
            '''<Summary>
            '''The cost for the current month
            '''</Summary>
            Public Overridable Property CostCurrentMonth As Decimal
            '''<Summary>
            '''The cost for the last month
            '''</Summary>
            Public Overridable Property CostLastMonth As Decimal
            '''<Summary>
            '''The cost currency
            '''</Summary>
            Public Overridable Property CostCurrency As String
        End Class
    End Namespace

    Namespace CoreService.ServiceModel.Dtos.Templates.Deployment.Crud

        '''<Summary>
        '''Returns a deployment template by its id
        '''</Summary>
        <Api(Description:="Returns a deployment template by its id")>
        <ApiResponse(Description:="Success", IsDefaultResponse:=true, ResponseType:=GetType(DeploymentTemplateDto), StatusCode:=200)>
        Public Partial Class GetDeploymentTemplate
            Implements IGetSingleRequest
            Implements IHasTenantName
            Implements IGet
            <ApiMember(DataType:="string", Format:="guid", IsRequired:=true, ParameterType:="path")>
            Public Overridable Property Id As Guid

            <ApiMember(DataType:="string", IsRequired:=true, ParameterType:="header")>
            <Validate(Validator:="NotEmpty")>
            Public Overridable Property TenantName As String Implements IHasTenantName.TenantName

            '''<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 IGetSingleRequest.IncludeDeleted

            '''<Summary>
            '''If true, also include the json definition
            '''</Summary>
            <ApiMember(Description:="If true, also include the json definition", ParameterType:="query")>
            Public Overridable Property IncludeDefinition As Boolean?

            <ApiMember(ParameterType:="query", Verb:="GET")>
            Public Overridable Property IncludeReferencedObjects As Boolean? Implements IGetSingleRequest.IncludeReferencedObjects
        End Class
    End Namespace

    Namespace CoreService.ServiceModel.Dtos.Templates.Deployment.Responses

        Public Partial Class DeploymentTemplateDto
            Inherits ConfigItemDto
            Implements IHasTenantId
            Public Overridable Property TenantId As Guid Implements IHasTenantId.TenantId
            '''<Summary>
            '''The schema version of the attached definition (json/yaml structure)
            '''</Summary>
            Public Overridable Property SchemaVersion As Integer
            '''<Summary>
            '''The version of the template (changes with each change to the template)
            '''</Summary>
            Public Overridable Property Version As String
            '''<Summary>
            '''The version in a numeric (padded) form which can be used for sorting
            '''</Summary>
            Public Overridable Property VersionNumeric As Integer
            '''<Summary>
            '''The template definition as json/yaml
            '''</Summary>
            Public Overridable Property Definition As String
            '''<Summary>
            '''Template variables
            '''</Summary>
            Public Overridable Property Variables As IList(Of VariableDto)
            '''<Summary>
            '''Template parameters
            '''</Summary>
            Public Overridable Property Parameters As IList(Of ParameterDto)
            '''<Summary>
            '''Disabled templates should not be selected for deployments
            '''</Summary>
            Public Overridable Property IsDisabled As Boolean
            '''<Summary>
            '''The template with the highest version number has IsLatest set to true
            '''</Summary>
            Public Overridable Property IsLatest As Boolean
            '''<Summary>
            '''This template can be deployed only to the environments listed below
            '''</Summary>
            Public Overridable Property AllowedEnvironments As IList(Of Environments)
            '''<Summary>
            '''This template can be deployed only to the resource providers listed below
            '''</Summary>
            Public Overridable Property AllowedResourceProviders As IList(Of ResourceProviderDto)
            '''<Summary>
            '''An optional list of the child resource group templates
            '''</Summary>
            Public Overridable Property ResourceGroupTemplates As IList(Of ResourceGroupTemplateDto)
        End Class
    End Namespace

    Namespace CoreService.ServiceModel.Dtos.Templates.ResourceGroup.Responses

        Public Partial Class ResourceGroupTemplateDto
            Inherits ConfigItemDto
            Implements IHasTenantId
            Public Overridable Property TenantId As Guid Implements IHasTenantId.TenantId
            '''<Summary>
            '''The schema version of the attached definition (json/yaml structure)
            '''</Summary>
            Public Overridable Property SchemaVersion As Integer
            '''<Summary>
            '''The version of the template (changes with each change to the template)
            '''</Summary>
            Public Overridable Property Version As String
            '''<Summary>
            '''The version in a numeric (padded) form which can be used for sorting
            '''</Summary>
            Public Overridable Property VersionNumeric As Integer
            '''<Summary>
            '''The template definition/body either as json or yaml
            '''</Summary>
            Public Overridable Property Definition As String
            '''<Summary>
            '''Template variables
            '''</Summary>
            Public Overridable Property Variables As IList(Of VariableDto)
            '''<Summary>
            '''Template parameters
            '''</Summary>
            Public Overridable Property Parameters As IList(Of ParameterDto)
            '''<Summary>
            '''The template with the highest version number has IsLatest set to true
            '''</Summary>
            Public Overridable Property IsLatest As Boolean
            '''<Summary>
            '''List of contained resources
            '''</Summary>
            Public Overridable Property ResourceTemplates As IList(Of ResourceTemplateDto)
        End Class

        Public Partial Class ResourceTemplateDto
            Public Overridable Property Name As String
            Public Overridable Property DisplayName As String
            Public Overridable Property Description As String
            Public Overridable Property Type As ObjectTypes
        End Class
    End Namespace

    Namespace CoreService.ServiceModel.Enums

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

        Public Enum ParameterValueType
            [String]
            Number
            [Boolean]
            SecureString
        End Enum

        Public Enum ResourceProviderTypes
            Azure
            AmazonWebServices
            GoogleCloudPlatform
            ActiveDirectoryServices
            DomainNameSystem
            SwisscomESC
            AzureKeyVault
        End Enum

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

    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
        End Enum
    End Namespace
End Namespace

VB.NET 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

HTTP + JSON

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}