Documentation ¶
Index ¶
- type CostRecord
- type GetSubscriptionInfoRequest
- type GetSubscriptionInfoResponse
- type ListUsageRecordsGranularityEnum
- type ListUsageRecordsRequest
- type ListUsageRecordsResponse
- type SubscriptionInfo
- type UsageClient
- func (client *UsageClient) ConfigurationProvider() *common.ConfigurationProvider
- func (client UsageClient) GetSubscriptionInfo(ctx context.Context, request GetSubscriptionInfoRequest) (response GetSubscriptionInfoResponse, err error)
- func (client UsageClient) ListUsageRecords(ctx context.Context, request ListUsageRecordsRequest) (response ListUsageRecordsResponse, err error)
- func (client *UsageClient) SetRegion(region string)
- type UsageRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CostRecord ¶
type CostRecord struct { // The type of cost. Note that this property is not available for filtered queries (by compartmentId or cost tracking tag). ComputeType *string `mandatory:"false" json:"computeType"` // The amount of usage of the target resource (measured in {displayUnitName} units). ComputedQuantity *float32 `mandatory:"false" json:"computedQuantity"` // The cost of the target resource (measured in {currency} currency). ComputedAmount *float32 `mandatory:"false" json:"computedAmount"` // The unit price. Note that this property is not available for filtered queries (by compartmentId or cost tracking tag). UnitPrice *float32 `mandatory:"false" json:"unitPrice"` }
CostRecord Object describing the cost and the usage for a specific resource type within the defined time interval.
func (CostRecord) String ¶
func (m CostRecord) String() string
type GetSubscriptionInfoRequest ¶
type GetSubscriptionInfoRequest struct { // The OCID of the tenancy for which usage data is fetched. TenancyId *string `mandatory:"true" contributesTo:"path" name:"tenancyId"` // 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 }
GetSubscriptionInfoRequest wrapper for the GetSubscriptionInfo operation
func (GetSubscriptionInfoRequest) HTTPRequest ¶
func (request GetSubscriptionInfoRequest) HTTPRequest(method, path string) (http.Request, error)
HTTPRequest implements the OCIRequest interface
func (GetSubscriptionInfoRequest) RetryPolicy ¶
func (request GetSubscriptionInfoRequest) RetryPolicy() *common.RetryPolicy
RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
func (GetSubscriptionInfoRequest) String ¶
func (request GetSubscriptionInfoRequest) String() string
type GetSubscriptionInfoResponse ¶
type GetSubscriptionInfoResponse struct { // The underlying http response RawResponse *http.Response // The SubscriptionInfo instance SubscriptionInfo `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"` }
GetSubscriptionInfoResponse wrapper for the GetSubscriptionInfo operation
func (GetSubscriptionInfoResponse) HTTPResponse ¶
func (response GetSubscriptionInfoResponse) HTTPResponse() *http.Response
HTTPResponse implements the OCIResponse interface
func (GetSubscriptionInfoResponse) String ¶
func (response GetSubscriptionInfoResponse) String() string
type ListUsageRecordsGranularityEnum ¶
type ListUsageRecordsGranularityEnum string
ListUsageRecordsGranularityEnum Enum with underlying type: string
const ( ListUsageRecordsGranularityHourly ListUsageRecordsGranularityEnum = "HOURLY" ListUsageRecordsGranularityDaily ListUsageRecordsGranularityEnum = "DAILY" ListUsageRecordsGranularityMonthly ListUsageRecordsGranularityEnum = "MONTHLY" )
Set of constants representing the allowable values for ListUsageRecordsGranularityEnum
func GetListUsageRecordsGranularityEnumValues ¶
func GetListUsageRecordsGranularityEnumValues() []ListUsageRecordsGranularityEnum
GetListUsageRecordsGranularityEnumValues Enumerates the set of values for ListUsageRecordsGranularityEnum
type ListUsageRecordsRequest ¶
type ListUsageRecordsRequest struct { // The OCID of the tenancy for which usage is being fetched. TenancyId *string `mandatory:"true" contributesTo:"path" name:"tenancyId"` // Start time (UTC) of the target date range for which to fetch usage data (inclusive). StartTime *common.SDKTime `mandatory:"true" contributesTo:"query" name:"startTime"` // End time (UTC) of the target date range for which to fetch usage data (exclusive). EndTime *common.SDKTime `mandatory:"true" contributesTo:"query" name:"endTime"` // The aggregation period for the usage data. Granularity ListUsageRecordsGranularityEnum `mandatory:"true" contributesTo:"query" name:"granularity" omitEmpty:"true"` // Optional parameter to filter the data to a specific compartment only. // Note that this parameter cannot be combined with the `tag` parameter. CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` // Optional parameter to filter the data to a specific cost-tracking tag only. // Note that this parameter cannot be combined with the `compartmentId` parameter. Tag *string `mandatory:"false" contributesTo:"query" name:"tag"` // 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"` // Reserved parameter for supporting pagination in the future. Page *string `mandatory:"false" contributesTo:"query" name:"page"` // 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 }
ListUsageRecordsRequest wrapper for the ListUsageRecords operation
func (ListUsageRecordsRequest) HTTPRequest ¶
func (request ListUsageRecordsRequest) HTTPRequest(method, path string) (http.Request, error)
HTTPRequest implements the OCIRequest interface
func (ListUsageRecordsRequest) RetryPolicy ¶
func (request ListUsageRecordsRequest) RetryPolicy() *common.RetryPolicy
RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy.
func (ListUsageRecordsRequest) String ¶
func (request ListUsageRecordsRequest) String() string
type ListUsageRecordsResponse ¶
type ListUsageRecordsResponse struct { // The underlying http response RawResponse *http.Response // A list of []UsageRecord instances Items []UsageRecord `presentIn:"body"` // Reserved header for supporting pagination in the future. OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // 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"` }
ListUsageRecordsResponse wrapper for the ListUsageRecords operation
func (ListUsageRecordsResponse) HTTPResponse ¶
func (response ListUsageRecordsResponse) HTTPResponse() *http.Response
HTTPResponse implements the OCIResponse interface
func (ListUsageRecordsResponse) String ¶
func (response ListUsageRecordsResponse) String() string
type SubscriptionInfo ¶
type SubscriptionInfo struct { // The OCID of the target tenancy. TenancyId *string `mandatory:"false" json:"tenancyId"` // The billing cycle start date (UTC), in the format specified by RFC3339 (https://tools.ietf.org/html/rfc3339). BillStart *common.SDKTime `mandatory:"false" json:"billStart"` // The billing cycle end date (UTC), in the format specified by RFC3339 (https://tools.ietf.org/html/rfc3339). BillEnd *common.SDKTime `mandatory:"false" json:"billEnd"` // Total balance for the billing cycle. BillTotalBalance *float32 `mandatory:"false" json:"billTotalBalance"` // Total available credit for the billing cycle. BillTotalPurchased *float32 `mandatory:"false" json:"billTotalPurchased"` // Date and time (UTC) the balance was last modified. BillModifiedTime *common.SDKTime `mandatory:"false" json:"billModifiedTime"` // The currency of the subscription, in the format specified by ISO-4217 (https://www.iso.org/iso-4217-currency-codes.html). BillCurrency *string `mandatory:"false" json:"billCurrency"` }
SubscriptionInfo The response object for the GetSubscriptionInfo API call. It provides information about the specified billing cycle.
func (SubscriptionInfo) String ¶
func (m SubscriptionInfo) String() string
type UsageClient ¶
type UsageClient struct { common.BaseClient // contains filtered or unexported fields }
UsageClient a client for Usage
func NewUsageClientWithConfigurationProvider ¶
func NewUsageClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client UsageClient, err error)
NewUsageClientWithConfigurationProvider Creates a new default Usage client with the given configuration provider. the configuration provider will be used for the default signer as well as reading the region
func NewUsageClientWithOboToken ¶
func NewUsageClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client UsageClient, err error)
NewUsageClientWithOboToken Creates a new default Usage 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 (*UsageClient) ConfigurationProvider ¶
func (client *UsageClient) ConfigurationProvider() *common.ConfigurationProvider
ConfigurationProvider the ConfigurationProvider used in this client, or null if none set
func (UsageClient) GetSubscriptionInfo ¶
func (client UsageClient) GetSubscriptionInfo(ctx context.Context, request GetSubscriptionInfoRequest) (response GetSubscriptionInfoResponse, err error)
GetSubscriptionInfo Returns the subscription information for the specified tenancy. > **Important**: Call to this API will only succeed against the endpoint in the home region or the tenancy.
func (UsageClient) ListUsageRecords ¶
func (client UsageClient) ListUsageRecords(ctx context.Context, request ListUsageRecordsRequest) (response ListUsageRecordsResponse, err error)
ListUsageRecords Returns the usage data and date range for the given tenancy, including cost information broken out by a specified granularity. Depending on the granularity, the date range cannot be higher than
- for DAILY/MONTHLY => 1 month
- for HOURLY => 1 day
> **Important**: Call to this API will only succeed against the endpoint in the home region.
func (*UsageClient) SetRegion ¶
func (client *UsageClient) SetRegion(region string)
SetRegion overrides the region of this client.
type UsageRecord ¶
type UsageRecord struct { // The start time (UTC) of the interval for which this usage record belongs (inclusive). StartTime *common.SDKTime `mandatory:"false" json:"startTime"` // The end time (UTC) of the interval for which this usage record belongs (exclusive). EndTime *common.SDKTime `mandatory:"false" json:"endTime"` // The name of the internal resource type. InternalResourceName *string `mandatory:"false" json:"internalResourceName"` // The human-readable, friendly name of the resource type. DisplayResourceName *string `mandatory:"false" json:"displayResourceName"` // The unit type of the resource that is being measured. DisplayUnitName *string `mandatory:"false" json:"displayUnitName"` // The human-readable, friendly name of the service. ServiceName *string `mandatory:"false" json:"serviceName"` // The currency of the cost value, in the format specified by ISO-4217 (https://www.iso.org/iso-4217-currency-codes.html). Currency *string `mandatory:"false" json:"currency"` // The product identifier, or skuId. GsiProductId *string `mandatory:"false" json:"gsiProductId"` // A list of the actual costs and usage amounts for the target resource type within the // defined time interval (startTime to endTime). Costs []CostRecord `mandatory:"false" json:"costs"` }
UsageRecord A record of a specific range of usage, including cost for the specified resource type for the specified time interval.
func (UsageRecord) String ¶
func (m UsageRecord) String() string