Interface VariableConfigurationService

  • All Known Implementing Classes:
    VariableConfigurationServiceImpl

    @PublicApi
    public interface VariableConfigurationService
    Service for modification of global and plan variable definitions.
    Since:
    4.4
    • Method Detail

      • 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 to
        variableKey - 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 to
        variableKey - 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
      • 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