enterpriseusagereportsv1

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package enterpriseusagereportsv1 : Operations and models for the EnterpriseUsageReportsV1 service

Index

Constants

View Source
const (
	ResourceUsageReport_EntityType_Account      = "account"
	ResourceUsageReport_EntityType_AccountGroup = "account-group"
	ResourceUsageReport_EntityType_Enterprise   = "enterprise"
)

Constants associated with the ResourceUsageReport.EntityType property. The entity type.

View Source
const DefaultServiceName = "enterprise_usage_reports"

DefaultServiceName is the default key used to find external configuration information.

View Source
const DefaultServiceURL = "https://enterprise.cloud.ibm.com"

DefaultServiceURL is the default URL to make service requests to.

Variables

This section is empty.

Functions

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

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) 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) 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

SetHeaders : Allow user to set Headers

func (*GetResourceUsageReportOptions) SetLimit

SetLimit : Allow user to set Limit

func (*GetResourceUsageReportOptions) SetMonth

SetMonth : Allow user to set Month

func (*GetResourceUsageReportOptions) SetOffset

SetOffset : Allow user to set Offset

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 []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.

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.

Jump to

Keyboard shortcuts

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