CoreService

<back to all web services

GenerateDeploymentName

Deployment - CRUD

Generate deployment name with the user defined part

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
PATCH/api/deployments/generation/nameGenerate deployment name with the user defined part
PATCH/deployments/generation/nameGenerate deployment name with the user defined part
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')


class Environments(str, Enum):
    LAB = 'Lab'
    POC = 'Poc'
    DEV = 'Dev'
    TEST = 'Test'
    INT_ = 'Int'
    UAT = 'Uat'
    PROD = 'Prod'


# @Api(Description="Generate deployment name with the user defined part")
# @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(String), StatusCode=200)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GenerateDeploymentName(IBaseRequest, IHasTenantName, IPatch):
    """
    Generate deployment name with the user defined part
    """

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

    # @ApiMember(DataType="string", Description="User defined/custom part of the name", IsRequired=true, ParameterType="body")
    # @Validate(Validator="NotEmpty")
    # @Validate(Validator="MaximumLength(100)")
    # @Validate(Validator="RegularExpression(′^[0-9a-z]+[0-9a-z-]*[0-9a-z]+$′)")
    user_defined_part: Optional[str] = None
    """
    User defined/custom part of the name
    """


    # @ApiMember(Description="What kind of environment is this deployment", IsRequired=true, ParameterType="body")
    environment: Optional[Environments] = None
    """
    What kind of environment is this deployment
    """

Python GenerateDeploymentName 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.

PATCH /api/deployments/generation/name HTTP/1.1 
Host: core.starburst.svc 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"tenantName":"String","userDefinedPart":"String","environment":"Lab","txId":"00000000-0000-0000-0000-000000000000"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

(string)