Documentation ¶
Overview ¶
Package enterpriseusagereportsv1 : Operations and models for the EnterpriseUsageReportsV1 service
Index ¶
- Constants
- func GetServiceURLForRegion(region string) (string, error)
- func UnmarshalLink(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalMetricUsage(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalPlanUsage(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalReports(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalResourceUsage(m map[string]json.RawMessage, result interface{}) (err error)
- func UnmarshalResourceUsageReport(m map[string]json.RawMessage, result interface{}) (err error)
- type EnterpriseUsageReportsV1
- func (enterpriseUsageReports *EnterpriseUsageReportsV1) Clone() *EnterpriseUsageReportsV1
- func (enterpriseUsageReports *EnterpriseUsageReportsV1) DisableRetries()
- func (enterpriseUsageReports *EnterpriseUsageReportsV1) EnableRetries(maxRetries int, maxRetryInterval time.Duration)
- func (enterpriseUsageReports *EnterpriseUsageReportsV1) GetEnableGzipCompression() bool
- func (enterpriseUsageReports *EnterpriseUsageReportsV1) GetResourceUsageReport(getResourceUsageReportOptions *GetResourceUsageReportOptions) (result *Reports, response *core.DetailedResponse, err error)
- func (enterpriseUsageReports *EnterpriseUsageReportsV1) GetResourceUsageReportWithContext(ctx context.Context, ...) (result *Reports, response *core.DetailedResponse, err error)
- func (enterpriseUsageReports *EnterpriseUsageReportsV1) GetServiceURL() string
- func (*EnterpriseUsageReportsV1) NewGetResourceUsageReportOptions() *GetResourceUsageReportOptions
- func (enterpriseUsageReports *EnterpriseUsageReportsV1) NewGetResourceUsageReportPager(options *GetResourceUsageReportOptions) (pager *GetResourceUsageReportPager, err error)
- func (enterpriseUsageReports *EnterpriseUsageReportsV1) SetDefaultHeaders(headers http.Header)
- func (enterpriseUsageReports *EnterpriseUsageReportsV1) SetEnableGzipCompression(enableGzip bool)
- func (enterpriseUsageReports *EnterpriseUsageReportsV1) SetServiceURL(url string) error
- type EnterpriseUsageReportsV1Options
- type GetResourceUsageReportOptions
- func (_options *GetResourceUsageReportOptions) SetAccountGroupID(accountGroupID string) *GetResourceUsageReportOptions
- func (_options *GetResourceUsageReportOptions) SetAccountID(accountID string) *GetResourceUsageReportOptions
- func (_options *GetResourceUsageReportOptions) SetBillingUnitID(billingUnitID string) *GetResourceUsageReportOptions
- func (_options *GetResourceUsageReportOptions) SetChildren(children bool) *GetResourceUsageReportOptions
- func (_options *GetResourceUsageReportOptions) SetEnterpriseID(enterpriseID string) *GetResourceUsageReportOptions
- func (options *GetResourceUsageReportOptions) SetHeaders(param map[string]string) *GetResourceUsageReportOptions
- func (_options *GetResourceUsageReportOptions) SetLimit(limit int64) *GetResourceUsageReportOptions
- func (_options *GetResourceUsageReportOptions) SetMonth(month string) *GetResourceUsageReportOptions
- func (_options *GetResourceUsageReportOptions) SetOffset(offset string) *GetResourceUsageReportOptions
- type GetResourceUsageReportPager
- func (pager *GetResourceUsageReportPager) GetAll() (allItems []ResourceUsageReport, err error)
- func (pager *GetResourceUsageReportPager) GetAllWithContext(ctx context.Context) (allItems []ResourceUsageReport, err error)
- func (pager *GetResourceUsageReportPager) GetNext() (page []ResourceUsageReport, err error)
- func (pager *GetResourceUsageReportPager) GetNextWithContext(ctx context.Context) (page []ResourceUsageReport, err error)
- func (pager *GetResourceUsageReportPager) HasNext() bool
- type Link
- type MetricUsage
- type PlanUsage
- type Reports
- type ResourceUsage
- type ResourceUsageReport
Constants ¶
const ( ResourceUsageReportEntityTypeAccountConst = "account" ResourceUsageReportEntityTypeAccountGroupConst = "account-group" ResourceUsageReportEntityTypeEnterpriseConst = "enterprise" )
Constants associated with the ResourceUsageReport.EntityType property. The entity type.
const DefaultServiceName = "enterprise_usage_reports"
DefaultServiceName is the default key used to find external configuration information.
const DefaultServiceURL = "https://enterprise.cloud.ibm.com"
DefaultServiceURL is the default URL to make service requests to.
Variables ¶
This section is empty.
Functions ¶
func GetServiceURLForRegion ¶ added in v0.17.1
GetServiceURLForRegion returns the service URL to be used for the specified region
func UnmarshalLink ¶
func UnmarshalLink(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalLink unmarshals an instance of Link from the specified map of raw messages.
func UnmarshalMetricUsage ¶
func UnmarshalMetricUsage(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalMetricUsage unmarshals an instance of MetricUsage from the specified map of raw messages.
func UnmarshalPlanUsage ¶
func UnmarshalPlanUsage(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalPlanUsage unmarshals an instance of PlanUsage from the specified map of raw messages.
func UnmarshalReports ¶
func UnmarshalReports(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalReports unmarshals an instance of Reports from the specified map of raw messages.
func UnmarshalResourceUsage ¶
func UnmarshalResourceUsage(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalResourceUsage unmarshals an instance of ResourceUsage from the specified map of raw messages.
func UnmarshalResourceUsageReport ¶
func UnmarshalResourceUsageReport(m map[string]json.RawMessage, result interface{}) (err error)
UnmarshalResourceUsageReport unmarshals an instance of ResourceUsageReport from the specified map of raw messages.
Types ¶
type EnterpriseUsageReportsV1 ¶
type EnterpriseUsageReportsV1 struct {
Service *core.BaseService
}
EnterpriseUsageReportsV1 : Usage reports for IBM Cloud enterprise entities
API Version: 1.0.0-beta.1
func NewEnterpriseUsageReportsV1 ¶
func NewEnterpriseUsageReportsV1(options *EnterpriseUsageReportsV1Options) (service *EnterpriseUsageReportsV1, err error)
NewEnterpriseUsageReportsV1 : constructs an instance of EnterpriseUsageReportsV1 with passed in options.
func NewEnterpriseUsageReportsV1UsingExternalConfig ¶
func NewEnterpriseUsageReportsV1UsingExternalConfig(options *EnterpriseUsageReportsV1Options) (enterpriseUsageReports *EnterpriseUsageReportsV1, err error)
NewEnterpriseUsageReportsV1UsingExternalConfig : constructs an instance of EnterpriseUsageReportsV1 with passed in options and external configuration.
func (*EnterpriseUsageReportsV1) Clone ¶ added in v0.17.1
func (enterpriseUsageReports *EnterpriseUsageReportsV1) Clone() *EnterpriseUsageReportsV1
Clone makes a copy of "enterpriseUsageReports" suitable for processing requests.
func (*EnterpriseUsageReportsV1) DisableRetries ¶
func (enterpriseUsageReports *EnterpriseUsageReportsV1) DisableRetries()
DisableRetries disables automatic retries for requests invoked for this service instance.
func (*EnterpriseUsageReportsV1) EnableRetries ¶
func (enterpriseUsageReports *EnterpriseUsageReportsV1) EnableRetries(maxRetries int, maxRetryInterval time.Duration)
EnableRetries enables automatic retries for requests invoked for this service instance. If either parameter is specified as 0, then a default value is used instead.
func (*EnterpriseUsageReportsV1) GetEnableGzipCompression ¶
func (enterpriseUsageReports *EnterpriseUsageReportsV1) GetEnableGzipCompression() bool
GetEnableGzipCompression returns the service's EnableGzipCompression field
func (*EnterpriseUsageReportsV1) GetResourceUsageReport ¶
func (enterpriseUsageReports *EnterpriseUsageReportsV1) GetResourceUsageReport(getResourceUsageReportOptions *GetResourceUsageReportOptions) (result *Reports, response *core.DetailedResponse, err error)
GetResourceUsageReport : Get usage reports for enterprise entities Usage reports for entities in the IBM Cloud enterprise. These entities can be the enterprise, an account group, or an account.
func (*EnterpriseUsageReportsV1) GetResourceUsageReportWithContext ¶
func (enterpriseUsageReports *EnterpriseUsageReportsV1) GetResourceUsageReportWithContext(ctx context.Context, getResourceUsageReportOptions *GetResourceUsageReportOptions) (result *Reports, response *core.DetailedResponse, err error)
GetResourceUsageReportWithContext is an alternate form of the GetResourceUsageReport method which supports a Context parameter
func (*EnterpriseUsageReportsV1) GetServiceURL ¶
func (enterpriseUsageReports *EnterpriseUsageReportsV1) GetServiceURL() string
GetServiceURL returns the service URL
func (*EnterpriseUsageReportsV1) NewGetResourceUsageReportOptions ¶
func (*EnterpriseUsageReportsV1) NewGetResourceUsageReportOptions() *GetResourceUsageReportOptions
NewGetResourceUsageReportOptions : Instantiate GetResourceUsageReportOptions
func (*EnterpriseUsageReportsV1) NewGetResourceUsageReportPager ¶ added in v0.28.8
func (enterpriseUsageReports *EnterpriseUsageReportsV1) NewGetResourceUsageReportPager(options *GetResourceUsageReportOptions) (pager *GetResourceUsageReportPager, err error)
NewGetResourceUsageReportPager returns a new GetResourceUsageReportPager instance.
func (*EnterpriseUsageReportsV1) SetDefaultHeaders ¶
func (enterpriseUsageReports *EnterpriseUsageReportsV1) SetDefaultHeaders(headers http.Header)
SetDefaultHeaders sets HTTP headers to be sent in every request
func (*EnterpriseUsageReportsV1) SetEnableGzipCompression ¶
func (enterpriseUsageReports *EnterpriseUsageReportsV1) SetEnableGzipCompression(enableGzip bool)
SetEnableGzipCompression sets the service's EnableGzipCompression field
func (*EnterpriseUsageReportsV1) SetServiceURL ¶
func (enterpriseUsageReports *EnterpriseUsageReportsV1) SetServiceURL(url string) error
SetServiceURL sets the service URL
type EnterpriseUsageReportsV1Options ¶
type EnterpriseUsageReportsV1Options struct { ServiceName string URL string Authenticator core.Authenticator }
EnterpriseUsageReportsV1Options : Service options
type GetResourceUsageReportOptions ¶
type GetResourceUsageReportOptions struct { // The ID of the enterprise for which the reports are queried. This parameter cannot be used with the `account_id` or // `account_group_id` query parameters. EnterpriseID *string `json:"enterprise_id,omitempty"` // The ID of the account group for which the reports are queried. This parameter cannot be used with the `account_id` // or `enterprise_id` query parameters. AccountGroupID *string `json:"account_group_id,omitempty"` // The ID of the account for which the reports are queried. This parameter cannot be used with the `account_group_id` // or `enterprise_id` query parameters. AccountID *string `json:"account_id,omitempty"` // Returns the reports for the immediate child entities under the current account group or enterprise. This parameter // cannot be used with the `account_id` query parameter. Children *bool `json:"children,omitempty"` // The billing month for which the usage report is requested. The format is in yyyy-mm. Defaults to the month in which // the report is queried. Month *string `json:"month,omitempty"` // The ID of the billing unit by which to filter the reports. BillingUnitID *string `json:"billing_unit_id,omitempty"` // The maximum number of search results to be returned. Limit *int64 `json:"limit,omitempty"` // An opaque value representing the offset of the first item to be returned by a search query. If not specified, then // the first page of results is returned. To retrieve the next page of search results, use the 'offset' query parameter // value within the 'next.href' URL found within a prior search query response. Offset *string `json:"offset,omitempty"` // Allows users to set headers on API requests Headers map[string]string }
GetResourceUsageReportOptions : The GetResourceUsageReport options.
func (*GetResourceUsageReportOptions) SetAccountGroupID ¶
func (_options *GetResourceUsageReportOptions) SetAccountGroupID(accountGroupID string) *GetResourceUsageReportOptions
SetAccountGroupID : Allow user to set AccountGroupID
func (*GetResourceUsageReportOptions) SetAccountID ¶
func (_options *GetResourceUsageReportOptions) SetAccountID(accountID string) *GetResourceUsageReportOptions
SetAccountID : Allow user to set AccountID
func (*GetResourceUsageReportOptions) SetBillingUnitID ¶
func (_options *GetResourceUsageReportOptions) SetBillingUnitID(billingUnitID string) *GetResourceUsageReportOptions
SetBillingUnitID : Allow user to set BillingUnitID
func (*GetResourceUsageReportOptions) SetChildren ¶
func (_options *GetResourceUsageReportOptions) SetChildren(children bool) *GetResourceUsageReportOptions
SetChildren : Allow user to set Children
func (*GetResourceUsageReportOptions) SetEnterpriseID ¶
func (_options *GetResourceUsageReportOptions) SetEnterpriseID(enterpriseID string) *GetResourceUsageReportOptions
SetEnterpriseID : Allow user to set EnterpriseID
func (*GetResourceUsageReportOptions) SetHeaders ¶
func (options *GetResourceUsageReportOptions) SetHeaders(param map[string]string) *GetResourceUsageReportOptions
SetHeaders : Allow user to set Headers
func (*GetResourceUsageReportOptions) SetLimit ¶
func (_options *GetResourceUsageReportOptions) SetLimit(limit int64) *GetResourceUsageReportOptions
SetLimit : Allow user to set Limit
func (*GetResourceUsageReportOptions) SetMonth ¶
func (_options *GetResourceUsageReportOptions) SetMonth(month string) *GetResourceUsageReportOptions
SetMonth : Allow user to set Month
func (*GetResourceUsageReportOptions) SetOffset ¶
func (_options *GetResourceUsageReportOptions) SetOffset(offset string) *GetResourceUsageReportOptions
SetOffset : Allow user to set Offset
type GetResourceUsageReportPager ¶ added in v0.28.8
type GetResourceUsageReportPager struct {
// contains filtered or unexported fields
}
GetResourceUsageReportPager can be used to simplify the use of the "GetResourceUsageReport" method.
func (*GetResourceUsageReportPager) GetAll ¶ added in v0.28.8
func (pager *GetResourceUsageReportPager) GetAll() (allItems []ResourceUsageReport, err error)
GetAll invokes GetAllWithContext() using context.Background() as the Context parameter.
func (*GetResourceUsageReportPager) GetAllWithContext ¶ added in v0.28.8
func (pager *GetResourceUsageReportPager) GetAllWithContext(ctx context.Context) (allItems []ResourceUsageReport, err error)
GetAllWithContext returns all results by invoking GetNextWithContext() repeatedly until all pages of results have been retrieved.
func (*GetResourceUsageReportPager) GetNext ¶ added in v0.28.8
func (pager *GetResourceUsageReportPager) GetNext() (page []ResourceUsageReport, err error)
GetNext invokes GetNextWithContext() using context.Background() as the Context parameter.
func (*GetResourceUsageReportPager) GetNextWithContext ¶ added in v0.28.8
func (pager *GetResourceUsageReportPager) GetNextWithContext(ctx context.Context) (page []ResourceUsageReport, err error)
GetNextWithContext returns the next page of results using the specified Context.
func (*GetResourceUsageReportPager) HasNext ¶ added in v0.28.8
func (pager *GetResourceUsageReportPager) HasNext() bool
HasNext returns true if there are potentially more results to be retrieved.
type Link ¶
type Link struct { // A link to a page of search results. Href *string `json:"href,omitempty"` }
Link : An object that contains a link to a page of search results.
type MetricUsage ¶
type MetricUsage struct { // The name of the metric. Metric *string `json:"metric" validate:"required"` // A unit to qualify the quantity. Unit *string `json:"unit" validate:"required"` // The aggregated value for the metric. Quantity *float64 `json:"quantity" validate:"required"` // The quantity that is used for calculating charges. RateableQuantity *float64 `json:"rateable_quantity" validate:"required"` // The cost that was incurred by the metric. Cost *float64 `json:"cost" validate:"required"` // The pre-discounted cost that was incurred by the metric. RatedCost *float64 `json:"rated_cost" validate:"required"` // The price with which cost was calculated. Price []map[string]interface{} `json:"price,omitempty"` }
MetricUsage : An object that represents a metric.
type PlanUsage ¶
type PlanUsage struct { // The ID of the plan. PlanID *string `json:"plan_id" validate:"required"` // The pricing region for the plan. PricingRegion *string `json:"pricing_region,omitempty"` // The pricing plan with which the usage was rated. PricingPlanID *string `json:"pricing_plan_id,omitempty"` // Whether the plan charges are billed to the customer. Billable *bool `json:"billable" validate:"required"` // The total cost that was incurred by the plan. Cost *float64 `json:"cost" validate:"required"` // The total pre-discounted cost that was incurred by the plan. RatedCost *float64 `json:"rated_cost" validate:"required"` // All of the metrics in the plan. Usage []MetricUsage `json:"usage" validate:"required"` }
PlanUsage : Aggregated values for the plan.
type Reports ¶
type Reports struct { // The maximum number of reports in the response. Limit *int64 `json:"limit,omitempty"` // An object that contains the link to the first page of the search query. First *Link `json:"first,omitempty"` // An object that contains the link to the next page of the search query. Next *Link `json:"next,omitempty"` // The list of usage reports. Reports []ResourceUsageReport `json:"reports,omitempty"` }
Reports : Resource Usage Reports API response.
func (*Reports) GetNextOffset ¶ added in v0.28.8
Retrieve the value to be passed to a request to access the next page of results
type ResourceUsage ¶
type ResourceUsage struct { // The ID of the resource. ResourceID *string `json:"resource_id" validate:"required"` // The billable charges for the account. BillableCost *float64 `json:"billable_cost" validate:"required"` // The pre-discounted billable charges for the account. BillableRatedCost *float64 `json:"billable_rated_cost" validate:"required"` // The non-billable charges for the account. NonBillableCost *float64 `json:"non_billable_cost" validate:"required"` // The pre-discounted, non-billable charges for the account. NonBillableRatedCost *float64 `json:"non_billable_rated_cost" validate:"required"` // All of the plans in the resource. Plans []PlanUsage `json:"plans" validate:"required"` }
ResourceUsage : A container for all the plans in the resource.
type ResourceUsageReport ¶
type ResourceUsageReport struct { // The ID of the entity. EntityID *string `json:"entity_id" validate:"required"` // The entity type. EntityType *string `json:"entity_type" validate:"required"` // The Cloud Resource Name (CRN) of the entity towards which the resource usages were rolled up. EntityCRN *string `json:"entity_crn" validate:"required"` // A user-defined name for the entity, such as the enterprise name or account group name. EntityName *string `json:"entity_name" validate:"required"` // The ID of the billing unit. BillingUnitID *string `json:"billing_unit_id" validate:"required"` // The CRN of the billing unit. BillingUnitCRN *string `json:"billing_unit_crn" validate:"required"` // The name of the billing unit. BillingUnitName *string `json:"billing_unit_name" validate:"required"` // The country code of the billing unit. CountryCode *string `json:"country_code" validate:"required"` // The currency code of the billing unit. CurrencyCode *string `json:"currency_code" validate:"required"` // Billing month. Month *string `json:"month" validate:"required"` // Billable charges that are aggregated from all entities in the report. BillableCost *float64 `json:"billable_cost" validate:"required"` // Non-billable charges that are aggregated from all entities in the report. NonBillableCost *float64 `json:"non_billable_cost" validate:"required"` // Aggregated billable charges before discounts. BillableRatedCost *float64 `json:"billable_rated_cost" validate:"required"` // Aggregated non-billable charges before discounts. NonBillableRatedCost *float64 `json:"non_billable_rated_cost" validate:"required"` // Details about all the resources that are included in the aggregated charges. Resources []ResourceUsage `json:"resources" validate:"required"` }
ResourceUsageReport : An object that represents a usage report.