You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by of...@apache.org on 2020/04/15 09:58:40 UTC
[incubator-dlab] branch DLAB-1571 updated: [DLAB-1719] Fixed issues
with billing export
This is an automated email from the ASF dual-hosted git repository.
ofuks pushed a commit to branch DLAB-1571
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
The following commit(s) were added to refs/heads/DLAB-1571 by this push:
new c49406e [DLAB-1719] Fixed issues with billing export
new 1ec61d4 Merge remote-tracking branch 'origin/DLAB-1571' into DLAB-1571
c49406e is described below
commit c49406ebab7591b845f9b848704b54eda37cdbdb
Author: Oleh Fuks <ol...@gmail.com>
AuthorDate: Wed Apr 15 12:58:19 2020 +0300
[DLAB-1719] Fixed issues with billing export
---
.../src/main/java/com/epam/dlab/backendapi/util/BillingUtils.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/util/BillingUtils.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/util/BillingUtils.java
index b258e93..c1f311f 100644
--- a/services/self-service/src/main/java/com/epam/dlab/backendapi/util/BillingUtils.java
+++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/util/BillingUtils.java
@@ -22,6 +22,7 @@ package com.epam.dlab.backendapi.util;
import com.epam.dlab.backendapi.domain.BillingReportLine;
import com.epam.dlab.backendapi.resources.dto.ImageInfoRecord;
import com.epam.dlab.dto.UserInstanceDTO;
+import com.epam.dlab.dto.UserInstanceStatus;
import com.epam.dlab.dto.base.DataEngineType;
import com.epam.dlab.dto.computational.UserComputationalResource;
import jersey.repackaged.com.google.common.collect.Lists;
@@ -47,7 +48,7 @@ import static com.epam.dlab.dto.billing.BillingResourceType.VOLUME;
public class BillingUtils {
private static final String[] AVAILABLE_NOTEBOOKS = {"zeppelin", "tensor-rstudio", "rstudio", "tensor", "superset", "jupyterlab", "jupyter", "deeplearning"};
- private static final String[] REPORT_HEADERS = {"DLab ID", "User", "Project", "DLab Resource Type", "Shape", "Product", "Cost"};
+ private static final String[] REPORT_HEADERS = {"DLab ID", "User", "Project", "DLab Resource Type", "Status", "Shape", "Product", "Cost"};
private static final String REPORT_FIRST_LINE = "Service base name: %s. Available reporting period from: %s to: %s";
private static final String TOTAL_LINE = "Total: %s %s";
private static final String SSN_FORMAT = "%s-ssn";
@@ -197,7 +198,8 @@ public class BillingUtils {
lines.add(getOrEmpty(line.getDlabId()));
lines.add(getOrEmpty(line.getUser()));
lines.add(getOrEmpty(line.getProject()));
- lines.add(getOrEmpty(Optional.ofNullable(line.getResourceType()).map(Enum::name).orElse(null)));
+ lines.add(getOrEmpty(Optional.ofNullable(line.getResourceType()).map(r -> StringUtils.capitalize(r.toString().toLowerCase())).orElse(null)));
+ lines.add(getOrEmpty(Optional.ofNullable(line.getStatus()).map(UserInstanceStatus::toString).orElse(null)));
lines.add(getOrEmpty(line.getShape()));
lines.add(getOrEmpty(line.getProduct()));
lines.add(getOrEmpty(Optional.ofNullable(line.getCost()).map(String::valueOf).orElse(null)));
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org