Documentation
¶
Index ¶
- Constants
- type APIKey
- type Authorizer
- type UsageConfiguration
- func (c *UsageConfiguration) Equals(config cloud.Config) bool
- func (c *UsageConfiguration) GetUsageReportsClient() (*usagereportsv4.UsageReportsV4, error)
- func (c *UsageConfiguration) Key() string
- func (c *UsageConfiguration) Provider() string
- func (c *UsageConfiguration) Sanitize() cloud.Config
- func (c *UsageConfiguration) UnmarshalJSON(b []byte) error
- func (c *UsageConfiguration) Validate() error
- type UsageIntegration
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) MarshalJSON ¶
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) 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
Click to show internal directories.
Click to hide internal directories.