-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make new workspace client from account client (#218)
## Changes Ported to the Java SDK from https://github.com/databricks/databricks-sdk-go/pull/792/files and databricks/databricks-sdk-go#700. ## Tests <!-- How is this tested? -->
- Loading branch information
Showing
12 changed files
with
292 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
fmt: | ||
mvn spotless:apply | ||
|
||
test: | ||
mvn test | ||
|
24 changes: 10 additions & 14 deletions
24
databricks-sdk-java/src/main/java/com/databricks/sdk/AccountClient.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
databricks-sdk-java/src/main/java/com/databricks/sdk/core/DatabricksEnvironment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package com.databricks.sdk.core; | ||
|
||
import com.databricks.sdk.core.utils.Cloud; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
public class DatabricksEnvironment { | ||
private Cloud cloud; | ||
private String dnsZone; | ||
private String azureApplicationId; | ||
private AzureEnvironment azureEnvironment; | ||
|
||
private DatabricksEnvironment(Cloud cloud, String dnsZone) { | ||
this(cloud, dnsZone, null, null); | ||
} | ||
|
||
private DatabricksEnvironment( | ||
Cloud cloud, String dnsZone, String azureApplicationId, AzureEnvironment azureEnvironment) { | ||
this.cloud = cloud; | ||
this.dnsZone = dnsZone; | ||
this.azureApplicationId = azureApplicationId; | ||
this.azureEnvironment = azureEnvironment; | ||
} | ||
|
||
public Cloud getCloud() { | ||
return cloud; | ||
} | ||
|
||
public String getDnsZone() { | ||
return dnsZone; | ||
} | ||
|
||
public String getAzureApplicationId() { | ||
return azureApplicationId; | ||
} | ||
|
||
public AzureEnvironment getAzureEnvironment() { | ||
return azureEnvironment; | ||
} | ||
|
||
public String getDeploymentUrl(String name) { | ||
return String.format("https://%s%s", name, dnsZone); | ||
} | ||
|
||
public static final DatabricksEnvironment DEFAULT_ENVIRONMENT = | ||
new DatabricksEnvironment(Cloud.AWS, ".cloud.databricks.com"); | ||
|
||
public static final List<DatabricksEnvironment> ALL_ENVIRONMENTS = | ||
Arrays.asList( | ||
new DatabricksEnvironment(Cloud.AWS, ".dev.databricks.com"), | ||
new DatabricksEnvironment(Cloud.AWS, ".staging.cloud.databricks.com"), | ||
new DatabricksEnvironment(Cloud.AWS, ".cloud.databricks.us"), | ||
DEFAULT_ENVIRONMENT, | ||
new DatabricksEnvironment( | ||
Cloud.AZURE, | ||
".dev.azuredatabricks.net", | ||
"62a912ac-b58e-4c1d-89ea-b2dbfc7358fc", | ||
AzureEnvironment.getEnvironment("PUBLIC")), | ||
new DatabricksEnvironment( | ||
Cloud.AZURE, | ||
".staging.azuredatabricks.net", | ||
"4a67d088-db5c-48f1-9ff2-0aace800ae68", | ||
AzureEnvironment.getEnvironment("PUBLIC")), | ||
new DatabricksEnvironment( | ||
Cloud.AZURE, | ||
".azuredatabricks.net", | ||
"2ff814a6-3304-4ab8-85cb-cd0e6f879c1d", | ||
AzureEnvironment.getEnvironment("PUBLIC")), | ||
new DatabricksEnvironment( | ||
Cloud.AZURE, | ||
".databricks.azure.us", | ||
"2ff814a6-3304-4ab8-85cb-cd0e6f879c1d", | ||
AzureEnvironment.getEnvironment("USGOVERNMENT")), | ||
new DatabricksEnvironment( | ||
Cloud.AZURE, | ||
".databricks.azure.cn", | ||
"2ff814a6-3304-4ab8-85cb-cd0e6f879c1d", | ||
AzureEnvironment.getEnvironment("CHINA")), | ||
new DatabricksEnvironment(Cloud.GCP, ".dev.gcp.databricks.com"), | ||
new DatabricksEnvironment(Cloud.GCP, ".staging.gcp.databricks.com"), | ||
new DatabricksEnvironment(Cloud.GCP, ".gcp.databricks.com")); | ||
} |
Oops, something went wrong.