| Required role: | TenantReader |
| GET | /api/tenants/variables | Gets the tenant's variables | |
|---|---|---|---|
| GET | /tenants/variables | Gets the tenant's variables |
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.Tenant.Crud;
using YCO.Dune.Models.Dtos.Common.Responses;
using CoreService.ServiceModel.Dtos.Base.Responses;
using CoreService.ServiceModel.Enums;
namespace CoreService.ServiceModel.Dtos.Base.Responses
{
public partial class VariableDto
{
public virtual string Name { get; set; }
///<summary>
///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
///</summary>
public virtual string Value { get; set; }
///<summary>
///The data type of the value property
///</summary>
public virtual ValueDataType Type { get; set; }
public virtual string? Description { get; set; }
public virtual bool IsInherited { get; set; }
public virtual Environments? Environment { get; set; }
}
}
namespace CoreService.ServiceModel.Dtos.Tenant.Crud
{
///<summary>
///Gets the tenant's variables
///</summary>
[Api(Description="Gets the tenant's variables")]
[ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(YCO.Dune.Models.Dtos.Common.Responses.ItemsResponse`1[[CoreService.ServiceModel.Dtos.Base.Responses.VariableDto, CoreService.ServiceModel, Version=0.15.14.0, Culture=neutral, PublicKeyToken=null]]), StatusCode=200)]
public partial class GetTenantVariables
: IBaseRequest, IHasTenantName, IGet
{
[ApiMember(DataType="string", IsRequired=true, ParameterType="header")]
[Validate("NotEmpty")]
public virtual string TenantName { get; set; }
}
}
namespace CoreService.ServiceModel.Enums
{
public enum Environments
{
Lab,
Poc,
Dev,
Test,
Int,
Uat,
Prod,
}
public enum ValueDataType
{
String,
Number,
Boolean,
List,
}
}
namespace YCO.Dune.Models.Dtos.Common.Responses
{
public partial class ItemsResponse<T>
{
public virtual IList<VariableDto> Items { get; set; }
public virtual int Offset { get; set; }
public virtual int Total { get; set; }
public virtual bool IsGrouped { get; set; }
public virtual ResponseStatus? ResponseStatus { get; set; }
public virtual Dictionary<string, string>? Meta { get; set; }
}
}
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/tenants/variables 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"}}