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
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using CoreService.ServiceModel.Dtos.Deployments.Crud;
using CoreService.ServiceModel.Enums;

namespace CoreService.ServiceModel.Dtos.Deployments.Crud
{
    ///<summary>
    ///Generate deployment name with the user defined part
    ///</summary>
    [Api(Description="Generate deployment name with the user defined part")]
    [ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(System.String), StatusCode=200)]
    public partial class GenerateDeploymentName
        : IBaseRequest, IHasTenantName, IPatch
    {
        [ApiMember(DataType="string", IsRequired=true, ParameterType="header")]
        [Validate("NotEmpty")]
        public virtual string TenantName { get; set; }

        ///<summary>
        ///User defined/custom part of the name
        ///</summary>
        [ApiMember(DataType="string", Description="User defined/custom part of the name", IsRequired=true, ParameterType="body")]
        [Validate("NotEmpty")]
        [Validate("MaximumLength(100)")]
        [Validate("RegularExpression(′^[0-9a-z]+[0-9a-z-]*[0-9a-z]+$′)")]
        public virtual string UserDefinedPart { get; set; }

        ///<summary>
        ///What kind of environment is this deployment
        ///</summary>
        [ApiMember(Description="What kind of environment is this deployment", IsRequired=true, ParameterType="body")]
        public virtual Environments Environment { get; set; }
    }

}

namespace CoreService.ServiceModel.Enums
{
    public enum Environments
    {
        Lab,
        Poc,
        Dev,
        Test,
        Int,
        Uat,
        Prod,
    }

}

C# 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)