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 2019/10/10 10:24:49 UTC

[incubator-dlab] branch DLAB-1179 created (now 488998e)

This is an automated email from the ASF dual-hosted git repository.

ofuks pushed a change to branch DLAB-1179
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git.


      at 488998e  [DLAB-1179] Fixed issue with billing (Azure)

This branch includes the following new commits:

     new 488998e  [DLAB-1179] Fixed issue with billing (Azure)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org


[incubator-dlab] 01/01: [DLAB-1179] Fixed issue with billing (Azure)

Posted by of...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ofuks pushed a commit to branch DLAB-1179
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit 488998eaeeeca2ee01372a2ccebb259d09c22b0f
Author: ofuks <ol...@gmail.com>
AuthorDate: Thu Oct 10 13:24:23 2019 +0300

    [DLAB-1179] Fixed issue with billing (Azure)
---
 services/self-service/self-service.yml                             | 1 +
 .../dlab/backendapi/conf/SelfServiceApplicationConfiguration.java  | 7 +++++++
 .../dlab/backendapi/dropwizard/listeners/MongoStartupListener.java | 4 ++++
 3 files changed, 12 insertions(+)

diff --git a/services/self-service/self-service.yml b/services/self-service/self-service.yml
index ec531d0..043d952 100644
--- a/services/self-service/self-service.yml
+++ b/services/self-service/self-service.yml
@@ -63,6 +63,7 @@ billingConfFile: ${DLAB_CONF_DIR}/billing.yml
 
 <#if CLOUD_TYPE == "azure">
 azureUseLdap: <LOGIN_USE_LDAP>
+ssnInstanceSize: Standard_DS2_v2
 maxSessionDurabilityMilliseconds: 288000000
 </#if>
 
diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/conf/SelfServiceApplicationConfiguration.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/conf/SelfServiceApplicationConfiguration.java
index 4494d01..4e3ea2e 100644
--- a/services/self-service/src/main/java/com/epam/dlab/backendapi/conf/SelfServiceApplicationConfiguration.java
+++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/conf/SelfServiceApplicationConfiguration.java
@@ -74,6 +74,9 @@ public class SelfServiceApplicationConfiguration extends ServiceConfiguration {
 	private boolean azureUseLdap;
 
 	@JsonProperty
+	private String ssnInstanceSize;
+
+	@JsonProperty
 	private boolean rolePolicyEnabled = false;
 
 	@JsonProperty
@@ -254,6 +257,10 @@ public class SelfServiceApplicationConfiguration extends ServiceConfiguration {
 		return azureUseLdap;
 	}
 
+	public String getSsnInstanceSize() {
+		return ssnInstanceSize;
+	}
+
 	public boolean isMongoMigrationEnabled() {
 		return mongoMigrationEnabled;
 	}
diff --git a/services/self-service/src/main/java/com/epam/dlab/backendapi/dropwizard/listeners/MongoStartupListener.java b/services/self-service/src/main/java/com/epam/dlab/backendapi/dropwizard/listeners/MongoStartupListener.java
index 2186fb3..9d43df4 100644
--- a/services/self-service/src/main/java/com/epam/dlab/backendapi/dropwizard/listeners/MongoStartupListener.java
+++ b/services/self-service/src/main/java/com/epam/dlab/backendapi/dropwizard/listeners/MongoStartupListener.java
@@ -4,6 +4,7 @@ import com.epam.dlab.backendapi.conf.SelfServiceApplicationConfiguration;
 import com.epam.dlab.backendapi.dao.SettingsDAO;
 import com.epam.dlab.backendapi.dao.UserRoleDao;
 import com.epam.dlab.backendapi.resources.dto.UserRoleDto;
+import com.epam.dlab.cloud.CloudProvider;
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.inject.Inject;
@@ -39,6 +40,9 @@ public class MongoStartupListener implements ServerLifecycleListener {
 	public void serverStarted(Server server) {
 		settingsDAO.setServiceBaseName(configuration.getServiceBaseName());
 		settingsDAO.setConfOsFamily(configuration.getOs());
+		if (configuration.getCloudProvider() == CloudProvider.AZURE) {
+			settingsDAO.setAzureSsnInstanceSize(configuration.getSsnInstanceSize());
+		}
 		if (userRoleDao.findAll().isEmpty()) {
 			log.debug("Populating DLab roles into database");
 			userRoleDao.insert(getRoles());


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org