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

      io.reactivex.rxjava3.core.Single<CloudCostResponse> loadCloudCost(Account account, Cloud cloud, Date startDate, Date endDate, Boolean byTenant)
    • loadCloudCost

      io.reactivex.rxjava3.core.Single<CloudCostResponse> loadCloudCost(Account account, Cloud cloud, Date startDate, Date endDate, Boolean byTenant, Map additionalOptions)
    • 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 From AccountInvoice REF_ properties
      refId - The database id of the object to associate based on the refType
      refUUID - The uuid of the object based on refType this is associated to. UUID Should always be used now to prevent id reuse
      costDate - The date the invoice is being built
      invoice - The properties of the invoice record we are creating
      newRecord - 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 From AccountInvoice REF_ properties
      refId - The database id of the object to associate based on the refType
      refUUID - The uuid of the object based on refType this is associated to. UUID Should always be used now to prevent id reuse
      costDate - The date the invoice is being built
      invoice - 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

      io.reactivex.rxjava3.core.Completable bulkReconcileInvoices(Collection<Long> invoiceIds)
      Reconciles invoice totals based on the associated AccountInvoiceItem 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

      io.reactivex.rxjava3.core.Completable summarizeCloudInvoice(Cloud cloud, String period, Date costDate, Collection<String> additionalCloudUUIDs, Date maxActualDate)
    • 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)