oracle

package
v1.109.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultPricing

type DefaultPricing struct {
	OCPU    string
	Memory  string
	GPU     string
	Storage string
	LB      string
	Egress  string
}

func (DefaultPricing) TotalInstanceCost

func (d DefaultPricing) TotalInstanceCost() (float64, error)

type Item

type Item struct {
	PartNumber                string `json:"partNumber"`
	DisplayName               string `json:"displayName"`
	MetricName                string `json:"metricName"`
	ServiceCategory           string `json:"serviceCategory"`
	CurrencyCodeLocalizations []struct {
		CurrencyCode string `json:"currencyCode"`
		Prices       []struct {
			Model string  `json:"model"`
			Value float64 `json:"value"`
		} `json:"prices"`
	} `json:"currencyCodeLocalizations"`
	Description string `json:"description,omitempty"`
}

type Oracle

type Oracle struct {
	Config                  models.ProviderConfig
	Clientset               clustercache.ClusterCache
	ClusterRegion           string
	ClusterAccountID        string
	DownloadPricingDataLock sync.RWMutex
	OSEnvLock               sync.Mutex
	RateCardStore           *RateCardStore
	ServiceAccountChecks    *models.ServiceAccountChecks
	DefaultPricing          DefaultPricing
}

func (*Oracle) AllNodePricing

func (o *Oracle) AllNodePricing() (interface{}, error)

func (*Oracle) ApplyReservedInstancePricing

func (o *Oracle) ApplyReservedInstancePricing(m map[string]*models.Node)

func (*Oracle) ClusterInfo

func (o *Oracle) ClusterInfo() (map[string]string, error)

func (*Oracle) ClusterManagementPricing

func (o *Oracle) ClusterManagementPricing() (string, float64, error)

func (*Oracle) CombinedDiscountForNode

func (o *Oracle) CombinedDiscountForNode(instanceType string, isPreemptible bool, defaultDiscount, negotiatedDiscount float64) float64

func (*Oracle) DownloadPricingData

func (o *Oracle) DownloadPricingData() error

DownloadPricingData refreshes the RateCardStore pricing data.

func (*Oracle) GetAddresses

func (o *Oracle) GetAddresses() ([]byte, error)

func (*Oracle) GetConfig

func (o *Oracle) GetConfig() (*models.CustomPricing, error)

func (*Oracle) GetDisks

func (o *Oracle) GetDisks() ([]byte, error)

func (*Oracle) GetKey

func (o *Oracle) GetKey(labels map[string]string, n *v1.Node) models.Key

func (*Oracle) GetLocalStorageQuery

func (o *Oracle) GetLocalStorageQuery(duration time.Duration, duration2 time.Duration, b bool, b2 bool) string

func (*Oracle) GetManagementPlatform

func (o *Oracle) GetManagementPlatform() (string, error)

func (*Oracle) GetOrphanedResources

func (o *Oracle) GetOrphanedResources() ([]models.OrphanedResource, error)

func (*Oracle) GetPVKey

func (o *Oracle) GetPVKey(pv *v1.PersistentVolume, parameters map[string]string, _ string) models.PVKey

func (*Oracle) LoadBalancerPricing

func (o *Oracle) LoadBalancerPricing() (*models.LoadBalancer, error)

func (*Oracle) NetworkPricing

func (o *Oracle) NetworkPricing() (*models.Network, error)

func (*Oracle) NodePricing

func (o *Oracle) NodePricing(key models.Key) (*models.Node, models.PricingMetadata, error)

func (*Oracle) PVPricing

func (o *Oracle) PVPricing(pvk models.PVKey) (*models.PV, error)

func (*Oracle) PricingSourceStatus

func (o *Oracle) PricingSourceStatus() map[string]*models.PricingSource

func (*Oracle) PricingSourceSummary

func (o *Oracle) PricingSourceSummary() interface{}

func (*Oracle) Regions

func (o *Oracle) Regions() []string

func (*Oracle) ServiceAccountStatus

func (o *Oracle) ServiceAccountStatus() *models.ServiceAccountStatus

func (*Oracle) UpdateConfig

func (o *Oracle) UpdateConfig(r io.Reader, _ string) (*models.CustomPricing, error)

func (*Oracle) UpdateConfigFromConfigMap

func (o *Oracle) UpdateConfigFromConfigMap(m map[string]string) (*models.CustomPricing, error)

type Price

type Price struct {
	ProductName string
	Metric      string
	Model       string
	UnitPrice   float64
}

type PricingResponse

type PricingResponse struct {
	Items []Item `json:"items"`
}

type Product

type Product struct {
	// OCPU product name
	OCPU string
	// Memory product name
	Memory string
	// GPU product name
	GPU  string
	Disk string
}

type RateCardStore

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

func NewRateCardStore

func NewRateCardStore(url, currencyCode string) *RateCardStore

func (*RateCardStore) ForEgressRegion

func (rcs *RateCardStore) ForEgressRegion(region string, defaultPricing DefaultPricing) (*models.Network, error)

func (*RateCardStore) ForKey

func (rcs *RateCardStore) ForKey(key models.Key, defaultPricing DefaultPricing) (*models.Node, models.PricingMetadata, error)

ForKey retrieves costing metadata for a key.

func (*RateCardStore) ForLB

func (rcs *RateCardStore) ForLB(defaultPricing DefaultPricing) (*models.LoadBalancer, error)

func (*RateCardStore) ForManagedCluster

func (rcs *RateCardStore) ForManagedCluster(clusterType string) float64

func (*RateCardStore) ForPVK

func (rcs *RateCardStore) ForPVK(pvk models.PVKey, defaultPricing DefaultPricing) (*models.PV, error)

ForPVK retrieves a Gb/Hour cost for a given PVKey.

func (*RateCardStore) Refresh

func (rcs *RateCardStore) Refresh() (map[string]Price, error)

func (*RateCardStore) Store

func (rcs *RateCardStore) Store() map[string]Price

Jump to

Keyboard shortcuts

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