CoreService

<back to all web services

GetDeploymentTemplateDefinition

DeploymentTemplate - CRUD

Returns the template definition

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
GET/api/deploymenttemplates/{Id}/definitionReturns the template definition
GET/api/deploymenttemplates/{Name}/{Version}/definitionReturns the template definition
GET/deploymenttemplates/{Id}/definitionReturns the template definition
GET/deploymenttemplates/{Name}/{Version}/definitionReturns the template definition
import Foundation
import ServiceStack

/**
* Returns the template definition
*/
// @Api(Description="Returns the template definition")
// @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(TemplateDefinitionDto), StatusCode=200)
public class GetDeploymentTemplateDefinition : IGetSingleRequest, IHasTenantName, IGet, Codable
{
    // @ApiMember(DataType="string", Format="guid", ParameterType="path")
    public var id:String?

    // @ApiMember(DataType="string", ParameterType="path")
    public var name:String

    // @ApiMember(DataType="string", ParameterType="path")
    public var version:String

    // @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
    // @Validate(Validator="NotEmpty")
    public var tenantName:String

    // @ApiMember(IsRequired=true, ParameterType="query")
    public var definitionFormat:TemplateLanguages

    /**
    * If true, also soft deleted items will be returned
    */
    // @ApiMember(Description="If true, also soft deleted items will be returned", ParameterType="query")
    public var includeDeleted:Bool?

    // @ApiMember(ParameterType="query", Verb="GET")
    public var includeReferencedObjects:Bool?

    required public init(){}
}

public enum TemplateLanguages : String, Codable
{
    case Json
    case Yaml
}

public class TemplateDefinitionDto : Codable
{
    /**
    * The schema version of the attached definition
    */
    public var schemaVersion:Int
    /**
    * The template definition/body either as json or yaml
    */
    public var definition:String

    required public init(){}
}


Swift GetDeploymentTemplateDefinition 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}/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"}