| Required role: | TenantReader |
| GET | /api/statistics/billableresources | Returns billable resource counts | |
|---|---|---|---|
| GET | /statistics/billableresources | Returns billable resource counts |
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.Statistics.Crud;
using CoreService.ServiceModel.Dtos.Statistics.Responses;
using YCO.Dune.Models.Enums;
using CoreService.ServiceModel.Dtos.Base.Responses;
namespace CoreService.ServiceModel.Dtos.Base.Responses
{
public partial class HeaderDto
: IHasIdName, IHasObjectType
{
public virtual Guid Id { get; set; }
public virtual string Name { get; set; }
public virtual string DisplayName { get; set; }
public virtual ObjectTypes ObjectType { get; set; }
}
}
namespace CoreService.ServiceModel.Dtos.Statistics.Crud
{
///<summary>
///Returns billable resource counts
///</summary>
[Api(Description="Returns billable resource counts")]
[ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(CoreService.ServiceModel.Dtos.Statistics.Responses.BillableResourceSummaryDto), StatusCode=200)]
public partial class GetBillableResources
: IBaseRequest, IHasTenantName, IGet
{
[ApiMember(DataType="string", IsRequired=true, ParameterType="header")]
[Validate("NotEmpty")]
public virtual string TenantName { get; set; }
}
}
namespace CoreService.ServiceModel.Dtos.Statistics.Responses
{
public partial class BillableResourceDto
{
public virtual ObjectTypes Type { get; set; }
public virtual long TotalCount { get; set; }
public virtual long BillableCount { get; set; }
public virtual List<HeaderDto> BillableResources { get; set; } = [];
}
public partial class BillableResourceSummaryDto
{
public virtual DateTime GeneratedOn { get; set; }
public virtual Dictionary<string, BillableResourceDto> BillableResources { get; set; } = new();
}
}
namespace YCO.Dune.Models.Enums
{
public enum ObjectTypes
{
None,
ConfigItem,
Tenant,
Collection,
Resource,
ComputeNode,
VirtualMachine,
PhysicalMachine,
Disk,
Subnet,
IPAddress,
Job,
JobEvent,
FreezePeriod,
ResourceGroup,
Deployment,
ResourceGroupTemplate,
DeploymentTemplate,
ResourceProvider,
GenericResource,
Role,
Permission,
User,
PatchingWindow,
Update,
ReportDefinition,
TimeSeries,
DataPoint,
Action,
ActionAssignment,
UserNote,
}
}
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/statistics/billableresources HTTP/1.1 Host: core.starburst.svc Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"generatedOn":"0001-01-01T00:00:00.0000000Z","billableResources":{"String":{"type":"None","totalCount":0,"billableCount":0,"billableResources":[{"id":"00000000-0000-0000-0000-000000000000","name":"String","displayName":"String","objectType":"None"}]}}}