| Required role: | TenantReader |
| GET | /api/statistics/billableresources | Returns billable resource counts | |
|---|---|---|---|
| GET | /statistics/billableresources | Returns billable resource counts |
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
/**
* Returns billable resource counts
*/
@Api(Description="Returns billable resource counts")
@ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=BillableResourceSummaryDto.class, StatusCode=200)
public static class GetBillableResources implements IBaseRequest, IHasTenantName, IGet
{
@ApiMember(DataType="string", IsRequired=true, ParameterType="header")
@Validate(Validator="NotEmpty")
public String tenantName = null;
public String getTenantName() { return tenantName; }
public GetBillableResources setTenantName(String value) { this.tenantName = value; return this; }
}
public static class BillableResourceSummaryDto
{
public Date generatedOn = null;
public HashMap<String,BillableResourceDto> billableResources = new HashMap<String,BillableResourceDto>();
public Date getGeneratedOn() { return generatedOn; }
public BillableResourceSummaryDto setGeneratedOn(Date value) { this.generatedOn = value; return this; }
public HashMap<String,BillableResourceDto> getBillableResources() { return billableResources; }
public BillableResourceSummaryDto setBillableResources(HashMap<String,BillableResourceDto> value) { this.billableResources = value; return this; }
}
public static class BillableResourceDto
{
public ObjectTypes type = null;
public Long totalCount = null;
public Long billableCount = null;
public ArrayList<HeaderDto> billableResources = new ArrayList<HeaderDto>();
public ObjectTypes getType() { return type; }
public BillableResourceDto setType(ObjectTypes value) { this.type = value; return this; }
public Long getTotalCount() { return totalCount; }
public BillableResourceDto setTotalCount(Long value) { this.totalCount = value; return this; }
public Long getBillableCount() { return billableCount; }
public BillableResourceDto setBillableCount(Long value) { this.billableCount = value; return this; }
public ArrayList<HeaderDto> getBillableResources() { return billableResources; }
public BillableResourceDto setBillableResources(ArrayList<HeaderDto> value) { this.billableResources = value; return this; }
}
public static 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;
}
public static class HeaderDto implements IHasIdName, IHasObjectType
{
public UUID id = null;
public String name = null;
public String displayName = null;
public ObjectTypes objectType = null;
public UUID getId() { return id; }
public HeaderDto setId(UUID value) { this.id = value; return this; }
public String getName() { return name; }
public HeaderDto setName(String value) { this.name = value; return this; }
public String getDisplayName() { return displayName; }
public HeaderDto setDisplayName(String value) { this.displayName = value; return this; }
public ObjectTypes getObjectType() { return objectType; }
public HeaderDto setObjectType(ObjectTypes value) { this.objectType = value; return this; }
}
}
Java GetBillableResources 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.
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"}]}}}