oracle

package
v1.112.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const RawConfigProviderAuthorizerType = "OCIRawConfigProvider"

Variables

This section is empty.

Functions

func SelectOCICategory added in v1.112.0

func SelectOCICategory(service string) string

Types

type Authorizer added in v1.112.0

type Authorizer interface {
	cloud.Authorizer
	CreateOCIConfig() (common.ConfigurationProvider, error)
}

Authorizer provides which is used in when creating clients in the OCI SDK

func SelectAuthorizerByType added in v1.112.0

func SelectAuthorizerByType(typeStr string) (Authorizer, error)

SelectAuthorizerByType is an implementation of AuthorizerSelectorFn and acts as a register for Authorizer 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

type RawConfigProvider added in v1.112.0

type RawConfigProvider struct {
	TenancyID            string  `json:"tenancyID"`
	UserID               string  `json:"userID"`
	Region               string  `json:"region"`
	Fingerprint          string  `json:"fingerprint"`
	PrivateKey           string  `json:"privateKey"`
	PrivateKeyPassphrase *string `json:"privateKeyPassphrase"`
}

RawConfigProvider holds OCI credentials and fulfils the common.ConfigurationProvider interface

func (*RawConfigProvider) CreateOCIConfig added in v1.112.0

func (ak *RawConfigProvider) CreateOCIConfig() (common.ConfigurationProvider, error)

func (*RawConfigProvider) Equals added in v1.112.0

func (ak *RawConfigProvider) Equals(config cloud.Config) bool

func (*RawConfigProvider) MarshalJSON added in v1.112.0

func (ak *RawConfigProvider) MarshalJSON() ([]byte, error)

MarshalJSON custom json marshalling functions, sets properties as tagged in struct and sets the authorizer type property

func (*RawConfigProvider) Sanitize added in v1.112.0

func (ak *RawConfigProvider) Sanitize() cloud.Config

func (*RawConfigProvider) Validate added in v1.112.0

func (ak *RawConfigProvider) Validate() error

type UsageApiConfiguration added in v1.112.0

type UsageApiConfiguration struct {
	TenancyID  string     `json:"tenancyID"`
	Region     string     `json:"region"`
	Authorizer Authorizer `json:"authorizer"`
}

func (*UsageApiConfiguration) Equals added in v1.112.0

func (uac *UsageApiConfiguration) Equals(config cloud.Config) bool

func (*UsageApiConfiguration) GetUsageApiClient added in v1.112.0

func (uac *UsageApiConfiguration) GetUsageApiClient() (*usageapi.UsageapiClient, error)

func (*UsageApiConfiguration) Key added in v1.112.0

func (uac *UsageApiConfiguration) Key() string

func (*UsageApiConfiguration) Provider added in v1.112.0

func (uac *UsageApiConfiguration) Provider() string

func (*UsageApiConfiguration) Sanitize added in v1.112.0

func (uac *UsageApiConfiguration) Sanitize() cloud.Config

func (*UsageApiConfiguration) UnmarshalJSON added in v1.112.0

func (uac *UsageApiConfiguration) UnmarshalJSON(b []byte) error

func (*UsageApiConfiguration) Validate added in v1.112.0

func (uac *UsageApiConfiguration) Validate() error

type UsageApiIntegration added in v1.112.0

type UsageApiIntegration struct {
	UsageApiConfiguration
	ConnectionStatus cloud.ConnectionStatus
}

func (*UsageApiIntegration) GetCloudCost added in v1.112.0

func (uai *UsageApiIntegration) GetCloudCost(start time.Time, end time.Time) (*opencost.CloudCostSetRange, error)

func (*UsageApiIntegration) GetStatus added in v1.112.0

func (uai *UsageApiIntegration) GetStatus() cloud.ConnectionStatus

Jump to

Keyboard shortcuts

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