eqixiacEquinix Infrastructure as Code

Billing and reports

Invoice summaries and documents, and Report Center reports.

Billing#

Java
import com.eqixiac.equinix.operations.model.InvoiceSummary;

Map<String, BigDecimal> totalByCurrency = new TreeMap<>();
for (InvoiceSummary invoice : ops.invoices().summaries().loadAll()) {
    totalByCurrency.merge(invoice.getCurrencyCode().getCurrencyCode(), invoice.getTotalAmount(), BigDecimal::add);
}
totalByCurrency.forEach((currency, total) -> System.out.println(currency + " " + total));

The block totals each currency separately. billingAccounts().downloadInvoiceDocument(...) returns the invoice document as bytes.

Reports#

Java
import com.eqixiac.equinix.operations.enums.ReportStatus;
import com.eqixiac.equinix.operations.model.Report;

for (Report report : ops.reports().getReports(25, List.of(ReportStatus.SUCCESS), null)) {
    byte[] file = ops.reports().downloadReport(report.getReportId());
    Files.write(Path.of(report.getFileName()), file);
}

generateReport(...) and scheduleReport(...) start report jobs, which is a side effect, so the read-only live tier does not call them.