CoreService

<back to all web services

ValidateDeploymentName

Deployment - CRUD

Validate deployment name with the user defined part

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
PATCH/api/deployments/validation/nameValidate deployment name with the user defined part
PATCH/deployments/validation/nameValidate deployment name with the user defined part
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.Deployments.Crud
Imports CoreService.ServiceModel.Enums
Imports ServiceStack.FluentValidation.Results
Imports ServiceStack.FluentValidation
Imports ServiceStack.Web

Namespace Global

    Namespace CoreService.ServiceModel.Dtos.Deployments.Crud

        '''<Summary>
        '''Validate deployment name with the user defined part
        '''</Summary>
        <Api(Description:="Validate deployment name with the user defined part")>
        <ApiResponse(Description:="Success", IsDefaultResponse:=true, ResponseType:=GetType(ValidationResult), StatusCode:=200)>
        Public Partial Class ValidateDeploymentName
            Implements IBaseRequest
            Implements IHasTenantName
            Implements IPatch
            <ApiMember(DataType:="string", IsRequired:=true, ParameterType:="header")>
            <Validate(Validator:="NotEmpty")>
            Public Overridable Property TenantName As String Implements IHasTenantName.TenantName

            '''<Summary>
            '''The full name in the form of '{userdefined}_{environment}'
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The full name in the form of '{userdefined}_{environment}'", IsRequired:=true, ParameterType:="body")>
            <Validate(Validator:="NotEmpty")>
            <Validate(Validator:="MaximumLength(100)")>
            <Validate(Validator:="RegularExpression(′^([0-9a-z]+[0-9a-z-]*[0-9a-z]+)_([a-z]+)$′)")>
            Public Overridable Property Name As String

            '''<Summary>
            '''What kind of environment is this deployment
            '''</Summary>
            <ApiMember(Description:="What kind of environment is this deployment", IsRequired:=true, ParameterType:="body")>
            Public Overridable Property Environment As Environments
        End Class
    End Namespace

    Namespace CoreService.ServiceModel.Enums

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

    Namespace ServiceStack

        <Flags>
        Public Enum RequestAttributes
            None = 0
            Localhost = 1
            LocalSubnet = 2
            External = 4
            Secure = 8
            InSecure = 16
            AnySecurityMode = 24
            HttpHead = 32
            HttpGet = 64
            HttpPost = 128
            HttpPut = 256
            HttpDelete = 512
            HttpPatch = 1024
            HttpOptions = 2048
            HttpOther = 4096
            AnyHttpMethod = 8160
            OneWay = 8192
            Reply = 16384
            AnyCallStyle = 24576
            Soap11 = 32768
            Soap12 = 65536
            Xml = 131072
            Json = 262144
            Jsv = 524288
            ProtoBuf = 1048576
            Csv = 2097152
            Html = 4194304
            Jsonl = 8388608
            MsgPack = 16777216
            FormatOther = 33554432
            AnyFormat = 67076096
            Http = 67108864
            MessageQueue = 134217728
            Tcp = 268435456
            Grpc = 536870912
            EndpointOther = 1073741824
            AnyEndpoint = 2080374784
            InProcess = -2147483648
            InternalNetworkAccess = -2147483645
            AnyNetworkAccessType = -2147483641
            Any = -1
        End Enum
    End Namespace

    Namespace ServiceStack.FluentValidation

        Public Enum Severity
            [Error]
            Warning
            Info
        End Enum
    End Namespace

    Namespace ServiceStack.FluentValidation.Results

        Public Partial Class ValidationFailure
            Public Overridable Property PropertyName As String
            Public Overridable Property ErrorMessage As String
            Public Overridable Property AttemptedValue As Object
            Public Overridable Property CustomState As Object
            Public Overridable Property Severity As Severity
            Public Overridable Property FormattedMessageArguments As Object()
            Public Overridable Property FormattedMessagePlaceholderValues As Dictionary(Of String, Object)
            Public Overridable Property ErrorCode As String
        End Class

        Public Partial Class ValidationResult
            Public Overridable Property IsValid As Boolean
            Public Overridable Property Errors As IList(Of ValidationFailure)
            Public Overridable Property RuleSetsExecuted As String()
            Public Overridable Property Request As IRequest
        End Class
    End Namespace

    Namespace ServiceStack.Web

        Public Interface IHttpFile
            Property Name As String
            Property FileName As String
            Property ContentLength As Long
            Property ContentType As String
            Property InputStream As Stream
        End Interface

        Public Interface IRequest
            Property OriginalRequest As Object
            Property Response As IResponse
            Property OperationName As String
            Property Verb As String
            Property RequestAttributes As RequestAttributes
            Property RequestPreferences As IRequestPreferences
            Property Dto As Object
            Property ContentType As String
            Property IsLocal As Boolean
            Property UserAgent As String
            Property Cookies As IDictionary(Of String, Cookie)
            Property ResponseContentType As String
            Property HasExplicitResponseContentType As Boolean
            Property Items As Dictionary(Of String, Object)
            Property Headers As NameValueCollection
            Property QueryString As NameValueCollection
            Property FormData As NameValueCollection
            Property UseBufferedStream As Boolean
            Property RawUrl As String
            Property AbsoluteUri As String
            Property UserHostAddress As String
            Property RemoteIp As String
            Property Authorization As String
            Property IsSecureConnection As Boolean
            Property AcceptTypes As String()
            Property PathInfo As String
            Property OriginalPathInfo As String
            Property InputStream As Stream
            Property ContentLength As Long
            Property Files As IHttpFile()
            Property UrlReferrer As Uri
        End Interface

        Public Interface IRequestPreferences
            Property AcceptsBrotli As Boolean
            Property AcceptsDeflate As Boolean
            Property AcceptsGzip As Boolean
        End Interface

        Public Interface IResponse
            Property OriginalResponse As Object
            Property Request As IRequest
            Property StatusCode As Integer
            Property StatusDescription As String
            Property ContentType As String
            Property OutputStream As Stream
            Property Dto As Object
            Property UseBufferedStream As Boolean
            Property IsClosed As Boolean
            Property KeepAlive As Boolean
            Property HasStarted As Boolean
            Property Items As Dictionary(Of String, Object)
        End Interface
    End Namespace
End Namespace

VB.NET ValidateDeploymentName 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/validation/name HTTP/1.1 
Host: core.starburst.svc 
Accept: application/json
Content-Type: application/json
Content-Length: length

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

{"isValid":true,"errors":[],"ruleSetsExecuted":["String"],"request":null}