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
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*


/**
* Validate deployment name with the user defined part
*/
@Api(Description="Validate deployment name with the user defined part")
@ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=ValidationResult::class, StatusCode=200)
open class ValidateDeploymentName : IBaseRequest, IHasTenantName, IPatch
{
    @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
    @Validate(Validator="NotEmpty")
    override var tenantName:String? = null

    /**
    * The full name in the form of '{userdefined}_{environment}'
    */
    @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]+)$′)")
    open var name:String? = null

    /**
    * What kind of environment is this deployment
    */
    @ApiMember(Description="What kind of environment is this deployment", IsRequired=true, ParameterType="body")
    open var environment:Environments? = null
}

enum class Environments
{
    Lab,
    Poc,
    Dev,
    Test,
    Int,
    Uat,
    Prod,
}

open class ValidationResult
{
    open var isValid:Boolean? = null
    open var errors:IList<ValidationFailure>? = null
    open var ruleSetsExecuted:ArrayList<String>? = null
    open var request:IRequest? = null
}

open class ValidationFailure
{
    open var propertyName:String? = null
    open var errorMessage:String? = null
    open var attemptedValue:Object? = null
    open var customState:Object? = null
    open var severity:Severity? = null
    open var formattedMessageArguments:ArrayList<Object>? = null
    open var formattedMessagePlaceholderValues:HashMap<String,Object>? = null
    open var errorCode:String? = null
}

enum class Severity
{
    Error,
    Warning,
    Info,
}

interface IRequest
{
    var originalRequest:Object?
    var response:IResponse?
    var operationName:String?
    var verb:String?
    var requestAttributes:RequestAttributes?
    var requestPreferences:IRequestPreferences?
    var dto:Object?
    var contentType:String?
    var isLocal:Boolean?
    var userAgent:String?
    var cookies:HashMap<String,Cookie>?
    var responseContentType:String?
    var hasExplicitResponseContentType:Boolean?
    var items:HashMap<String,Object>?
    var headers:NameValueCollection?
    var queryString:NameValueCollection?
    var formData:NameValueCollection?
    var useBufferedStream:Boolean?
    var rawUrl:String?
    var absoluteUri:String?
    var userHostAddress:String?
    var remoteIp:String?
    var authorization:String?
    var isSecureConnection:Boolean?
    var acceptTypes:ArrayList<String>?
    var pathInfo:String?
    var originalPathInfo:String?
    var inputStream:InputStream?
    var contentLength:Long?
    var files:ArrayList<IHttpFile>?
    var urlReferrer:Uri?
}

interface IResponse
{
    var originalResponse:Object?
    var request:IRequest?
    var statusCode:Int?
    var statusDescription:String?
    var contentType:String?
    var outputStream:InputStream?
    var dto:Object?
    var useBufferedStream:Boolean?
    var isClosed:Boolean?
    var keepAlive:Boolean?
    var hasStarted:Boolean?
    var items:HashMap<String,Object>?
}

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

interface IRequestPreferences
{
    var acceptsBrotli:Boolean?
    var acceptsDeflate:Boolean?
    var acceptsGzip:Boolean?
}

interface IHttpFile
{
    var name:String?
    var fileName:String?
    var contentLength:Long?
    var contentType:String?
    var inputStream:InputStream?
}

Kotlin 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}