| Required role: | TenantReader |
| All Verbs | /api/resourceproviders/{Id}/cost | ||
|---|---|---|---|
| All Verbs | /resourceproviders/{Id}/cost |
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.ResourceProviders.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.ResourceProviders.Crud
{
///<summary>
///Get resourceprovider cost
///</summary>
[Api(Description="Get resourceprovider cost")]
[ApiResponse(Description="Success", IsDefaultResponse=true, StatusCode=204)]
public partial class GetResourceProviderCost
: IBaseRequest, IGet, IHasId, IHasTenantName
{
///<summary>
///The unique id of the resourceprovider
///</summary>
[ApiMember(DataType="string", Description="The unique id of the resourceprovider", Format="guid", IsRequired=true, ParameterType="path")]
public virtual Guid Id { get; set; }
[ApiMember(DataType="string", IsRequired=true, ParameterType="header")]
[Validate("NotEmpty")]
public virtual string TenantName { get; set; }
///<summary>
///By default only the current months cost are returned. Specify how many previous months should be included
///</summary>
[ApiMember(DataType="int", Description="By default only the current months cost are returned. Specify how many previous months should be included", IsRequired=true, ParameterType="query")]
[Validate("InclusiveBetween(0,14)")]
public virtual int IncludePreviousMonths { 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; }
}
}
C# GetResourceProviderCost 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.
POST /api/resourceproviders/{Id}/cost HTTP/1.1
Host: core.starburst.svc
Accept: application/json
Content-Type: application/json
Content-Length: length
{"id":"00000000-0000-0000-0000-000000000000","tenantName":"String","includePreviousMonths":0,"txId":"00000000-0000-0000-0000-000000000000"}
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"}}