| 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 |
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
/**
* 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)
public static class ValidateDeploymentName implements IBaseRequest, IHasTenantName, IPatch
{
@ApiMember(DataType="string", IsRequired=true, ParameterType="header")
@Validate(Validator="NotEmpty")
public String tenantName = 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]+)$′)")
public String name = null;
/**
* What kind of environment is this deployment
*/
@ApiMember(Description="What kind of environment is this deployment", IsRequired=true, ParameterType="body")
public Environments environment = null;
public String getTenantName() { return tenantName; }
public ValidateDeploymentName setTenantName(String value) { this.tenantName = value; return this; }
public String getName() { return name; }
public ValidateDeploymentName setName(String value) { this.name = value; return this; }
public Environments getEnvironment() { return environment; }
public ValidateDeploymentName setEnvironment(Environments value) { this.environment = value; return this; }
}
public static enum Environments
{
Lab,
Poc,
Dev,
Test,
Int,
Uat,
Prod;
}
public static class ValidationResult
{
public Boolean isValid = null;
public IList<ValidationFailure> errors = null;
public ArrayList<String> ruleSetsExecuted = null;
public IRequest request = null;
public Boolean getIsValid() { return isValid; }
public ValidationResult setIsValid(Boolean value) { this.isValid = value; return this; }
public IList<ValidationFailure> getErrors() { return errors; }
public ValidationResult setErrors(IList<ValidationFailure> value) { this.errors = value; return this; }
public ArrayList<String> getRuleSetsExecuted() { return ruleSetsExecuted; }
public ValidationResult setRuleSetsExecuted(ArrayList<String> value) { this.ruleSetsExecuted = value; return this; }
public IRequest getRequest() { return request; }
public ValidationResult setRequest(IRequest value) { this.request = value; return this; }
}
public static class ValidationFailure
{
public String propertyName = null;
public String errorMessage = null;
public Object attemptedValue = null;
public Object customState = null;
public Severity severity = null;
public ArrayList<Object> formattedMessageArguments = null;
public HashMap<String,Object> formattedMessagePlaceholderValues = null;
public String errorCode = null;
public String getPropertyName() { return propertyName; }
public ValidationFailure setPropertyName(String value) { this.propertyName = value; return this; }
public String getErrorMessage() { return errorMessage; }
public ValidationFailure setErrorMessage(String value) { this.errorMessage = value; return this; }
public Object getAttemptedValue() { return attemptedValue; }
public ValidationFailure setAttemptedValue(Object value) { this.attemptedValue = value; return this; }
public Object getCustomState() { return customState; }
public ValidationFailure setCustomState(Object value) { this.customState = value; return this; }
public Severity getSeverity() { return severity; }
public ValidationFailure setSeverity(Severity value) { this.severity = value; return this; }
public ArrayList<Object> getFormattedMessageArguments() { return formattedMessageArguments; }
public ValidationFailure setFormattedMessageArguments(ArrayList<Object> value) { this.formattedMessageArguments = value; return this; }
public HashMap<String,Object> getFormattedMessagePlaceholderValues() { return formattedMessagePlaceholderValues; }
public ValidationFailure setFormattedMessagePlaceholderValues(HashMap<String,Object> value) { this.formattedMessagePlaceholderValues = value; return this; }
public String getErrorCode() { return errorCode; }
public ValidationFailure setErrorCode(String value) { this.errorCode = value; return this; }
}
public static enum Severity
{
Error,
Warning,
Info;
}
public static interface IRequest
{
public Object originalRequest = null;
public IResponse response = null;
public String operationName = null;
public String verb = null;
public RequestAttributes requestAttributes = null;
public IRequestPreferences requestPreferences = null;
public Object dto = null;
public String contentType = null;
public Boolean isLocal = null;
public String userAgent = null;
public HashMap<String,Cookie> cookies = null;
public String responseContentType = null;
public Boolean hasExplicitResponseContentType = null;
public HashMap<String,Object> items = null;
public NameValueCollection headers = null;
public NameValueCollection queryString = null;
public NameValueCollection formData = null;
public Boolean useBufferedStream = null;
public String rawUrl = null;
public String absoluteUri = null;
public String userHostAddress = null;
public String remoteIp = null;
public String authorization = null;
public Boolean isSecureConnection = null;
public ArrayList<String> acceptTypes = null;
public String pathInfo = null;
public String originalPathInfo = null;
public InputStream inputStream = null;
public Long contentLength = null;
public ArrayList<IHttpFile> files = null;
public Uri urlReferrer = null;
}
public static interface IResponse
{
public Object originalResponse = null;
public IRequest request = null;
public Integer statusCode = null;
public String statusDescription = null;
public String contentType = null;
public InputStream outputStream = null;
public Object dto = null;
public Boolean useBufferedStream = null;
public Boolean isClosed = null;
public Boolean keepAlive = null;
public Boolean hasStarted = null;
public HashMap<String,Object> items = null;
}
@Flags()
public static enum RequestAttributes
{
@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);
private final int value;
RequestAttributes(final int intValue) { value = intValue; }
public int getValue() { return value; }
}
public static interface IRequestPreferences
{
public Boolean acceptsBrotli = null;
public Boolean acceptsDeflate = null;
public Boolean acceptsGzip = null;
}
public static interface IHttpFile
{
public String name = null;
public String fileName = null;
public Long contentLength = null;
public String contentType = null;
public InputStream inputStream = null;
}
}
Java 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}