| Required role: | TenantReader | Requires the role: | Workflow |
| GET | /api/resourceaddons/hostnames | Returns a list of hostnames for one time use (the pool will never return already obtained hostnames) | |
|---|---|---|---|
| GET | /resourceaddons/hostnames | Returns a list of hostnames for one time use (the pool will never return already obtained hostnames) |
import Foundation
import ServiceStack
/**
* Returns a list of hostnames
*/
// @Api(Description="Returns a list of hostnames")
// @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]), StatusCode=200)
public class GetHostNames : IBaseRequest, IHasTenantName, IGet, Codable
{
// @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
// @Validate(Validator="NotEmpty")
public var tenantName:String
/**
* If set, hostnames will be created using it
*/
// @ApiMember(DataType="string", Description="If set, hostnames will be created using it", ParameterType="query")
// @Validate(Validator="MaximumLength(2)")
public var `prefix`:String
/**
* Defines how long the hostname will be including the prefix
*/
// @ApiMember(DataType="int", Description="Defines how long the hostname will be including the prefix", ParameterType="query")
// @Validate(Validator="ExclusiveBetween(7,17)")
public var length:Int?
/**
* The number of hostnames to be returned
*/
// @ApiMember(DataType="int", Description="The number of hostnames to be returned", IsRequired=true)
// @Validate(Validator="GreaterThanOrEqual(1)")
public var count:Int
required public init(){}
}
public class ItemsResponse<T : Codable> : Codable
{
public var items:IList<VariableDto>
public var offset:Int
public var total:Int
public var isGrouped:Bool
public var responseStatus:ResponseStatus
public var meta:[String:String]
required public init(){}
}
public class VariableDto : Codable
{
public var name:String
/**
* Value in form of a json string (e.g. Number = 1234, String = "foo", Boolean = false, List = [1,2,3,4]). Note: string values need extra quotes
*/
public var value:String
/**
* The data type of the value property
*/
public var type:ValueDataType
public var Description:String
public var isInherited:Bool
public var environment:Environments?
required public init(){}
}
public enum ValueDataType : String, Codable
{
case String
case Number
case Boolean
case List
}
public enum Environments : String, Codable
{
case Lab
case Poc
case Dev
case Test
case Int
case Uat
case Prod
}
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.
GET /api/resourceaddons/hostnames HTTP/1.1 Host: core.starburst.svc Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"items":null,"offset":0,"total":0,"isGrouped":false,"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}},"meta":{"String":"String"}}