Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
171 changes: 102 additions & 69 deletions fractal.sdk/src/main/java/com/yanchware/fractal/sdk/Automaton.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public EnvVarSdkConfiguration() throws URISyntaxException {

/**
* Gets the BOT client ID or Cloud Agent Client ID from environment variables.
* The environment variable key is {@value com.yanchware.fractal.sdk.configuration.Constants#CI_CD_SERVICE_ACCOUNT_NAME_KEY}.
* The environment variable key is
* {@value com.yanchware.fractal.sdk.configuration.Constants#CI_CD_SERVICE_ACCOUNT_NAME_KEY}.
*
* @return the BOT client ID or Cloud Agent Client ID
* @throws IllegalArgumentException if the client ID environment variable is not set
Expand All @@ -52,14 +53,16 @@ public String getClientId() {
var clientId = System.getenv(CI_CD_SERVICE_ACCOUNT_NAME_KEY);
if (isBlank(clientId)) {
throw new IllegalArgumentException(
String.format("The environment variable %s is required and it has not been defined", CI_CD_SERVICE_ACCOUNT_NAME_KEY));
String.format("The environment variable %s is required and it has not been defined",
CI_CD_SERVICE_ACCOUNT_NAME_KEY));
}
return clientId;
}

/**
* Gets the BOT client secret or Cloud Agent Client secret from environment variables.
* The environment variable key is {@value com.yanchware.fractal.sdk.configuration.Constants#CI_CD_SERVICE_ACCOUNT_SECRET_KEY}.
* The environment variable key is
* {@value com.yanchware.fractal.sdk.configuration.Constants#CI_CD_SERVICE_ACCOUNT_SECRET_KEY}.
*
* @return the BOT client secret or Cloud Agent Client secret
* @throws IllegalArgumentException if the client secret environment variable is not set
Expand All @@ -69,7 +72,8 @@ public String getClientSecret() {
var clientSecret = System.getenv(CI_CD_SERVICE_ACCOUNT_SECRET_KEY);
if (isBlank(clientSecret)) {
throw new IllegalArgumentException(
String.format("The environment variable %s is required and it has not been defined", CI_CD_SERVICE_ACCOUNT_SECRET_KEY));
String.format("The environment variable %s is required and it has not been defined",
CI_CD_SERVICE_ACCOUNT_SECRET_KEY));
}
return clientSecret;
}
Expand All @@ -87,7 +91,8 @@ public String getAzureSpClientId() {

/**
* Gets the Azure service principal client secret from environment variables.
* The environment variable key is {@value com.yanchware.fractal.sdk.configuration.Constants#AZURE_SP_CLIENT_SECRET_KEY}.
* The environment variable key is
* {@value com.yanchware.fractal.sdk.configuration.Constants#AZURE_SP_CLIENT_SECRET_KEY}.
*
* @return the Azure service principal client secret
*/
Expand Down Expand Up @@ -120,7 +125,8 @@ public URI getLiveSystemEndpoint() {

/**
* Gets the URI of the environments endpoint from environment variables or default.
* The environment variable key is {@value com.yanchware.fractal.sdk.configuration.Constants#ENVIRONMENTS_ENDPOINT_KEY}.
* The environment variable key is
* {@value com.yanchware.fractal.sdk.configuration.Constants#ENVIRONMENTS_ENDPOINT_KEY}.
*
* @return the URI of the environments endpoint
*/
Expand Down Expand Up @@ -164,7 +170,8 @@ public String getAwsSessionToken() {

/**
* Gets the GCP service account email from environment variables.
* The environment variable key is {@value com.yanchware.fractal.sdk.configuration.Constants#GCP_SERVICE_ACCOUNT_EMAIL_KEY}.
* The environment variable key is
* {@value com.yanchware.fractal.sdk.configuration.Constants#GCP_SERVICE_ACCOUNT_EMAIL_KEY}.
*
* @return the GCP service account email
*/
Expand All @@ -175,7 +182,8 @@ public String getGcpServiceAccountEMail() {

/**
* Gets the GCP service account credentials from environment variables.
* The environment variable key is {@value com.yanchware.fractal.sdk.configuration.Constants#GCP_SERVICE_ACCOUNT_CREDENTIALS_KEY}.
* The environment variable key is
* {@value com.yanchware.fractal.sdk.configuration.Constants#GCP_SERVICE_ACCOUNT_CREDENTIALS_KEY}.
*
* @return the GCP service account credentials
*/
Expand All @@ -186,7 +194,8 @@ public String getGcpServiceAccountCredentials() {

/**
* Gets the OCI service account ID from environment variables.
* The environment variable key is {@value com.yanchware.fractal.sdk.configuration.Constants#OCI_SERVICE_ACCOUNT_ID_KEY}.
* The environment variable key is
* {@value com.yanchware.fractal.sdk.configuration.Constants#OCI_SERVICE_ACCOUNT_ID_KEY}.
*
* @return the OCI service account ID
*/
Expand All @@ -197,7 +206,8 @@ public String getOciServiceAccountId() {

/**
* Gets the OCI service account credentials from environment variables.
* The environment variable key is {@value com.yanchware.fractal.sdk.configuration.Constants#OCI_SERVICE_ACCOUNT_CREDENTIALS_KEY}.
* The environment variable key is
* {@value com.yanchware.fractal.sdk.configuration.Constants#OCI_SERVICE_ACCOUNT_CREDENTIALS_KEY}.
*
* @return the OCI service account credentials
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@
@Builder(setterPrefix = "with")
public class InstantiationConfiguration {

/**
* Defines the wait configuration for the instantiation process.
* By default the instantiation terminates without waiting.
*/
public InstantiationWaitConfiguration waitConfiguration;
/**
* Defines the wait configuration for the instantiation process.
* By default, the instantiation terminates without waiting.
*/
public InstantiationWaitConfiguration waitConfiguration;

/**
* Indicates whether to create or update a blueprint during the instantiation process.
* This variable is used to control the behavior of blueprint management.
* If set to true, an existing blueprint will be updated or a new blueprint will
* be created as part of the Live System instantiation.
*/
public boolean createOrUpdateBlueprint;
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public InstantiationWaitConfigurationBuilder withTimeoutMinutes(int timeoutMinut
public InstantiationWaitConfiguration build() {

if (configuration.waitForInstantiation
&& configuration.timeoutMinutes == null) {
&& configuration.timeoutMinutes == null)
{
configuration.setTimeoutMinutes(DEFAULT_LIVE_SYSTEM_INSTANTIATION_WAIT_TIMEOUT_MINUTES);
}

Expand Down
Loading
Loading