billing

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAll

func RegisterAll(server *mcp.Server, client *sdk.APIClient, focusSpec string)

RegisterAll registers all billing tools with the MCP server. focusSpec is the embedded FOCUS v1.3 markdown, passed from the main package.

func RegisterEvnTools

func RegisterEvnTools(server *mcp.Server, client *sdk.APIClient)

func RegisterFocusTools

func RegisterFocusTools(server *mcp.Server, focusSpec string)

RegisterFocusTools registers get_billing_focus_spec for clients that don't support resources/read.

func RegisterInvoiceTools

func RegisterInvoiceTools(server *mcp.Server, client *sdk.APIClient)

func RegisterProductTools

func RegisterProductTools(server *mcp.Server, client *sdk.APIClient)

func RegisterProfileTools

func RegisterProfileTools(server *mcp.Server, client *sdk.APIClient)

func RegisterTrafficTools

func RegisterTrafficTools(server *mcp.Server, client *sdk.APIClient)

func RegisterUsageTools

func RegisterUsageTools(server *mcp.Server, client *sdk.APIClient)

func RegisterUtilizationTools

func RegisterUtilizationTools(server *mcp.Server, client *sdk.APIClient)

Types

type CompactOptions

type CompactOptions struct {
	IncludeZero  bool     // include meters with quantity == 0 (default false)
	GroupBy      string   // "" | "meter" | "datacenter" — utilization only
	DatacenterID *string  // scope to a single datacenter (utilization + list_billing_usage)
	MeterTypes   []string // filter by meter type (utilization only)
	Regions      []string // filter by region (utilization only)
	TopN         *int32   // when set, return a flat top-N list across datacenters instead of nested data (utilization only)
}

CompactOptions controls how the raw SDK utilization/usage response is reduced.

type CompactUsageDC

type CompactUsageDC struct {
	ID       string              `json:"id,omitempty"`
	Name     string              `json:"name,omitempty"`
	Location string              `json:"location,omitempty"`
	Meters   []CompactUsageMeter `json:"meters"`
}

type CompactUsageMeter

type CompactUsageMeter struct {
	MeterID  string `json:"meter_id,omitempty"`
	Quantity string `json:"quantity,omitempty"` // string per SDK — preserves precision
	Unit     string `json:"unit,omitempty"`
}

type CompactUsageResponse

type CompactUsageResponse struct {
	StartDate        string            `json:"start_date,omitempty"`
	EndDate          string            `json:"end_date,omitempty"`
	ContractID       string            `json:"contract_id,omitempty"`
	MeterDefinitions map[string]string `json:"meter_definitions,omitempty"`
	Datacenters      []CompactUsageDC  `json:"datacenters,omitempty"`
}

CompactUsageResponse is the compacted shape for usage endpoints. UsageMeter carries fewer fields than UtilizationMeter (no type/region/resource_id/server_id/name), so the shape is correspondingly leaner.

func CompactUsageGet

CompactUsageGet projects a UsageGet200Response into the compact shape. UsageMeter has fewer fields than UtilizationMeter — only meter_id, quantity, unit, desc. Filters that don't apply (MeterTypes, Regions, GroupBy) are ignored.

type CompactUtilDC

type CompactUtilDC struct {
	ID     string             `json:"id,omitempty"`
	Name   string             `json:"name,omitempty"`
	Meters []CompactUtilMeter `json:"meters"`
}

type CompactUtilMeter

type CompactUtilMeter struct {
	MeterID    string  `json:"meter_id,omitempty"`
	Type       string  `json:"type,omitempty"`
	Region     string  `json:"region,omitempty"`
	ResourceID string  `json:"resource_id,omitempty"`
	ServerID   string  `json:"server_id,omitempty"`
	Name       string  `json:"name,omitempty"`
	Quantity   float64 `json:"quantity"`
	Unit       string  `json:"unit,omitempty"`
}

type CompactUtilMeterWithDC

type CompactUtilMeterWithDC struct {
	DCID   string `json:"dc_id,omitempty"`
	DCName string `json:"dc_name,omitempty"`
	CompactUtilMeter
}

CompactUtilMeterWithDC is a flattened meter row carrying its datacenter context. Used only in TopN mode.

type CompactUtilizationResponse

type CompactUtilizationResponse struct {
	StartDate        string                   `json:"start_date,omitempty"`
	EndDate          string                   `json:"end_date,omitempty"`
	ContractID       string                   `json:"contract_id,omitempty"`
	MeterDefinitions map[string]string        `json:"meter_definitions,omitempty"`
	Datacenters      []CompactUtilDC          `json:"datacenters,omitempty"`
	TopMeters        []CompactUtilMeterWithDC `json:"top_meters,omitempty"`
}

CompactUtilizationResponse is the compacted shape for utilization endpoints. When CompactOptions.TopN is set, Datacenters is omitted and TopMeters carries the N largest meters globally (already sorted descending by quantity).

func CompactUtilizationDaily

CompactUtilizationDaily projects a UtilizationDailyFindByDate200Response into the compact shape.

func CompactUtilizationGet

CompactUtilizationGet projects a UtilizationGet200Response into the compact shape.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL