...

Package usageapi

import "github.com/oracle/oci-go-sdk/usageapi"
Overview
Index

Overview ▾

Index ▾

type Configuration
    func (m Configuration) String() string
type ConfigurationAggregation
    func (m ConfigurationAggregation) String() string
type Dimension
    func (m Dimension) String() string
type Filter
    func (m Filter) String() string
type FilterOperatorEnum
    func GetFilterOperatorEnumValues() []FilterOperatorEnum
type RequestSummarizedConfigurationsRequest
    func (request RequestSummarizedConfigurationsRequest) HTTPRequest(method, path string) (http.Request, error)
    func (request RequestSummarizedConfigurationsRequest) RetryPolicy() *common.RetryPolicy
    func (request RequestSummarizedConfigurationsRequest) String() string
type RequestSummarizedConfigurationsResponse
    func (response RequestSummarizedConfigurationsResponse) HTTPResponse() *http.Response
    func (response RequestSummarizedConfigurationsResponse) String() string
type RequestSummarizedUsagesDetails
    func (m RequestSummarizedUsagesDetails) String() string
type RequestSummarizedUsagesDetailsGranularityEnum
    func GetRequestSummarizedUsagesDetailsGranularityEnumValues() []RequestSummarizedUsagesDetailsGranularityEnum
type RequestSummarizedUsagesDetailsQueryTypeEnum
    func GetRequestSummarizedUsagesDetailsQueryTypeEnumValues() []RequestSummarizedUsagesDetailsQueryTypeEnum
type RequestSummarizedUsagesRequest
    func (request RequestSummarizedUsagesRequest) HTTPRequest(method, path string) (http.Request, error)
    func (request RequestSummarizedUsagesRequest) RetryPolicy() *common.RetryPolicy
    func (request RequestSummarizedUsagesRequest) String() string
type RequestSummarizedUsagesResponse
    func (response RequestSummarizedUsagesResponse) HTTPResponse() *http.Response
    func (response RequestSummarizedUsagesResponse) String() string
type Tag
    func (m Tag) String() string
type UsageAggregation
    func (m UsageAggregation) String() string
type UsageSummary
    func (m UsageSummary) String() string
type UsageapiClient
    func NewUsageapiClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client UsageapiClient, err error)
    func NewUsageapiClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client UsageapiClient, err error)
    func (client *UsageapiClient) ConfigurationProvider() *common.ConfigurationProvider
    func (client UsageapiClient) RequestSummarizedConfigurations(ctx context.Context, request RequestSummarizedConfigurationsRequest) (response RequestSummarizedConfigurationsResponse, err error)
    func (client UsageapiClient) RequestSummarizedUsages(ctx context.Context, request RequestSummarizedUsagesRequest) (response RequestSummarizedUsagesResponse, err error)
    func (client *UsageapiClient) SetRegion(region string)

Package files

configuration.go configuration_aggregation.go dimension.go filter.go request_summarized_configurations_request_response.go request_summarized_usages_details.go request_summarized_usages_request_response.go tag.go usage_aggregation.go usage_summary.go usageapi_client.go

type Configuration

Configuration A configuration.

type Configuration struct {

    // The configuration key.
    Key *string `mandatory:"true" json:"key"`

    // The configuration value.
    Values []string `mandatory:"false" json:"values"`
}

func (Configuration) String

func (m Configuration) String() string

type ConfigurationAggregation

ConfigurationAggregation The available configurations.

type ConfigurationAggregation struct {

    // The list of available configurations.
    Items []Configuration `mandatory:"true" json:"items"`
}

func (ConfigurationAggregation) String

func (m ConfigurationAggregation) String() string

type Dimension

Dimension The dimension used for filtering. availabe dimension are "service", "skuName", "skuPartNumber", "unit", "compartmentName", "compartmentPath", "compartmentId", "platform", "region", "logicalAd", "resourceId", "tenantId", "tenantName" example: `[{value: "COMPUTE", key: "service"}]`

type Dimension struct {

    // The dimension key.
    Key *string `mandatory:"true" json:"key"`

    // The dimension value.
    Value *string `mandatory:"true" json:"value"`
}

func (Dimension) String

func (m Dimension) String() string

type Filter

Filter The filter object for query usage.

type Filter struct {

    // The filter operator. Example: 'AND', 'OR', 'NOT'.
    Operator FilterOperatorEnum `mandatory:"false" json:"operator,omitempty"`

    // The dimensions to filter on.
    Dimensions []Dimension `mandatory:"false" json:"dimensions"`

    // The tags to filter on.
    Tags []Tag `mandatory:"false" json:"tags"`

    // The nested filter object.
    Filters []Filter `mandatory:"false" json:"filters"`
}

func (Filter) String

func (m Filter) String() string

type FilterOperatorEnum

FilterOperatorEnum Enum with underlying type: string

type FilterOperatorEnum string

Set of constants representing the allowable values for FilterOperatorEnum

const (
    FilterOperatorAnd FilterOperatorEnum = "AND"
    FilterOperatorNot FilterOperatorEnum = "NOT"
    FilterOperatorOr  FilterOperatorEnum = "OR"
)

func GetFilterOperatorEnumValues

func GetFilterOperatorEnumValues() []FilterOperatorEnum

GetFilterOperatorEnumValues Enumerates the set of values for FilterOperatorEnum

type RequestSummarizedConfigurationsRequest

RequestSummarizedConfigurationsRequest wrapper for the RequestSummarizedConfigurations operation

See also

Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/36.1.0/usageapi/RequestSummarizedConfigurations.go.html to see an example of how to use RequestSummarizedConfigurationsRequest.

type RequestSummarizedConfigurationsRequest struct {

    // tenant id
    TenantId *string `mandatory:"true" contributesTo:"query" name:"tenantId"`

    // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
    // particular request, please provide the request ID.
    OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"`

    // Metadata about the request. This information will not be transmitted to the service, but
    // represents information that the SDK will consume to drive retry behavior.
    RequestMetadata common.RequestMetadata
}

func (RequestSummarizedConfigurationsRequest) HTTPRequest

func (request RequestSummarizedConfigurationsRequest) HTTPRequest(method, path string) (http.Request, error)

HTTPRequest implements the OCIRequest interface

func (RequestSummarizedConfigurationsRequest) RetryPolicy

func (request RequestSummarizedConfigurationsRequest) RetryPolicy() *common.RetryPolicy

RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.

func (RequestSummarizedConfigurationsRequest) String

func (request RequestSummarizedConfigurationsRequest) String() string

type RequestSummarizedConfigurationsResponse

RequestSummarizedConfigurationsResponse wrapper for the RequestSummarizedConfigurations operation

type RequestSummarizedConfigurationsResponse struct {

    // The underlying http response
    RawResponse *http.Response

    // The ConfigurationAggregation instance
    ConfigurationAggregation `presentIn:"body"`

    // Unique Oracle-assigned identifier for the request. If you need to contact
    // Oracle about a particular request, please provide the request ID.
    OpcRequestId *string `presentIn:"header" name:"opc-request-id"`
}

func (RequestSummarizedConfigurationsResponse) HTTPResponse

func (response RequestSummarizedConfigurationsResponse) HTTPResponse() *http.Response

HTTPResponse implements the OCIResponse interface

func (RequestSummarizedConfigurationsResponse) String

func (response RequestSummarizedConfigurationsResponse) String() string

type RequestSummarizedUsagesDetails

RequestSummarizedUsagesDetails Details for the '/usage' query.

type RequestSummarizedUsagesDetails struct {

    // Tenant ID
    TenantId *string `mandatory:"true" json:"tenantId"`

    // The usage start time.
    TimeUsageStarted *common.SDKTime `mandatory:"true" json:"timeUsageStarted"`

    // The usage end time.
    TimeUsageEnded *common.SDKTime `mandatory:"true" json:"timeUsageEnded"`

    // The usage granularity.
    // HOURLY - Hourly data aggregation.
    // DAILY - Daily data aggregation.
    // MONTHLY - Monthly data aggregation.
    // TOTAL - Not yet supported.
    Granularity RequestSummarizedUsagesDetailsGranularityEnum `mandatory:"true" json:"granularity"`

    // The query usage type.
    // Usage - Query the usage data.
    // Cost - Query the cost/billing data.
    QueryType RequestSummarizedUsagesDetailsQueryTypeEnum `mandatory:"false" json:"queryType,omitempty"`

    // Aggregate the result by.
    // example:
    //   `["service"]`
    GroupBy []string `mandatory:"false" json:"groupBy"`

    // The compartment depth level.
    CompartmentDepth *float32 `mandatory:"false" json:"compartmentDepth"`

    Filter *Filter `mandatory:"false" json:"filter"`
}

func (RequestSummarizedUsagesDetails) String

func (m RequestSummarizedUsagesDetails) String() string

type RequestSummarizedUsagesDetailsGranularityEnum

RequestSummarizedUsagesDetailsGranularityEnum Enum with underlying type: string

type RequestSummarizedUsagesDetailsGranularityEnum string

Set of constants representing the allowable values for RequestSummarizedUsagesDetailsGranularityEnum

const (
    RequestSummarizedUsagesDetailsGranularityHourly  RequestSummarizedUsagesDetailsGranularityEnum = "HOURLY"
    RequestSummarizedUsagesDetailsGranularityDaily   RequestSummarizedUsagesDetailsGranularityEnum = "DAILY"
    RequestSummarizedUsagesDetailsGranularityMonthly RequestSummarizedUsagesDetailsGranularityEnum = "MONTHLY"
    RequestSummarizedUsagesDetailsGranularityTotal   RequestSummarizedUsagesDetailsGranularityEnum = "TOTAL"
)

func GetRequestSummarizedUsagesDetailsGranularityEnumValues

func GetRequestSummarizedUsagesDetailsGranularityEnumValues() []RequestSummarizedUsagesDetailsGranularityEnum

GetRequestSummarizedUsagesDetailsGranularityEnumValues Enumerates the set of values for RequestSummarizedUsagesDetailsGranularityEnum

type RequestSummarizedUsagesDetailsQueryTypeEnum

RequestSummarizedUsagesDetailsQueryTypeEnum Enum with underlying type: string

type RequestSummarizedUsagesDetailsQueryTypeEnum string

Set of constants representing the allowable values for RequestSummarizedUsagesDetailsQueryTypeEnum

const (
    RequestSummarizedUsagesDetailsQueryTypeUsage RequestSummarizedUsagesDetailsQueryTypeEnum = "USAGE"
    RequestSummarizedUsagesDetailsQueryTypeCost  RequestSummarizedUsagesDetailsQueryTypeEnum = "COST"
)

func GetRequestSummarizedUsagesDetailsQueryTypeEnumValues

func GetRequestSummarizedUsagesDetailsQueryTypeEnumValues() []RequestSummarizedUsagesDetailsQueryTypeEnum

GetRequestSummarizedUsagesDetailsQueryTypeEnumValues Enumerates the set of values for RequestSummarizedUsagesDetailsQueryTypeEnum

type RequestSummarizedUsagesRequest

RequestSummarizedUsagesRequest wrapper for the RequestSummarizedUsages operation

See also

Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/36.1.0/usageapi/RequestSummarizedUsages.go.html to see an example of how to use RequestSummarizedUsagesRequest.

type RequestSummarizedUsagesRequest struct {

    // getUsageRequest contains query inforamtion.
    RequestSummarizedUsagesDetails `contributesTo:"body"`

    // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
    // particular request, please provide the request ID.
    OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"`

    // The page token representing the page at which to start retrieving results.
    // This is usually retrieved from a previous list call.
    Page *string `mandatory:"false" contributesTo:"query" name:"page"`

    // The maximum number of items to return.
    Limit *int `mandatory:"false" contributesTo:"query" name:"limit"`

    // Metadata about the request. This information will not be transmitted to the service, but
    // represents information that the SDK will consume to drive retry behavior.
    RequestMetadata common.RequestMetadata
}

func (RequestSummarizedUsagesRequest) HTTPRequest

func (request RequestSummarizedUsagesRequest) HTTPRequest(method, path string) (http.Request, error)

HTTPRequest implements the OCIRequest interface

func (RequestSummarizedUsagesRequest) RetryPolicy

func (request RequestSummarizedUsagesRequest) RetryPolicy() *common.RetryPolicy

RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.

func (RequestSummarizedUsagesRequest) String

func (request RequestSummarizedUsagesRequest) String() string

type RequestSummarizedUsagesResponse

RequestSummarizedUsagesResponse wrapper for the RequestSummarizedUsages operation

type RequestSummarizedUsagesResponse struct {

    // The underlying http response
    RawResponse *http.Response

    // A list of UsageAggregation instances
    UsageAggregation `presentIn:"body"`

    // Unique Oracle-assigned identifier for the request. If you need to contact
    // Oracle about a particular request, please provide the request ID.
    OpcRequestId *string `presentIn:"header" name:"opc-request-id"`

    // For pagination of a list of items. When paging through a list, if this header appears in the response,
    // then a partial list might have been returned. Include this value as the `page` parameter for the
    // subsequent GET request to get the next batch of items.
    OpcNextPage *string `presentIn:"header" name:"opc-next-page"`
}

func (RequestSummarizedUsagesResponse) HTTPResponse

func (response RequestSummarizedUsagesResponse) HTTPResponse() *http.Response

HTTPResponse implements the OCIResponse interface

func (RequestSummarizedUsagesResponse) String

func (response RequestSummarizedUsagesResponse) String() string

type Tag

Tag The tag used for filtering.

type Tag struct {

    // The tag namespace.
    Namespace *string `mandatory:"false" json:"namespace"`

    // The tag key.
    Key *string `mandatory:"false" json:"key"`

    // The tag value.
    Value *string `mandatory:"false" json:"value"`
}

func (Tag) String

func (m Tag) String() string

type UsageAggregation

UsageAggregation The account (tenant) usage.

type UsageAggregation struct {

    // A list of usage items.
    Items []UsageSummary `mandatory:"true" json:"items"`

    // Aggregate the result by.
    GroupBy []string `mandatory:"false" json:"groupBy"`
}

func (UsageAggregation) String

func (m UsageAggregation) String() string

type UsageSummary

UsageSummary The usage store result.

type UsageSummary struct {

    // The usage start time.
    TimeUsageStarted *common.SDKTime `mandatory:"true" json:"timeUsageStarted"`

    // The usage end time.
    TimeUsageEnded *common.SDKTime `mandatory:"true" json:"timeUsageEnded"`

    // The tenancy OCID.
    TenantId *string `mandatory:"false" json:"tenantId"`

    // The tenancy name.
    TenantName *string `mandatory:"false" json:"tenantName"`

    // The compartment OCID.
    CompartmentId *string `mandatory:"false" json:"compartmentId"`

    // The compartment path, starting from root.
    CompartmentPath *string `mandatory:"false" json:"compartmentPath"`

    // The compartment name.
    CompartmentName *string `mandatory:"false" json:"compartmentName"`

    // The service name that is incurring the cost.
    Service *string `mandatory:"false" json:"service"`

    // The resource name that is incurring the cost.
    ResourceName *string `mandatory:"false" json:"resourceName"`

    // The resource OCID that is incurring the cost.
    ResourceId *string `mandatory:"false" json:"resourceId"`

    // The region of the usage.
    Region *string `mandatory:"false" json:"region"`

    // The availability domain of the usage.
    Ad *string `mandatory:"false" json:"ad"`

    // The resource size being metered.
    Weight *float32 `mandatory:"false" json:"weight"`

    // The resource shape.
    Shape *string `mandatory:"false" json:"shape"`

    // The SKU part number.
    SkuPartNumber *string `mandatory:"false" json:"skuPartNumber"`

    // The SKU friendly name.
    SkuName *string `mandatory:"false" json:"skuName"`

    // The usage unit.
    Unit *string `mandatory:"false" json:"unit"`

    // The discretionary discount applied to the SKU.
    Discount *float32 `mandatory:"false" json:"discount"`

    // The SKU list rate (not discount).
    ListRate *float32 `mandatory:"false" json:"listRate"`

    // Platform for the cost.
    Platform *string `mandatory:"false" json:"platform"`

    // The computed cost.
    ComputedAmount *float32 `mandatory:"false" json:"computedAmount"`

    // The usage number.
    ComputedQuantity *float32 `mandatory:"false" json:"computedQuantity"`

    // The SPM OverageFlag.
    OveragesFlag *string `mandatory:"false" json:"overagesFlag"`

    // The price per unit.
    UnitPrice *float32 `mandatory:"false" json:"unitPrice"`

    // The price currency.
    Currency *string `mandatory:"false" json:"currency"`

    // The subscription ID.
    SubscriptionId *string `mandatory:"false" json:"subscriptionId"`

    // The overage usage.
    Overage *string `mandatory:"false" json:"overage"`

    // For grouping, a tag definition. For filtering, a definition and key.
    Tags []Tag `mandatory:"false" json:"tags"`
}

func (UsageSummary) String

func (m UsageSummary) String() string

type UsageapiClient

UsageapiClient a client for Usageapi

type UsageapiClient struct {
    common.BaseClient
    // contains filtered or unexported fields
}

func NewUsageapiClientWithConfigurationProvider

func NewUsageapiClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client UsageapiClient, err error)

NewUsageapiClientWithConfigurationProvider Creates a new default Usageapi client with the given configuration provider. the configuration provider will be used for the default signer as well as reading the region

func NewUsageapiClientWithOboToken

func NewUsageapiClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client UsageapiClient, err error)

NewUsageapiClientWithOboToken Creates a new default Usageapi client with the given configuration provider. The obotoken will be added to default headers and signed; the configuration provider will be used for the signer

as well as reading the region

func (*UsageapiClient) ConfigurationProvider

func (client *UsageapiClient) ConfigurationProvider() *common.ConfigurationProvider

ConfigurationProvider the ConfigurationProvider used in this client, or null if none set

func (UsageapiClient) RequestSummarizedConfigurations

func (client UsageapiClient) RequestSummarizedConfigurations(ctx context.Context, request RequestSummarizedConfigurationsRequest) (response RequestSummarizedConfigurationsResponse, err error)

RequestSummarizedConfigurations Returns the configurations list for the UI drop-down list.

See also

Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/36.1.0/usageapi/RequestSummarizedConfigurations.go.html to see an example of how to use RequestSummarizedConfigurations API.

func (UsageapiClient) RequestSummarizedUsages

func (client UsageapiClient) RequestSummarizedUsages(ctx context.Context, request RequestSummarizedUsagesRequest) (response RequestSummarizedUsagesResponse, err error)

RequestSummarizedUsages Returns usage for the given account.

See also

Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/36.1.0/usageapi/RequestSummarizedUsages.go.html to see an example of how to use RequestSummarizedUsages API.

func (*UsageapiClient) SetRegion

func (client *UsageapiClient) SetRegion(region string)

SetRegion overrides the region of this client.