UNPKG

@ibm-cloud/platform-services

Version:

Node.js client library for IBM Cloud Platform Services

987 lines (986 loc) 68.5 kB
/** * (C) Copyright IBM Corp. 2025. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /// <reference types="node" /> import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http'; import { AbortSignal, BaseService, UserOptions } from 'ibm-cloud-sdk-core'; /** * Usage reports for IBM Cloud accounts * * API Version: 4.0.6 */ declare class UsageReportsV4 extends BaseService { static DEFAULT_SERVICE_URL: string; static DEFAULT_SERVICE_NAME: string; /************************* * Factory method ************************/ /** * Constructs an instance of UsageReportsV4 with passed in options and external configuration. * * @param {UserOptions} [options] - The parameters to send to the service. * @param {string} [options.serviceName] - The name of the service to configure * @param {Authenticator} [options.authenticator] - The Authenticator object used to authenticate requests to the service * @param {string} [options.serviceUrl] - The base URL for the service * @returns {UsageReportsV4} */ static newInstance(options: UserOptions): UsageReportsV4; /** * Construct a UsageReportsV4 object. * * @param {Object} options - Options for the service. * @param {string} [options.serviceUrl] - The base URL for the service * @param {OutgoingHttpHeaders} [options.headers] - Default headers that shall be included with every request to the service. * @param {Authenticator} options.authenticator - The Authenticator object used to authenticate requests to the service * @constructor * @returns {UsageReportsV4} */ constructor(options: UserOptions); /************************* * accountOperations ************************/ /** * Get account summary. * * Returns the summary for the account for a given month. Account billing managers are authorized to access this * report. * * @param {Object} params - The parameters to send to the service. * @param {string} params.accountId - Account ID for which the usage report is requested. * @param {string} params.billingmonth - The billing month for which the usage report is requested. Format is * yyyy-mm. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<UsageReportsV4.Response<UsageReportsV4.AccountSummary>>} */ getAccountSummary(params: UsageReportsV4.GetAccountSummaryParams): Promise<UsageReportsV4.Response<UsageReportsV4.AccountSummary>>; /** * Get account usage. * * Usage for all the resources and plans in an account for a given month. Account billing managers are authorized to * access this report. * * @param {Object} params - The parameters to send to the service. * @param {string} params.accountId - Account ID for which the usage report is requested. * @param {string} params.billingmonth - The billing month for which the usage report is requested. Format is * yyyy-mm. * @param {boolean} [params.names] - Include the name of every resource, plan, resource instance, organization, and * resource group. * @param {string} [params.acceptLanguage] - Prioritize the names returned in the order of the specified languages. * Language will default to English. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<UsageReportsV4.Response<UsageReportsV4.AccountUsage>>} */ getAccountUsage(params: UsageReportsV4.GetAccountUsageParams): Promise<UsageReportsV4.Response<UsageReportsV4.AccountUsage>>; /************************* * resourceOperations ************************/ /** * Get resource group usage. * * Usage for all the resources and plans in a resource group in a given month. Account billing managers or resource * group billing managers are authorized to access this report. * * @param {Object} params - The parameters to send to the service. * @param {string} params.accountId - Account ID for which the usage report is requested. * @param {string} params.resourceGroupId - Resource group for which the usage report is requested. * @param {string} params.billingmonth - The billing month for which the usage report is requested. Format is * yyyy-mm. * @param {boolean} [params.names] - Include the name of every resource, plan, resource instance, organization, and * resource group. * @param {string} [params.acceptLanguage] - Prioritize the names returned in the order of the specified languages. * Language will default to English. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<UsageReportsV4.Response<UsageReportsV4.ResourceGroupUsage>>} */ getResourceGroupUsage(params: UsageReportsV4.GetResourceGroupUsageParams): Promise<UsageReportsV4.Response<UsageReportsV4.ResourceGroupUsage>>; /** * Get resource instance usage in an account. * * Query for resource instance usage in an account. Filter the results with query parameters. Account billing * administrator is authorized to access this report. * * @param {Object} params - The parameters to send to the service. * @param {string} params.accountId - Account ID for which the usage report is requested. * @param {string} params.billingmonth - The billing month for which the usage report is requested. Format is * yyyy-mm. * @param {boolean} [params.names] - Include the name of every resource, plan, resource instance, organization, and * resource group. * @param {boolean} [params.tags] - Include the tags associated with every resource instance. By default it is always * `true`. * @param {string} [params.acceptLanguage] - Prioritize the names returned in the order of the specified languages. * Language will default to English. * @param {number} [params.limit] - Number of usage records returned. The default value is 30. Maximum value is 200. * @param {string} [params.start] - The offset from which the records must be fetched. Offset information is included * in the response. * @param {string} [params.resourceGroupId] - Filter by resource group. * @param {string} [params.organizationId] - Filter by organization_id. * @param {string} [params.resourceInstanceId] - Filter by resource instance_id. * @param {string} [params.resourceId] - Filter by resource_id. * @param {string} [params.planId] - Filter by plan_id. * @param {string} [params.region] - Region in which the resource instance is provisioned. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<UsageReportsV4.Response<UsageReportsV4.InstancesUsage>>} */ getResourceUsageAccount(params: UsageReportsV4.GetResourceUsageAccountParams): Promise<UsageReportsV4.Response<UsageReportsV4.InstancesUsage>>; /** * Get resource instance usage in a resource group. * * Query for resource instance usage in a resource group. Filter the results with query parameters. Account billing * administrator and resource group billing administrators are authorized to access this report. * * @param {Object} params - The parameters to send to the service. * @param {string} params.accountId - Account ID for which the usage report is requested. * @param {string} params.resourceGroupId - Resource group for which the usage report is requested. * @param {string} params.billingmonth - The billing month for which the usage report is requested. Format is * yyyy-mm. * @param {boolean} [params.names] - Include the name of every resource, plan, resource instance, organization, and * resource group. * @param {boolean} [params.tags] - Include the tags associated with every resource instance. By default it is always * `true`. * @param {string} [params.acceptLanguage] - Prioritize the names returned in the order of the specified languages. * Language will default to English. * @param {number} [params.limit] - Number of usage records returned. The default value is 30. Maximum value is 200. * @param {string} [params.start] - The offset from which the records must be fetched. Offset information is included * in the response. * @param {string} [params.resourceInstanceId] - Filter by resource instance id. * @param {string} [params.resourceId] - Filter by resource_id. * @param {string} [params.planId] - Filter by plan_id. * @param {string} [params.region] - Region in which the resource instance is provisioned. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<UsageReportsV4.Response<UsageReportsV4.InstancesUsage>>} */ getResourceUsageResourceGroup(params: UsageReportsV4.GetResourceUsageResourceGroupParams): Promise<UsageReportsV4.Response<UsageReportsV4.InstancesUsage>>; /** * Get resource instance usage in an organization. * * Query for resource instance usage in an organization. Filter the results with query parameters. Account billing * administrator and organization billing administrators are authorized to access this report. * * @param {Object} params - The parameters to send to the service. * @param {string} params.accountId - Account ID for which the usage report is requested. * @param {string} params.organizationId - ID of the organization. * @param {string} params.billingmonth - The billing month for which the usage report is requested. Format is * yyyy-mm. * @param {boolean} [params.names] - Include the name of every resource, plan, resource instance, organization, and * resource group. * @param {boolean} [params.tags] - Include the tags associated with every resource instance. By default it is always * `true`. * @param {string} [params.acceptLanguage] - Prioritize the names returned in the order of the specified languages. * Language will default to English. * @param {number} [params.limit] - Number of usage records returned. The default value is 30. Maximum value is 200. * @param {string} [params.start] - The offset from which the records must be fetched. Offset information is included * in the response. * @param {string} [params.resourceInstanceId] - Filter by resource instance id. * @param {string} [params.resourceId] - Filter by resource_id. * @param {string} [params.planId] - Filter by plan_id. * @param {string} [params.region] - Region in which the resource instance is provisioned. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<UsageReportsV4.Response<UsageReportsV4.InstancesUsage>>} */ getResourceUsageOrg(params: UsageReportsV4.GetResourceUsageOrgParams): Promise<UsageReportsV4.Response<UsageReportsV4.InstancesUsage>>; /************************* * organizationOperations ************************/ /** * Get organization usage. * * Usage for all the resources and plans in an organization in a given month. Account billing managers or organization * billing managers are authorized to access this report. * * @param {Object} params - The parameters to send to the service. * @param {string} params.accountId - Account ID for which the usage report is requested. * @param {string} params.organizationId - ID of the organization. * @param {string} params.billingmonth - The billing month for which the usage report is requested. Format is * yyyy-mm. * @param {boolean} [params.names] - Include the name of every resource, plan, resource instance, organization, and * resource group. * @param {string} [params.acceptLanguage] - Prioritize the names returned in the order of the specified languages. * Language will default to English. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<UsageReportsV4.Response<UsageReportsV4.OrgUsage>>} */ getOrgUsage(params: UsageReportsV4.GetOrgUsageParams): Promise<UsageReportsV4.Response<UsageReportsV4.OrgUsage>>; /************************* * billingReportsSnapshot ************************/ /** * Setup the snapshot configuration. * * Snapshots of the billing reports would be taken on a periodic interval and stored based on the configuration setup * by the customer for the given Account Id. * * @param {Object} params - The parameters to send to the service. * @param {string} params.accountId - Account ID for which billing report snapshot is configured. * @param {string} params.interval - Frequency of taking the snapshot of the billing reports. * @param {string} params.cosBucket - The name of the COS bucket to store the snapshot of the billing reports. * @param {string} params.cosLocation - Region of the COS instance. * @param {string} [params.cosReportsFolder] - The billing reports root folder to store the billing reports snapshots. * Defaults to "IBMCloud-Billing-Reports". * @param {string[]} [params.reportTypes] - The type of billing reports to take snapshot of. Possible values are * [account_summary, enterprise_summary, account_resource_instance_usage]. * @param {string} [params.versioning] - A new version of report is created or the existing report version is * overwritten with every update. Defaults to "new". * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<UsageReportsV4.Response<UsageReportsV4.SnapshotConfig>>} */ createReportsSnapshotConfig(params: UsageReportsV4.CreateReportsSnapshotConfigParams): Promise<UsageReportsV4.Response<UsageReportsV4.SnapshotConfig>>; /** * Fetch the snapshot configuration. * * Returns the configuration of snapshot of the billing reports setup by the customer for the given Account Id. * * @param {Object} params - The parameters to send to the service. * @param {string} params.accountId - Account ID for which the billing report snapshot is configured. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<UsageReportsV4.Response<UsageReportsV4.SnapshotConfig>>} */ getReportsSnapshotConfig(params: UsageReportsV4.GetReportsSnapshotConfigParams): Promise<UsageReportsV4.Response<UsageReportsV4.SnapshotConfig>>; /** * Update the snapshot configuration. * * Updates the configuration of snapshot of the billing reports setup by the customer for the given Account Id. * * @param {Object} params - The parameters to send to the service. * @param {string} params.accountId - Account ID for which billing report snapshot is configured. * @param {string} [params.interval] - Frequency of taking the snapshot of the billing reports. * @param {string} [params.cosBucket] - The name of the COS bucket to store the snapshot of the billing reports. * @param {string} [params.cosLocation] - Region of the COS instance. * @param {string} [params.cosReportsFolder] - The billing reports root folder to store the billing reports snapshots. * @param {string[]} [params.reportTypes] - The type of billing reports to take snapshot of. Possible values are * [account_summary, enterprise_summary, account_resource_instance_usage]. * @param {string} [params.versioning] - A new version of report is created or the existing report version is * overwritten with every update. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<UsageReportsV4.Response<UsageReportsV4.SnapshotConfig>>} */ updateReportsSnapshotConfig(params: UsageReportsV4.UpdateReportsSnapshotConfigParams): Promise<UsageReportsV4.Response<UsageReportsV4.SnapshotConfig>>; /** * Delete the snapshot configuration. * * Delete the configuration of snapshot of the billing reports setup by the customer for the given Account Id. * * @param {Object} params - The parameters to send to the service. * @param {string} params.accountId - Account ID for which the billing report snapshot is configured. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<UsageReportsV4.Response<UsageReportsV4.EmptyObject>>} */ deleteReportsSnapshotConfig(params: UsageReportsV4.DeleteReportsSnapshotConfigParams): Promise<UsageReportsV4.Response<UsageReportsV4.EmptyObject>>; /** * Verify billing to COS authorization. * * Verify billing service to COS bucket authorization for the given account_id. If COS bucket information is not * provided, COS bucket information is retrieved from the configuration file. * * @param {Object} params - The parameters to send to the service. * @param {string} params.accountId - Account ID for which billing report snapshot is configured. * @param {string} [params.interval] - Frequency of taking the snapshot of the billing reports. * @param {string} [params.cosBucket] - The name of the COS bucket to store the snapshot of the billing reports. * @param {string} [params.cosLocation] - Region of the COS instance. * @param {string} [params.cosReportsFolder] - The billing reports root folder to store the billing reports snapshots. * Defaults to "IBMCloud-Billing-Reports". * @param {string[]} [params.reportTypes] - The type of billing reports to take snapshot of. Possible values are * [account_summary, enterprise_summary, account_resource_instance_usage]. * @param {string} [params.versioning] - A new version of report is created or the existing report version is * overwritten with every update. Defaults to "new". * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<UsageReportsV4.Response<UsageReportsV4.SnapshotConfigValidateResponse>>} */ validateReportsSnapshotConfig(params: UsageReportsV4.ValidateReportsSnapshotConfigParams): Promise<UsageReportsV4.Response<UsageReportsV4.SnapshotConfigValidateResponse>>; /** * Fetch the current or past snapshots. * * Returns the billing reports snapshots captured for the given Account Id in the specific time period. * * @param {Object} params - The parameters to send to the service. * @param {string} params.accountId - Account ID for which the billing report snapshot is requested. * @param {string} params.month - The month for which billing report snapshot is requested. Format is yyyy-mm. * @param {number} [params.dateFrom] - Timestamp in milliseconds for which billing report snapshot is requested. * @param {number} [params.dateTo] - Timestamp in milliseconds for which billing report snapshot is requested. * @param {number} [params.limit] - Number of usage records returned. The default value is 30. Maximum value is 200. * @param {string} [params.start] - The offset from which the records must be fetched. Offset information is included * in the response. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers * @returns {Promise<UsageReportsV4.Response<UsageReportsV4.SnapshotList>>} */ getReportsSnapshot(params: UsageReportsV4.GetReportsSnapshotParams): Promise<UsageReportsV4.Response<UsageReportsV4.SnapshotList>>; } /************************* * interfaces ************************/ declare namespace UsageReportsV4 { /** An operation response. */ export interface Response<T = any> { result: T; status: number; statusText: string; headers: IncomingHttpHeaders; } /** The callback for a service request. */ export type Callback<T> = (error: any, response?: Response<T>) => void; /** The body of a service request that returns no response data. */ export interface EmptyObject { } /** A standard JS object, defined to avoid the limitations of `Object` and `object` */ export interface JsonObject { [key: string]: any; } /************************* * request interfaces ************************/ interface DefaultParams { headers?: OutgoingHttpHeaders; signal?: AbortSignal; } /** Parameters for the `getAccountSummary` operation. */ export interface GetAccountSummaryParams extends DefaultParams { /** Account ID for which the usage report is requested. */ accountId: string; /** The billing month for which the usage report is requested. Format is yyyy-mm. */ billingmonth: string; } /** Parameters for the `getAccountUsage` operation. */ export interface GetAccountUsageParams extends DefaultParams { /** Account ID for which the usage report is requested. */ accountId: string; /** The billing month for which the usage report is requested. Format is yyyy-mm. */ billingmonth: string; /** Include the name of every resource, plan, resource instance, organization, and resource group. */ names?: boolean; /** Prioritize the names returned in the order of the specified languages. Language will default to English. */ acceptLanguage?: string; } /** Parameters for the `getResourceGroupUsage` operation. */ export interface GetResourceGroupUsageParams extends DefaultParams { /** Account ID for which the usage report is requested. */ accountId: string; /** Resource group for which the usage report is requested. */ resourceGroupId: string; /** The billing month for which the usage report is requested. Format is yyyy-mm. */ billingmonth: string; /** Include the name of every resource, plan, resource instance, organization, and resource group. */ names?: boolean; /** Prioritize the names returned in the order of the specified languages. Language will default to English. */ acceptLanguage?: string; } /** Parameters for the `getResourceUsageAccount` operation. */ export interface GetResourceUsageAccountParams extends DefaultParams { /** Account ID for which the usage report is requested. */ accountId: string; /** The billing month for which the usage report is requested. Format is yyyy-mm. */ billingmonth: string; /** Include the name of every resource, plan, resource instance, organization, and resource group. */ names?: boolean; /** Include the tags associated with every resource instance. By default it is always `true`. */ tags?: boolean; /** Prioritize the names returned in the order of the specified languages. Language will default to English. */ acceptLanguage?: string; /** Number of usage records returned. The default value is 30. Maximum value is 200. */ limit?: number; /** The offset from which the records must be fetched. Offset information is included in the response. */ start?: string; /** Filter by resource group. */ resourceGroupId?: string; /** Filter by organization_id. */ organizationId?: string; /** Filter by resource instance_id. */ resourceInstanceId?: string; /** Filter by resource_id. */ resourceId?: string; /** Filter by plan_id. */ planId?: string; /** Region in which the resource instance is provisioned. */ region?: string; } /** Parameters for the `getResourceUsageResourceGroup` operation. */ export interface GetResourceUsageResourceGroupParams extends DefaultParams { /** Account ID for which the usage report is requested. */ accountId: string; /** Resource group for which the usage report is requested. */ resourceGroupId: string; /** The billing month for which the usage report is requested. Format is yyyy-mm. */ billingmonth: string; /** Include the name of every resource, plan, resource instance, organization, and resource group. */ names?: boolean; /** Include the tags associated with every resource instance. By default it is always `true`. */ tags?: boolean; /** Prioritize the names returned in the order of the specified languages. Language will default to English. */ acceptLanguage?: string; /** Number of usage records returned. The default value is 30. Maximum value is 200. */ limit?: number; /** The offset from which the records must be fetched. Offset information is included in the response. */ start?: string; /** Filter by resource instance id. */ resourceInstanceId?: string; /** Filter by resource_id. */ resourceId?: string; /** Filter by plan_id. */ planId?: string; /** Region in which the resource instance is provisioned. */ region?: string; } /** Parameters for the `getResourceUsageOrg` operation. */ export interface GetResourceUsageOrgParams extends DefaultParams { /** Account ID for which the usage report is requested. */ accountId: string; /** ID of the organization. */ organizationId: string; /** The billing month for which the usage report is requested. Format is yyyy-mm. */ billingmonth: string; /** Include the name of every resource, plan, resource instance, organization, and resource group. */ names?: boolean; /** Include the tags associated with every resource instance. By default it is always `true`. */ tags?: boolean; /** Prioritize the names returned in the order of the specified languages. Language will default to English. */ acceptLanguage?: string; /** Number of usage records returned. The default value is 30. Maximum value is 200. */ limit?: number; /** The offset from which the records must be fetched. Offset information is included in the response. */ start?: string; /** Filter by resource instance id. */ resourceInstanceId?: string; /** Filter by resource_id. */ resourceId?: string; /** Filter by plan_id. */ planId?: string; /** Region in which the resource instance is provisioned. */ region?: string; } /** Parameters for the `getOrgUsage` operation. */ export interface GetOrgUsageParams extends DefaultParams { /** Account ID for which the usage report is requested. */ accountId: string; /** ID of the organization. */ organizationId: string; /** The billing month for which the usage report is requested. Format is yyyy-mm. */ billingmonth: string; /** Include the name of every resource, plan, resource instance, organization, and resource group. */ names?: boolean; /** Prioritize the names returned in the order of the specified languages. Language will default to English. */ acceptLanguage?: string; } /** Parameters for the `createReportsSnapshotConfig` operation. */ export interface CreateReportsSnapshotConfigParams extends DefaultParams { /** Account ID for which billing report snapshot is configured. */ accountId: string; /** Frequency of taking the snapshot of the billing reports. */ interval: CreateReportsSnapshotConfigConstants.Interval | string; /** The name of the COS bucket to store the snapshot of the billing reports. */ cosBucket: string; /** Region of the COS instance. */ cosLocation: string; /** The billing reports root folder to store the billing reports snapshots. Defaults to * "IBMCloud-Billing-Reports". */ cosReportsFolder?: string; /** The type of billing reports to take snapshot of. Possible values are [account_summary, enterprise_summary, * account_resource_instance_usage]. */ reportTypes?: CreateReportsSnapshotConfigConstants.ReportTypes[] | string[]; /** A new version of report is created or the existing report version is overwritten with every update. Defaults * to "new". */ versioning?: CreateReportsSnapshotConfigConstants.Versioning | string; } /** Constants for the `createReportsSnapshotConfig` operation. */ export namespace CreateReportsSnapshotConfigConstants { /** Frequency of taking the snapshot of the billing reports. */ enum Interval { DAILY = "daily" } /** ReportTypes */ enum ReportTypes { ACCOUNT_SUMMARY = "account_summary", ENTERPRISE_SUMMARY = "enterprise_summary", ACCOUNT_RESOURCE_INSTANCE_USAGE = "account_resource_instance_usage" } /** A new version of report is created or the existing report version is overwritten with every update. Defaults to "new". */ enum Versioning { NEW = "new", OVERWRITE = "overwrite" } } /** Parameters for the `getReportsSnapshotConfig` operation. */ export interface GetReportsSnapshotConfigParams extends DefaultParams { /** Account ID for which the billing report snapshot is configured. */ accountId: string; } /** Parameters for the `updateReportsSnapshotConfig` operation. */ export interface UpdateReportsSnapshotConfigParams extends DefaultParams { /** Account ID for which billing report snapshot is configured. */ accountId: string; /** Frequency of taking the snapshot of the billing reports. */ interval?: UpdateReportsSnapshotConfigConstants.Interval | string; /** The name of the COS bucket to store the snapshot of the billing reports. */ cosBucket?: string; /** Region of the COS instance. */ cosLocation?: string; /** The billing reports root folder to store the billing reports snapshots. */ cosReportsFolder?: string; /** The type of billing reports to take snapshot of. Possible values are [account_summary, enterprise_summary, * account_resource_instance_usage]. */ reportTypes?: UpdateReportsSnapshotConfigConstants.ReportTypes[] | string[]; /** A new version of report is created or the existing report version is overwritten with every update. */ versioning?: UpdateReportsSnapshotConfigConstants.Versioning | string; } /** Constants for the `updateReportsSnapshotConfig` operation. */ export namespace UpdateReportsSnapshotConfigConstants { /** Frequency of taking the snapshot of the billing reports. */ enum Interval { DAILY = "daily" } /** ReportTypes */ enum ReportTypes { ACCOUNT_SUMMARY = "account_summary", ENTERPRISE_SUMMARY = "enterprise_summary", ACCOUNT_RESOURCE_INSTANCE_USAGE = "account_resource_instance_usage" } /** A new version of report is created or the existing report version is overwritten with every update. */ enum Versioning { NEW = "new", OVERWRITE = "overwrite" } } /** Parameters for the `deleteReportsSnapshotConfig` operation. */ export interface DeleteReportsSnapshotConfigParams extends DefaultParams { /** Account ID for which the billing report snapshot is configured. */ accountId: string; } /** Parameters for the `validateReportsSnapshotConfig` operation. */ export interface ValidateReportsSnapshotConfigParams extends DefaultParams { /** Account ID for which billing report snapshot is configured. */ accountId: string; /** Frequency of taking the snapshot of the billing reports. */ interval?: ValidateReportsSnapshotConfigConstants.Interval | string; /** The name of the COS bucket to store the snapshot of the billing reports. */ cosBucket?: string; /** Region of the COS instance. */ cosLocation?: string; /** The billing reports root folder to store the billing reports snapshots. Defaults to * "IBMCloud-Billing-Reports". */ cosReportsFolder?: string; /** The type of billing reports to take snapshot of. Possible values are [account_summary, enterprise_summary, * account_resource_instance_usage]. */ reportTypes?: ValidateReportsSnapshotConfigConstants.ReportTypes[] | string[]; /** A new version of report is created or the existing report version is overwritten with every update. Defaults * to "new". */ versioning?: ValidateReportsSnapshotConfigConstants.Versioning | string; } /** Constants for the `validateReportsSnapshotConfig` operation. */ export namespace ValidateReportsSnapshotConfigConstants { /** Frequency of taking the snapshot of the billing reports. */ enum Interval { DAILY = "daily" } /** ReportTypes */ enum ReportTypes { ACCOUNT_SUMMARY = "account_summary", ENTERPRISE_SUMMARY = "enterprise_summary", ACCOUNT_RESOURCE_INSTANCE_USAGE = "account_resource_instance_usage" } /** A new version of report is created or the existing report version is overwritten with every update. Defaults to "new". */ enum Versioning { NEW = "new", OVERWRITE = "overwrite" } } /** Parameters for the `getReportsSnapshot` operation. */ export interface GetReportsSnapshotParams extends DefaultParams { /** Account ID for which the billing report snapshot is requested. */ accountId: string; /** The month for which billing report snapshot is requested. Format is yyyy-mm. */ month: string; /** Timestamp in milliseconds for which billing report snapshot is requested. */ dateFrom?: number; /** Timestamp in milliseconds for which billing report snapshot is requested. */ dateTo?: number; /** Number of usage records returned. The default value is 30. Maximum value is 200. */ limit?: number; /** The offset from which the records must be fetched. Offset information is included in the response. */ start?: string; } /************************* * model interfaces ************************/ /** * A summary of charges and credits for an account. */ export interface AccountSummary { /** The ID of the account. */ account_id: string; /** The list of account resources for the month. */ account_resources?: Resource[]; /** The month in which usages were incurred. Represented in yyyy-mm format. */ month: string; /** Country. */ billing_country_code: string; /** The currency in which the account is billed. */ billing_currency_code: string; /** Charges related to cloud resources. */ resources: ResourcesSummary; /** The list of offers applicable for the account for the month. */ offers: Offer[]; /** Support-related charges. */ support: SupportSummary[]; /** The list of support resources for the month. */ support_resources?: any[]; /** A summary of charges and credits related to a subscription. */ subscription: SubscriptionSummary; } /** * The aggregated usage and charges for all the plans in the account. */ export interface AccountUsage { /** The ID of the account. */ account_id: string; /** The target country pricing that should be used. */ pricing_country: string; /** The currency for the cost fields in the resources, plans and metrics. */ currency_code: string; /** The month. */ month: string; /** All the resource used in the account. */ resources: Resource[]; /** The value of the account's currency in USD. */ currency_rate?: number; } /** * Information about a discount that is associated with a metric. */ export interface Discount { /** The reference ID of the discount. */ ref: string; /** The name of the discount indicating category. */ name?: string; /** The name of the discount. */ display_name?: string; /** The discount percentage. */ discount: number; } /** * The aggregated usage and charges for an instance. */ export interface InstanceUsage { /** The ID of the account. */ account_id: string; /** The ID of the resource instance. */ resource_instance_id: string; /** The name of the resource instance. */ resource_instance_name?: string; /** The ID of the resource. */ resource_id: string; /** The catalog ID of the resource. */ catalog_id?: string; /** The name of the resource. */ resource_name?: string; /** The ID of the resource group. */ resource_group_id?: string; /** The name of the resource group. */ resource_group_name?: string; /** The ID of the organization. */ organization_id?: string; /** The name of the organization. */ organization_name?: string; /** The ID of the space. */ space_id?: string; /** The name of the space. */ space_name?: string; /** The ID of the consumer. */ consumer_id?: string; /** The region where instance was provisioned. */ region?: string; /** The pricing region where the usage that was submitted was rated. */ pricing_region?: string; /** The target country pricing that should be used. */ pricing_country: string; /** The currency for the cost fields in the resources, plans and metrics. */ currency_code: string; /** Is the cost charged to the account. */ billable: boolean; /** The resource instance id of the parent resource associated with this instance. */ parent_resource_instance_id?: string; /** The ID of the plan where the instance was provisioned and rated. */ plan_id: string; /** The name of the plan where the instance was provisioned and rated. */ plan_name?: string; /** The ID of the pricing plan used to rate the usage. */ pricing_plan_id?: string; /** The ID of service subscription with effective from timestamp. */ subscription_id?: string; /** The timestamp in RFC 3339 string format at which instance is created. */ created_at?: string; /** The timestamp in RFC 3339 string format at which instance is deleted. */ deleted_at?: string; /** The month. */ month: string; /** All the resource used in the account. */ usage: Metric[]; /** Pending charge from classic infrastructure. */ pending?: boolean; /** The value of the account's currency in USD. */ currency_rate?: number; /** The user tags associated with a resource instance. */ tags?: any[]; /** The service tags associated with a resource instance. */ service_tags?: any[]; } /** * The link to the first page of the search query. */ export interface InstancesUsageFirst { /** A link to a page of query results. */ href?: string; } /** * The link to the next page of the search query. */ export interface InstancesUsageNext { /** A link to a page of query results. */ href?: string; /** The value of the `_start` query parameter to fetch the next page. */ offset?: string; } /** * The list of instance usage reports. */ export interface InstancesUsage { /** The max number of reports in the response. */ limit?: number; /** The number of reports in the response. */ count?: number; /** The link to the first page of the search query. */ first?: InstancesUsageFirst; /** The link to the next page of the search query. */ next?: InstancesUsageNext; /** The list of instance usage reports. */ resources?: InstanceUsage[]; } /** * Information about a metric. */ export interface Metric { /** The ID of the metric. */ metric: string; /** The name of the metric. */ metric_name?: string; /** The aggregated value for the metric. */ quantity: number; /** The quantity that is used for calculating charges. */ rateable_quantity?: number; /** The cost incurred by the metric. */ cost: number; /** Pre-discounted cost incurred by the metric. */ rated_cost: number; /** The price with which the cost was calculated. */ price?: any[]; /** The unit that qualifies the quantity. */ unit?: string; /** The name of the unit. */ unit_name?: string; /** When set to `true`, the cost is for informational purpose and is not included while calculating the plan * charges. */ non_chargeable?: boolean; /** All the discounts applicable to the metric. */ discounts: Discount[]; /** This percentage reflects the reduction to the original cost that you receive under a volume based pricing * structure. */ volume_discount?: number; /** The original cost adjusted for volume based discounts that are applied at the account level. */ volume_cost?: number; } /** * Information about an individual offer. */ export interface Offer { /** The ID of the offer. */ offer_id: string; /** The total credits before applying the offer. */ credits_total: number; /** The template with which the offer was generated. */ offer_template: string; /** The date from which the offer is valid. */ valid_from: string; /** The offer's creator's email id. */ created_by_email_id: string; /** The date until the offer is valid. */ expires_on: string; /** Credit information related to an offer. */ credits: OfferCredits; } /** * Credit information related to an offer. */ export interface OfferCredits { /** The available credits in the offer at the beginning of the month. */ starting_balance: number; /** The credits used in this month. */ used: number; /** The remaining credits in the offer. */ balance: number; } /** * The aggregated usage and charges for all the plans in the org. */ export interface OrgUsage { /** The ID of the account. */ account_id: string; /** The ID of the organization. */ organization_id: string; /** The name of the organization. */ organization_name?: string; /** The target country pricing that should be used. */ pricing_country: string; /** The currency for the cost fields in the resources, plans and metrics. */ currency_code: string; /** The month. */ month: string; /** All the resource used in the account. */ resources: Resource[]; /** The value of the account's currency in USD. */ currency_rate?: number; } /** * The aggregated values for the plan. */ export interface Plan { /** The ID of the plan. */ plan_id: string; /** The name of the plan. */ plan_name?: string; /** The pricing region for the plan. */ pricing_region?: string; /** The ID of the pricing plan used to rate the usage. */ pricing_plan_id?: string; /** Indicates if the plan charges are billed to the customer. */ billable: boolean; /** The total cost incurred by the plan. */ cost: number; /** Total pre-discounted cost incurred by the plan. */ rated_cost: number; /** The ID of service subscription with effective from timestamp. */ subscription_id?: string; /** All the metrics in the plan. */ usage: Metric[]; /** All the discounts applicable to the plan. */ discounts: Discount[]; /** Pending charge from classic infrastructure. */ pending?: boolean; } /** * The container for all the plans in the resource. */ export interface Resource { /** The ID of the resource. */ resource_id: string; /** The catalog ID of the resource. */ catalog_id?: string; /** The name of the resource. */ resource_name?: string; /** The billable charges for the account. */ billable_cost: number; /** The pre-discounted billable charges for the account. */ billable_rated_cost: number; /** The non-billable charges for the account. */ non_billable_cost: number; /** The pre-discounted non-billable charges for the account. */ non_billable_rated_cost: number; /** All the plans in the resource. */ plans: Plan[]; /** All the discounts applicable to the resource. */ discounts: Discount[]; } /** * The aggregated usage and charges for all the plans in the resource group. */ export interface ResourceGroupUsage { /** The ID of the account. */ account_id: string; /** The ID of the resource group. */ resource_group_id: string; /** The name of the resource group. */ resource_group_name?: string; /** The target country pricing that should be used. */ pricing_country: string; /** The currency for the cost fields in the resources, plans and metrics. */ currency_code: string; /** The month. */ month: string; /** All the resource used in the account. */ resources: Resource[]; /** The value of the account's currency in USD. */ currency_rate?: number; } /** * Charges related to cloud resources. */ export interface ResourcesSummary { /** The billable charges for all cloud resources used in the account. */ billable_cost: number; /** Non-billable charges for all cloud resources used in the account. */ non_billable_cost: number; } /** * SnapshotConfigHistoryItem. */ export interface SnapshotConfigHistoryItem { /** Timestamp in milliseconds when the snapshot configuration was created. */ start_time?: number; /** Timestamp in milliseconds when the snapshot configuration ends. */ end_time?: number; /** Account that updated the billing snapshot configuration. */ updated_by?: string; /** Account ID for which billing report snapshot is configured. */ account_id?: string; /** Status of the billing snapshot configuration. Possible values are [enabled, disabled]. */ state?: SnapshotConfigHistoryItem.Constants.State | string; /** Type of account. Possible values [enterprise, account]. */ account_type?: SnapshotConfigHistoryItem.Constants.AccountType | string; /** Frequency of taking the snapshot of the billing reports. */ interval?: SnapshotConfigHistoryItem.Constants.Interval | string; /** A new version of report is created or the existing report version is overwritten with every update. */ versioning?: SnapshotConfigHistoryItem.Constants.Versioning | string; /** The type of billing reports to take snapshot of. Possible values are [account_summary, enterprise_summary, * account_resource_instance_usage]. */ report_types?: SnapshotConfigHistoryItem.Constants.ReportTypes[] | string[]; /** Compression format of the snapshot report. */ compression?: string; /** Type of content stored in snapshot report. */ content_type?: string; /** The billing reports root folder to store the billing reports snapshots. Defaults to * "IBMCloud-Billing-Reports". */ cos_reports_folder?: string; /** The name of the COS bucket to store the snapshot of the billing reports. */ cos_bucket?: string; /** Region of the COS instance. */ cos_location?: string; /** The endpoint of the COS instance. */ cos_endpoint?: string; } export namespace SnapshotConfigHistoryItem { namespace Constants { /** Status of the billing snapshot configuration. Possible values are [enabled, disabled]. */ enum State { ENABLED = "enabled", DISABLED = "disabled" } /** Type of account. Possible values [enterprise, account]. */ enum AccountType {