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 datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
Object = TypeVar('Object')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TemplateDefinitionDto:
    schema_version: int = 0
    """
    The schema version of the attached definition
    """

    definition: Optional[str] = None
    """
    The template definition/body either as json or yaml
    """


class TemplateLanguages(str, Enum):
    JSON = 'Json'
    YAML = 'Yaml'


# @Api(Description="Returns the template definition")
# @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(TemplateDefinitionDto), StatusCode=200)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetDeploymentTemplateDefinition(IGetSingleRequest, IHasTenantName, IGet):
    """
    Returns the template definition
    """

    # @ApiMember(DataType="string", Format="guid", ParameterType="path")
    id: Optional[str] = None

    # @ApiMember(DataType="string", ParameterType="path")
    name: Optional[str] = None

    # @ApiMember(DataType="string", ParameterType="path")
    version: Optional[str] = None

    # @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
    # @Validate(Validator="NotEmpty")
    tenant_name: Optional[str] = None

    # @ApiMember(IsRequired=true, ParameterType="query")
    definition_format: Optional[TemplateLanguages] = None

    # @ApiMember(Description="If true, also soft deleted items will be returned", ParameterType="query")
    include_deleted: Optional[bool] = None
    """
    If true, also soft deleted items will be returned
    """


    # @ApiMember(ParameterType="query", Verb="GET")
    include_referenced_objects: Optional[bool] = None

Python 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"}