Documentation
¶
Overview ¶
Package cloudstorage provides GCP Cloud Storage commitments client
Index ¶
- type BillingService
- type Client
- func (c *Client) GetExistingCommitments(_ context.Context) ([]common.Commitment, error)
- func (c *Client) GetOfferingDetails(ctx context.Context, rec common.Recommendation) (*common.OfferingDetails, error)
- func (c *Client) GetRecommendations(_ context.Context, _ *common.RecommendationParams) ([]common.Recommendation, error)
- func (c *Client) GetRegion() string
- func (c *Client) GetServiceType() common.ServiceType
- func (c *Client) PurchaseCommitment(ctx context.Context, rec common.Recommendation, opts common.PurchaseOptions) (common.PurchaseResult, error)
- func (c *Client) SetBillingService(svc BillingService)
- func (c *Client) SetRecommenderClient(_ RecommenderClient)deprecated
- type RecommenderClientdeprecated
- type RecommenderIteratordeprecated
- type StoragePricing
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BillingService ¶
type BillingService = skulist.BillingService
BillingService lists SKUs of one Cloud Billing service (enables mocking).
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles GCP Cloud Storage commitments.
func NewClient ¶
func NewClient(ctx context.Context, projectID, region string, opts ...option.ClientOption) (*Client, error)
NewClient creates a new GCP Cloud Storage client.
func (*Client) GetExistingCommitments ¶
GetExistingCommitments returns an empty slice for Cloud Storage. GCP Cloud Storage has no commitment API: there is no committed-use discount purchase for GCS, and enumerating regional buckets does not represent a commitment -- it caused every bucket in a region to appear as a "commitment" in the UI (10-L2). Return empty until a proper commitment-detection path is available.
func (*Client) GetOfferingDetails ¶
func (c *Client) GetOfferingDetails(ctx context.Context, rec common.Recommendation) (*common.OfferingDetails, error)
GetOfferingDetails retrieves Cloud Storage offering details from GCP Billing API.
func (*Client) GetRecommendations ¶
func (c *Client) GetRecommendations(_ context.Context, _ *common.RecommendationParams) ([]common.Recommendation, error)
GetRecommendations always returns an error: Google has no commitment product for Cloud Storage (issue #78), so there is nothing to recommend. The error is explicit so callers do not read an empty result as "nothing to buy".
func (*Client) GetServiceType ¶
func (c *Client) GetServiceType() common.ServiceType
GetServiceType returns the service type.
func (*Client) PurchaseCommitment ¶
func (c *Client) PurchaseCommitment(ctx context.Context, rec common.Recommendation, opts common.PurchaseOptions) (common.PurchaseResult, error)
PurchaseCommitment is intentionally a no-op for Cloud Storage: GCP has no CUD or commitment purchase API for GCS at all. The previous implementation created a brand-new empty bucket, which is not a commitment and incurs ongoing cost, so a "purchase" silently provisioned billable infrastructure. Cloud Storage recommendations are therefore advisory only; this returns a clear not-supported error and never calls any resource-creation API (issue #640).
func (*Client) SetBillingService ¶
func (c *Client) SetBillingService(svc BillingService)
SetBillingService sets the billing service (for testing).
func (*Client) SetRecommenderClient
deprecated
func (c *Client) SetRecommenderClient(_ RecommenderClient)
SetRecommenderClient ignores the supplied client and does not close it.
Deprecated: Cloud Storage has no commitment recommender.
type RecommenderClient
deprecated
type RecommenderClient interface {
ListRecommendations(ctx context.Context, req *recommenderpb.ListRecommendationsRequest) RecommenderIterator
Close() error
}
RecommenderClient preserves the legacy injection API for source compatibility.
Deprecated: Cloud Storage has no commitment recommender.
type RecommenderIterator
deprecated
type RecommenderIterator interface {
Next() (*recommenderpb.Recommendation, error)
}
RecommenderIterator preserves the legacy iteration API for source compatibility.
Deprecated: Cloud Storage has no commitment recommender.
type StoragePricing ¶
type StoragePricing = catalogprice.Term
StoragePricing contains pricing information for Cloud Storage.