ovh

package
v1.120.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OVHCatalogPricing = "OVH Catalog Pricing"

	BillingLabel  = "ovh.opencost.io/billing"
	NodepoolLabel = "nodepool"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OVH

type OVH struct {
	Clientset        clustercache.ClusterCache
	Config           models.ProviderConfig
	Pricing          map[string]*OVHFlavorPricing
	VolumePricing    map[string]float64
	ClusterRegion    string
	ClusterAccountID string
	DownloadLock     sync.RWMutex
	// contains filtered or unexported fields
}

OVH implements the models.Provider interface for OVHcloud.

func (*OVH) AllNodePricing

func (c *OVH) AllNodePricing() (interface{}, error)

AllNodePricing returns all cached node pricing data.

func (*OVH) ApplyReservedInstancePricing

func (c *OVH) ApplyReservedInstancePricing(nodes map[string]*models.Node)

ApplyReservedInstancePricing is a no-op for OVH.

func (*OVH) ClusterInfo

func (c *OVH) ClusterInfo() (map[string]string, error)

ClusterInfo returns metadata about the cluster.

func (*OVH) ClusterManagementPricing

func (c *OVH) ClusterManagementPricing() (string, float64, error)

ClusterManagementPricing returns the management cost for the cluster.

func (*OVH) CombinedDiscountForNode

func (c *OVH) CombinedDiscountForNode(instanceType string, isPreemptible bool, defaultDiscount, negotiatedDiscount float64) float64

CombinedDiscountForNode calculates the combined discount for a node.

func (*OVH) DownloadPricingData

func (c *OVH) DownloadPricingData() error

DownloadPricingData fetches the OVH public cloud catalog and parses pricing.

func (*OVH) GetAddresses

func (c *OVH) GetAddresses() ([]byte, error)

GetAddresses is not implemented for OVH.

func (*OVH) GetConfig

func (c *OVH) GetConfig() (*models.CustomPricing, error)

GetConfig returns the custom pricing configuration with OVH defaults.

func (*OVH) GetDisks

func (c *OVH) GetDisks() ([]byte, error)

GetDisks is not implemented for OVH.

func (*OVH) GetKey

func (c *OVH) GetKey(labels map[string]string, n *clustercache.Node) models.Key

GetKey returns a Key for matching node pricing.

func (*OVH) GetManagementPlatform

func (c *OVH) GetManagementPlatform() (string, error)

GetManagementPlatform detects the management platform from node labels.

func (*OVH) GetOrphanedResources

func (c *OVH) GetOrphanedResources() ([]models.OrphanedResource, error)

GetOrphanedResources is not implemented for OVH.

func (*OVH) GetPVKey

func (c *OVH) GetPVKey(pv *clustercache.PersistentVolume, parameters map[string]string, defaultRegion string) models.PVKey

GetPVKey returns a PVKey for matching persistent volume pricing.

func (*OVH) GpuPricing

func (c *OVH) GpuPricing(nodeLabels map[string]string) (string, error)

GpuPricing returns GPU-specific pricing (not used for OVH).

func (*OVH) LoadBalancerPricing

func (c *OVH) LoadBalancerPricing() (*models.LoadBalancer, error)

LoadBalancerPricing returns static load balancer pricing for OVH.

func (*OVH) NetworkPricing

func (c *OVH) NetworkPricing() (*models.Network, error)

NetworkPricing returns static network pricing for OVH.

func (*OVH) NodePricing

func (c *OVH) NodePricing(key models.Key) (*models.Node, models.PricingMetadata, error)

NodePricing returns pricing for a specific node based on its key.

func (*OVH) PVPricing

func (c *OVH) PVPricing(pvk models.PVKey) (*models.PV, error)

PVPricing returns pricing for a persistent volume.

func (*OVH) PricingSourceStatus

func (c *OVH) PricingSourceStatus() map[string]*models.PricingSource

PricingSourceStatus returns the status of the pricing data source.

func (*OVH) PricingSourceSummary

func (c *OVH) PricingSourceSummary() interface{}

PricingSourceSummary returns the parsed pricing data.

func (*OVH) Regions

func (c *OVH) Regions() []string

Regions returns the list of supported OVH regions.

func (*OVH) ServiceAccountStatus

func (c *OVH) ServiceAccountStatus() *models.ServiceAccountStatus

ServiceAccountStatus returns the service account status.

func (*OVH) UpdateConfig

func (c *OVH) UpdateConfig(r io.Reader, updateType string) (*models.CustomPricing, error)

UpdateConfig updates custom pricing from a JSON reader.

func (*OVH) UpdateConfigFromConfigMap

func (c *OVH) UpdateConfigFromConfigMap(a map[string]string) (*models.CustomPricing, error)

UpdateConfigFromConfigMap updates config from a ConfigMap.

type OVHFlavorPricing

type OVHFlavorPricing struct {
	HourlyPrice  float64
	MonthlyPrice float64 // monthly price converted to hourly (/730)
	PlanCode     string
	VCPU         int
	RAM          int // GB
	Disk         int // GB
	GPU          int
	GPUName      string
}

OVHFlavorPricing holds pricing and specs for an OVH instance flavor.

Jump to

Keyboard shortcuts

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