Package com.atlassian.bamboo.variable
Interface VariableConfigurationService
- All Known Implementing Classes:
VariableConfigurationServiceImpl
@PublicApi
public interface VariableConfigurationService
Service for modification of global and plan variable definitions.
- Since:
- 4.4
-
Method Summary
Modifier and TypeMethodDescription@NotNull VariableDefinitioncreateGlobalVariable(@NotNull String variableKey, @NotNull String variableValue) Creates new Global variable.@NotNull VariableDefinitioncreatePlanVariable(@NotNull Plan plan, @NotNull String variableKey, @NotNull String variableValue) Creates new Plan variable.createProjectVariable(long projectId, @NotNull String variableKey, @NotNull String variableValue) Create a project variable.@NotNull VariableDefinitioncreateUniqueGlobalVariable(@NotNull String variableKey, @NotNull String variableValue) Creates new global variable.@NotNull VariableDefinitioncreateUniquePlanVariable(@NotNull Plan plan, @NotNull String variableKey, @NotNull String variableValue) Creates new Plan variable.@NotNull VariableDefinitioncreateVariableForEnvironment(long environmentId, @NotNull String variableKey, @NotNull String variableValue) Creates new variable for Deployment EnvironmentvoiddeleteVariableDefinition(@NotNull VariableDefinition variableDefinition) RemovesVariableDefinitionvoidsetDeploymentEnvironmentVariables(long environmentId, @NotNull List<com.atlassian.bamboo.specs.api.model.VariableProperties> variables) Creates complete deployment environment variables list.voidsetPlanVariables(@NotNull Chain plan, @NotNull List<com.atlassian.bamboo.specs.api.model.VariableProperties> variables) Creates complete plan variables list.voidsetProjectVariables(long projectId, @NotNull List<com.atlassian.bamboo.specs.api.model.VariableProperties> variables) Creates complete project variables list.@NotNull VariableDefinitionupdateVariableDefinition(@NotNull VariableDefinition variableDefinition, String previousValue) UpdatesVariableDefinition
-
Method Details
-
createUniquePlanVariable
@NotNull @NotNull VariableDefinition createUniquePlanVariable(@NotNull @NotNull Plan plan, @NotNull @NotNull String variableKey, @NotNull @NotNull String variableValue) Creates new Plan variable. If a variable with the same key prefix and value already exists nothing will be created and existing variable is returned. If a variable with the same key but different value already exists, this method will add unique suffix to the key and create a new variable.- Parameters:
plan- plan the variable belongs tovariableKey- variable key.variableValue- variable value- Returns:
- created
VariableDefinition
-
createUniqueGlobalVariable
@NotNull @NotNull VariableDefinition createUniqueGlobalVariable(@NotNull @NotNull String variableKey, @NotNull @NotNull String variableValue) Creates new global variable. If a variable with the same key prefix and value already exists nothing will be created and existing variable is returned. If a variable with the same key but different value already exists, this method will add unique suffix to the key and create a new variable.- Parameters:
variableKey- variable key.variableValue- variable value- Returns:
- created
VariableDefinition
-
createPlanVariable
@NotNull @NotNull VariableDefinition createPlanVariable(@NotNull @NotNull Plan plan, @NotNull @NotNull String variableKey, @NotNull @NotNull String variableValue) Creates new Plan variable.- Parameters:
plan- plan the variable belongs tovariableKey- variable key.variableValue- variable value- Returns:
- created
VariableDefinition - Throws:
IllegalArgumentException- iff variable key is not unique
-
createVariableForEnvironment
@NotNull @NotNull VariableDefinition createVariableForEnvironment(long environmentId, @NotNull @NotNull String variableKey, @NotNull @NotNull String variableValue) Creates new variable for Deployment Environment- Parameters:
environmentId-variableKey- variable key.variableValue- variable value- Returns:
- created
VariableDefinition - Throws:
IllegalArgumentException- iff variable key is not unique or com.atlassian.bamboo.deployments.environments.Environment does not exist
-
createGlobalVariable
@NotNull @NotNull VariableDefinition createGlobalVariable(@NotNull @NotNull String variableKey, @NotNull @NotNull String variableValue) Creates new Global variable.- Parameters:
variableValue- variable value- Returns:
- created
VariableDefinition - Throws:
IllegalArgumentException- iff variable key is not unique
-
updateVariableDefinition
@NotNull @NotNull VariableDefinition updateVariableDefinition(@NotNull @NotNull VariableDefinition variableDefinition, String previousValue) UpdatesVariableDefinition- Throws:
IllegalArgumentException- iff variable key is not unique
-
deleteVariableDefinition
RemovesVariableDefinition -
setPlanVariables
void setPlanVariables(@NotNull @NotNull Chain plan, @NotNull @NotNull List<com.atlassian.bamboo.specs.api.model.VariableProperties> variables) Creates complete plan variables list. All pre-existing variables are updated to values provided or removed if new value is not provided. New variables are created if necessary.- Since:
- 5.15
-
setProjectVariables
void setProjectVariables(long projectId, @NotNull @NotNull List<com.atlassian.bamboo.specs.api.model.VariableProperties> variables) Creates complete project variables list. All pre-existing variables are updated to values provided or removed if new value is not provided. New variables are created if necessary.- Since:
- 8.2
-
setDeploymentEnvironmentVariables
void setDeploymentEnvironmentVariables(long environmentId, @NotNull @NotNull List<com.atlassian.bamboo.specs.api.model.VariableProperties> variables) Creates complete deployment environment variables list. All pre-existing variables are updated to values provided or removed if new value is not provided. New variables are created if necessary.- Since:
- 6.1
-
createProjectVariable
VariableDefinition createProjectVariable(long projectId, @NotNull @NotNull String variableKey, @NotNull @NotNull String variableValue) Create a project variable.- Returns:
- Since:
- 7.1
-