ibm

package
v1.121.3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const APIKeyAuthorizerType = "IBMAPIKey"

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKey

type APIKey struct {
	Key string `json:"apiKey"`
}

APIKey authenticates to IBM Cloud IAM with an API key. The key may belong to a user or service ID with billing.usage-report.read.

func (*APIKey) CreateAuthenticator

func (a *APIKey) CreateAuthenticator() (core.Authenticator, error)

func (*APIKey) Equals

func (a *APIKey) Equals(config cloud.Config) bool

func (*APIKey) MarshalJSON

func (a *APIKey) MarshalJSON() ([]byte, error)

func (*APIKey) Sanitize

func (a *APIKey) Sanitize() cloud.Config

func (*APIKey) Validate

func (a *APIKey) Validate() error

type Authorizer

type Authorizer interface {
	cloud.Authorizer
	CreateAuthenticator() (core.Authenticator, error)
}

Authorizer creates IBM Cloud SDK authenticators for Usage Reports clients.

func SelectAuthorizerByType

func SelectAuthorizerByType(typeStr string) (Authorizer, error)

SelectAuthorizerByType registers supported IBM authorizer types.

type UsageConfiguration

type UsageConfiguration struct {
	AccountID  string     `json:"accountID"`
	Authorizer Authorizer `json:"authorizer"`
}

UsageConfiguration connects OpenCost to the IBM Cloud Usage Reports API (account cost and usage / CUR-style billing data).

func (*UsageConfiguration) Equals

func (c *UsageConfiguration) Equals(config cloud.Config) bool

func (*UsageConfiguration) GetUsageReportsClient

func (c *UsageConfiguration) GetUsageReportsClient() (*usagereportsv4.UsageReportsV4, error)

func (*UsageConfiguration) Key

func (c *UsageConfiguration) Key() string

Key identifies the integration for storage paths. Account IDs are normalized to bare hex so "a/<hex>" cannot create an extra path segment.

func (*UsageConfiguration) Provider

func (c *UsageConfiguration) Provider() string

func (*UsageConfiguration) Sanitize

func (c *UsageConfiguration) Sanitize() cloud.Config

func (*UsageConfiguration) UnmarshalJSON

func (c *UsageConfiguration) UnmarshalJSON(b []byte) error

func (*UsageConfiguration) Validate

func (c *UsageConfiguration) Validate() error

type UsageIntegration

type UsageIntegration struct {
	UsageConfiguration
	ConnectionStatus cloud.ConnectionStatus
	// contains filtered or unexported fields
}

UsageIntegration ingests IBM Cloud Usage Reports into CloudCost.

func (*UsageIntegration) GetCloudCost

func (ui *UsageIntegration) GetCloudCost(start, end time.Time) (*opencost.CloudCostSetRange, error)

func (*UsageIntegration) GetStatus

func (ui *UsageIntegration) GetStatus() cloud.ConnectionStatus

func (*UsageIntegration) RefreshStatus

func (ui *UsageIntegration) RefreshStatus() cloud.ConnectionStatus

Jump to

Keyboard shortcuts

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