Package com.morpheusdata.core.costing
Interface MorpheusAccountInvoiceService
- All Superinterfaces:
MorpheusDataQueryService<AccountInvoice>
,MorpheusDataService<AccountInvoice,
AccountInvoice>
public interface MorpheusAccountInvoiceService
extends MorpheusDataService<AccountInvoice,AccountInvoice>
Provides accessor methods for fetching invoice/costing data from the Morpheus Database.
The invoice data is organized by resource association or by summary. There are rollup invoices for Groups,Clouds,Users,
Instances, Containers and even Accounts. These queries can be intensive, it is important to try and chunk or appropriately
filter the particular invoices that are wished for in order to minimize any overhead. These helper methods are useful
for creating custom reports or custom pages/widgets.
- Since:
- 0.12.2
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
-
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Completable
bulkReconcileInvoices
(Collection<Long> invoiceIds) Reconciles invoice totals based on the associatedAccountInvoiceItem
records on the invoice.io.reactivex.rxjava3.core.Single<MorpheusAccountInvoiceService.InvoiceLookupResults>
ensureActiveAccountInvoice
(Account owner, Account account, String refType, Long refId, String refUUID, Date costDate, AccountInvoice invoice) Ensures that an active invoice record exists based on the scoped account and owner as well as the object the invoice is associated with.io.reactivex.rxjava3.core.Single<MorpheusAccountInvoiceService.InvoiceLookupResults>
ensureActiveAccountInvoice
(Account owner, Account account, String refType, Long refId, String refUUID, Date costDate, AccountInvoice invoice, Boolean newRecord) Ensures that an active invoice record exists based on the scoped account and owner as well as the object the invoice is associated with.io.reactivex.rxjava3.core.Flowable<AccountInvoice>
listByApiParams
(User user, ApiParameterMap<String, Object> parameters) io.reactivex.rxjava3.core.Single<CloudCostResponse>
loadCloudCost
(Account account, Cloud cloud, Date startDate, Date endDate) io.reactivex.rxjava3.core.Single<CloudCostResponse>
io.reactivex.rxjava3.core.Single<CloudCostResponse>
loadCloudCost
(Account account, Cloud cloud, Date startDate, Date endDate, Boolean byTenant, Map additionalOptions) io.reactivex.rxjava3.core.Completable
processProjectedCosts
(Cloud cloud, String period, Collection<String> additionalCloudExternalIds) io.reactivex.rxjava3.core.Completable
processProjectedCosts
(Cloud cloud, String period, Collection<String> additionalCloudExternalIds, Boolean definitive) io.reactivex.rxjava3.core.Completable
summarizeCloudInvoice
(Cloud cloud, String period, Date costDate, Collection<String> additionalCloudUUIDs) io.reactivex.rxjava3.core.Completable
summarizeCloudInvoice
(Cloud cloud, String period, Date costDate, Collection<String> additionalCloudUUIDs, Date maxActualDate) Methods inherited from interface com.morpheusdata.core.MorpheusDataQueryService
count, find, get, list, list, listById, listOptions, listOptions, search
Methods inherited from interface com.morpheusdata.core.MorpheusDataService
bulkCreate, bulkRemove, bulkSave, create, create, remove, remove, save, save
-
Method Details
-
listByApiParams
io.reactivex.rxjava3.core.Flowable<AccountInvoice> listByApiParams(User user, ApiParameterMap<String, Object> parameters) -
loadCloudCost
io.reactivex.rxjava3.core.Single<CloudCostResponse> loadCloudCost(Account account, Cloud cloud, Date startDate, Date endDate) -
loadCloudCost
-
loadCloudCost
-
ensureActiveAccountInvoice
io.reactivex.rxjava3.core.Single<MorpheusAccountInvoiceService.InvoiceLookupResults> ensureActiveAccountInvoice(Account owner, Account account, String refType, Long refId, String refUUID, Date costDate, AccountInvoice invoice, Boolean newRecord) Ensures that an active invoice record exists based on the scoped account and owner as well as the object the invoice is associated with. THe refType and refId/refUUID act as a polymorphic association to other morpheus model constructs such as AccountResource, ComputeZone, VirtualImage,ComputeServer,StorageVolume,NetworkLoadBalancer,etc. A result object will come back with a generated invoice if not found or a reference to an existing invoice updated with the provided information.- Parameters:
owner
- The owner/manager of the object we are building an invoice for (important on shared clouds where this would be the master account).account
- The current account this object belongs to that the invoice data should get associated with.refType
- The polymorphic object class to associate the invoice too (i.e. ComputeZone,ComputeServer,VirtualImage,NetworkLoadBalancer,Snapshot,StorageVolume,etc). See List FromAccountInvoice
REF_ propertiesrefId
- The database id of the object to associate based on the refTyperefUUID
- The uuid of the object based on refType this is associated to. UUID Should always be used now to prevent id reusecostDate
- The date the invoice is being builtinvoice
- The properties of the invoice record we are creatingnewRecord
- If not found , do we create a new record.- Returns:
- a Lookup result stating if the object was found or created and a copy of the saved invoice record with its populated identity.
-
ensureActiveAccountInvoice
io.reactivex.rxjava3.core.Single<MorpheusAccountInvoiceService.InvoiceLookupResults> ensureActiveAccountInvoice(Account owner, Account account, String refType, Long refId, String refUUID, Date costDate, AccountInvoice invoice) Ensures that an active invoice record exists based on the scoped account and owner as well as the object the invoice is associated with. THe refType and refId/refUUID act as a polymorphic association to other morpheus model constructs such as AccountResource, ComputeZone, VirtualImage,ComputeServer,StorageVolume,NetworkLoadBalancer,etc. A result object will come back with a generated invoice if not found or a reference to an existing invoice updated with the provided information.- Parameters:
owner
- The owner/manager of the object we are building an invoice for (important on shared clouds where this would be the master account).account
- The current account this object belongs to that the invoice data should get associated with.refType
- The polymorphic object class to associate the invoice too (i.e. ComputeZone,ComputeServer,VirtualImage,NetworkLoadBalancer,Snapshot,StorageVolume,etc). See List FromAccountInvoice
REF_ propertiesrefId
- The database id of the object to associate based on the refTyperefUUID
- The uuid of the object based on refType this is associated to. UUID Should always be used now to prevent id reusecostDate
- The date the invoice is being builtinvoice
- The properties of the invoice record we are creating- Returns:
- a Lookup result stating if the object was found or created and a copy of the saved invoice record with its populated identity.
-
bulkReconcileInvoices
Reconciles invoice totals based on the associatedAccountInvoiceItem
records on the invoice.- Parameters:
invoiceIds
- a list of invoices to reconcile- Returns:
- completable state
-
summarizeCloudInvoice
io.reactivex.rxjava3.core.Completable summarizeCloudInvoice(Cloud cloud, String period, Date costDate, Collection<String> additionalCloudUUIDs) -
summarizeCloudInvoice
-
processProjectedCosts
io.reactivex.rxjava3.core.Completable processProjectedCosts(Cloud cloud, String period, Collection<String> additionalCloudExternalIds) -
processProjectedCosts
io.reactivex.rxjava3.core.Completable processProjectedCosts(Cloud cloud, String period, Collection<String> additionalCloudExternalIds, Boolean definitive)
-