clickhouse

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DatabaseStateTypeChoices added in v0.8.0

func DatabaseStateTypeChoices() []string

Types

type ClickHouseHandler

type ClickHouseHandler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(doer doer) ClickHouseHandler

func (*ClickHouseHandler) ServiceClickHouseDatabaseCreate

func (h *ClickHouseHandler) ServiceClickHouseDatabaseCreate(ctx context.Context, project string, serviceName string, in *ServiceClickHouseDatabaseCreateIn) error

func (*ClickHouseHandler) ServiceClickHouseDatabaseDelete

func (h *ClickHouseHandler) ServiceClickHouseDatabaseDelete(ctx context.Context, project string, serviceName string, database string) error

func (*ClickHouseHandler) ServiceClickHouseDatabaseList added in v0.8.0

func (h *ClickHouseHandler) ServiceClickHouseDatabaseList(ctx context.Context, project string, serviceName string) ([]DatabaseOut, error)

func (*ClickHouseHandler) ServiceClickHouseQueryStats

func (h *ClickHouseHandler) ServiceClickHouseQueryStats(ctx context.Context, project string, serviceName string) ([]QueryOut, error)

func (*ClickHouseHandler) ServiceClickHouseTieredStorageSummary

func (h *ClickHouseHandler) ServiceClickHouseTieredStorageSummary(ctx context.Context, project string, serviceName string) (*ServiceClickHouseTieredStorageSummaryOut, error)

type DatabaseOut added in v0.8.0

type DatabaseOut struct {
	Engine   string            `json:"engine"`
	Name     string            `json:"name"`
	Required bool              `json:"required"`
	State    DatabaseStateType `json:"state,omitempty"`
}

type DatabaseStateType added in v0.8.0

type DatabaseStateType string
const (
	DatabaseStateTypeOk              DatabaseStateType = "ok"
	DatabaseStateTypePendingCreation DatabaseStateType = "pending_creation"
	DatabaseStateTypePendingRemoval  DatabaseStateType = "pending_removal"
)

type Handler

type Handler interface {
	// ServiceClickHouseDatabaseCreate create a database
	// POST /v1/project/{project}/service/{service_name}/clickhouse/db
	// https://api.aiven.io/doc/#tag/Service:_ClickHouse/operation/ServiceClickHouseDatabaseCreate
	ServiceClickHouseDatabaseCreate(ctx context.Context, project string, serviceName string, in *ServiceClickHouseDatabaseCreateIn) error

	// ServiceClickHouseDatabaseDelete delete a database
	// DELETE /v1/project/{project}/service/{service_name}/clickhouse/db/{database}
	// https://api.aiven.io/doc/#tag/Service:_ClickHouse/operation/ServiceClickHouseDatabaseDelete
	ServiceClickHouseDatabaseDelete(ctx context.Context, project string, serviceName string, database string) error

	// ServiceClickHouseDatabaseList list all databases
	// GET /v1/project/{project}/service/{service_name}/clickhouse/db
	// https://api.aiven.io/doc/#tag/Service:_ClickHouse/operation/ServiceClickHouseDatabaseList
	ServiceClickHouseDatabaseList(ctx context.Context, project string, serviceName string) ([]DatabaseOut, error)

	// ServiceClickHouseQueryStats return statistics on recent queries
	// GET /v1/project/{project}/service/{service_name}/clickhouse/query/stats
	// https://api.aiven.io/doc/#tag/Service:_ClickHouse/operation/ServiceClickHouseQueryStats
	ServiceClickHouseQueryStats(ctx context.Context, project string, serviceName string) ([]QueryOut, error)

	// ServiceClickHouseTieredStorageSummary get the ClickHouse tiered storage summary
	// GET /v1/project/{project}/service/{service_name}/clickhouse/tiered-storage/summary
	// https://api.aiven.io/doc/#tag/Service:_ClickHouse/operation/ServiceClickHouseTieredStorageSummary
	ServiceClickHouseTieredStorageSummary(ctx context.Context, project string, serviceName string) (*ServiceClickHouseTieredStorageSummaryOut, error)
}

type HourlyOut

type HourlyOut struct {
	EstimatedCost   string `json:"estimated_cost,omitempty"`
	HourStart       string `json:"hour_start"`
	PeakStoredBytes int    `json:"peak_stored_bytes"`
}

type QueryOut

type QueryOut struct {
	Calls      *int     `json:"calls,omitempty"`
	Database   string   `json:"database,omitempty"`
	MaxTime    *int     `json:"max_time,omitempty"`
	MeanTime   *int     `json:"mean_time,omitempty"`
	MinTime    *int     `json:"min_time,omitempty"`
	P95Time    *int     `json:"p95_time,omitempty"`
	Query      string   `json:"query,omitempty"`
	Rows       *float64 `json:"rows,omitempty"`
	StddevTime *int     `json:"stddev_time,omitempty"`
	TotalTime  *int     `json:"total_time,omitempty"`
}

type ServiceClickHouseDatabaseCreateIn

type ServiceClickHouseDatabaseCreateIn struct {
	Database string `json:"database"`
}

type ServiceClickHouseTieredStorageSummaryOut

type ServiceClickHouseTieredStorageSummaryOut struct {
	CurrentCost         string                 `json:"current_cost"`
	ForecastedCost      string                 `json:"forecasted_cost"`
	ForecastedRate      string                 `json:"forecasted_rate,omitempty"`
	StorageUsageHistory StorageUsageHistoryOut `json:"storage_usage_history"`
	TotalStorageUsage   int                    `json:"total_storage_usage"`
}

type StorageUsageHistoryOut

type StorageUsageHistoryOut struct {
	Hourly []HourlyOut `json:"hourly"`
}

Jump to

Keyboard shortcuts

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