| Required role: | TenantReader |
| PATCH | /api/deployments/validation/name | Validate deployment name with the user defined part | |
|---|---|---|---|
| PATCH | /deployments/validation/name | Validate deployment name with the user defined part |
namespace CoreService.ServiceModel.Dtos.Deployments.Crud
open System
open System.IO
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
type Severity =
| Error = 0
| Warning = 1
| Info = 2
[<AllowNullLiteral>]
type ValidationFailure() =
member val PropertyName:String = null with get,set
member val ErrorMessage:String = null with get,set
member val AttemptedValue:Object = null with get,set
member val CustomState:Object = null with get,set
member val Severity:Severity = new Severity() with get,set
member val FormattedMessageArguments:Object[] = null with get,set
member val FormattedMessagePlaceholderValues:Dictionary<String, Object> = null with get,set
member val ErrorCode:String = null with get,set
[<AllowNullLiteral>]
type IResponse =
abstract OriginalResponse:Object with get,set
abstract Request:IRequest with get,set
abstract StatusCode:Int32 with get,set
abstract StatusDescription:String with get,set
abstract ContentType:String with get,set
abstract OutputStream:Stream with get,set
abstract Dto:Object with get,set
abstract UseBufferedStream:Boolean with get,set
abstract IsClosed:Boolean with get,set
abstract KeepAlive:Boolean with get,set
abstract HasStarted:Boolean with get,set
abstract Items:Dictionary<String, Object> with get,set
[<Flags>]
type 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
[<AllowNullLiteral>]
type IRequestPreferences =
abstract AcceptsBrotli:Boolean with get,set
abstract AcceptsDeflate:Boolean with get,set
abstract AcceptsGzip:Boolean with get,set
[<AllowNullLiteral>]
type IHttpFile =
abstract Name:String with get,set
abstract FileName:String with get,set
abstract ContentLength:Int64 with get,set
abstract ContentType:String with get,set
abstract InputStream:Stream with get,set
[<AllowNullLiteral>]
type IRequest =
abstract OriginalRequest:Object with get,set
abstract Response:IResponse with get,set
abstract OperationName:String with get,set
abstract Verb:String with get,set
abstract RequestAttributes:RequestAttributes with get,set
abstract RequestPreferences:IRequestPreferences with get,set
abstract Dto:Object with get,set
abstract ContentType:String with get,set
abstract IsLocal:Boolean with get,set
abstract UserAgent:String with get,set
abstract Cookies:IDictionary<String, Cookie> with get,set
abstract ResponseContentType:String with get,set
abstract HasExplicitResponseContentType:Boolean with get,set
abstract Items:Dictionary<String, Object> with get,set
abstract Headers:NameValueCollection with get,set
abstract QueryString:NameValueCollection with get,set
abstract FormData:NameValueCollection with get,set
abstract UseBufferedStream:Boolean with get,set
abstract RawUrl:String with get,set
abstract AbsoluteUri:String with get,set
abstract UserHostAddress:String with get,set
abstract RemoteIp:String with get,set
abstract Authorization:String with get,set
abstract IsSecureConnection:Boolean with get,set
abstract AcceptTypes:String[] with get,set
abstract PathInfo:String with get,set
abstract OriginalPathInfo:String with get,set
abstract InputStream:Stream with get,set
abstract ContentLength:Int64 with get,set
abstract Files:IHttpFile[] with get,set
abstract UrlReferrer:Uri with get,set
[<AllowNullLiteral>]
type ValidationResult() =
member val IsValid:Boolean = new Boolean() with get,set
member val Errors:IList<ValidationFailure> = null with get,set
member val RuleSetsExecuted:String[] = null with get,set
member val Request:IRequest = null with get,set
type Environments =
| Lab = 0
| Poc = 1
| Dev = 2
| Test = 3
| Int = 4
| Uat = 5
| Prod = 6
///<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=typeof<ValidationResult>, StatusCode=200)>]
[<AllowNullLiteral>]
type ValidateDeploymentName() =
interface IPatch
[<ApiMember(DataType="string", IsRequired=true, ParameterType="header")>]
[<Validate(Validator="NotEmpty")>]
member val TenantName:String = null with get,set
///<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]+)$′)")>]
member val Name:String = null with get,set
///<summary>
///What kind of environment is this deployment
///</summary>
[<ApiMember(Description="What kind of environment is this deployment", IsRequired=true, ParameterType="body")>]
member val Environment:Environments = new Environments() with get,set
F# 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
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}