Interface EnvironmentApi

    • Method Detail

      • create

        @NotNull
        @NotNull Environment create​(@NotNull
                                    @NotNull String programId,
                                    @NotNull
                                    @NotNull String name,
                                    @NotNull
                                    Environment.Type type,
                                    @NotNull
                                    @NotNull String region,
                                    String description)
                             throws CloudManagerApiException
        Create a new environment in the program.
        Parameters:
        programId - the program in which to create the environment
        name - the name of the new environment
        type - the type of environment to create
        region - the region in which to create the environment
        description - optional description of the environment
        Returns:
        the newly created environment
        Throws:
        CloudManagerApiException - when any error occurs
      • listLogs

        Collection<EnvironmentLog> listLogs​(@NotNull
                                            @NotNull String programId,
                                            @NotNull
                                            @NotNull String environmentId,
                                            @NotNull
                                            @NotNull LogOption option,
                                            int days)
                                     throws CloudManagerApiException
        List logs of the specified type for the environment.
        Parameters:
        programId - the program id for the environment
        environmentId - the environment id
        option - the type of logs to list
        days - then number of days of logs to list
        Returns:
        the list of environment logs
        Throws:
        CloudManagerApiException - when any error occurs
      • getLogDownloadUrl

        String getLogDownloadUrl​(@NotNull
                                 @NotNull String programId,
                                 @NotNull
                                 @NotNull String environmentId,
                                 @NotNull
                                 @NotNull LogOption option,
                                 @NotNull
                                 @NotNull LocalDate date)
                          throws CloudManagerApiException
        Get the fully qualified URL to the log file for download.
        Parameters:
        programId - the program id for the environment
        environmentId - the environment id
        option - the type of logs to download
        date - the date of the logs to download
        Returns:
        the log file download url
        Throws:
        CloudManagerApiException - when any error occurs
      • getLogDownloadUrl

        String getLogDownloadUrl​(@NotNull
                                 @NotNull Environment environment,
                                 @NotNull
                                 @NotNull LogOption option,
                                 @NotNull
                                 @NotNull LocalDate date)
                          throws CloudManagerApiException
        Get the fully qualified URL to the log file for download.
        Parameters:
        environment - the environment
        option - the type of logs to download
        date - the date of the logs to download
        Returns:
        the log file download url
        Throws:
        CloudManagerApiException - when any error occurs
      • getRegionDeployment

        @NotNull
        @NotNull RegionDeployment getRegionDeployment​(@NotNull
                                                      @NotNull String programId,
                                                      @NotNull
                                                      @NotNull String environmentId,
                                                      @NotNull
                                                      @NotNull String deploymentId)
                                               throws CloudManagerApiException
        Get the region deployment.
        Parameters:
        programId - the program id of the deployment
        environmentId - the environment id of the deployment
        deploymentId - the id of the deployment
        Returns:
        the region deployment details
        Throws:
        CloudManagerApiException - when any error occurs
      • createRegionDeployments

        void createRegionDeployments​(@NotNull
                                     @NotNull Environment environment,
                                     @NotNull
                                     @NotNull Region... regions)
                              throws CloudManagerApiException
        Create a new deployment in the specified region.
        Parameters:
        environment - the environment to update
        regions - the regions in which to deploy
        Throws:
        CloudManagerApiException - when any error occurs
      • removeRegionDeployments

        void removeRegionDeployments​(@NotNull
                                     @NotNull Environment environment,
                                     @NotNull
                                     @NotNull Region... regions)
                              throws CloudManagerApiException
        Remove the deployment from the specified region.
        Parameters:
        environment - the environment to update
        regions - the regions from which to remove the deployment
        Throws:
        CloudManagerApiException - when any error occurs
      • getVariables

        @NotNull
        @NotNull Set<Variable> getVariables​(@NotNull
                                            @NotNull String programId,
                                            @NotNull
                                            @NotNull String environmentId)
                                     throws CloudManagerApiException
        List all variables associated with the environment.
        Parameters:
        programId - the program id of the environment
        environmentId - the environment id
        Returns:
        set of variables in the environment
        Throws:
        CloudManagerApiException - when any error occurs
      • setVariables

        @NotNull
        @NotNull Set<Variable> setVariables​(@NotNull
                                            @NotNull String programId,
                                            @NotNull
                                            @NotNull String environmentId,
                                            Variable... variables)
                                     throws CloudManagerApiException
        Set the variables in the environment.
        Parameters:
        programId - the program id of the environment
        environmentId - the environment id
        variables - the variables to set
        Returns:
        updated list of variables in the environment
        Throws:
        CloudManagerApiException - when any error occurs
      • setVariables

        @NotNull
        @NotNull Set<Variable> setVariables​(@NotNull
                                            @NotNull Environment environment,
                                            Variable... variables)
                                     throws CloudManagerApiException
        Set the variables in the environment.
        Parameters:
        environment - the environment context
        variables - the variables to set
        Returns:
        updated list of variables in the environment
        Throws:
        CloudManagerApiException - when any error occurs
      • resetRde

        void resetRde​(@NotNull
                      @NotNull String programId,
                      @NotNull
                      @NotNull String environmentId)
               throws CloudManagerApiException
        Reset the Rapid Development Environment. If the environment is not an RDE, result is undefined.
        Parameters:
        programId - the program id of the environment
        environmentId - the environment id
        Throws:
        CloudManagerApiException - when any error occurs
      • resetRde

        void resetRde​(@NotNull
                      @NotNull Environment environment)
               throws CloudManagerApiException
        Reset the Rapid Development Environment. If the environment is not an RDE, result is undefined.
        Parameters:
        environment - the environment
        Throws:
        CloudManagerApiException - when any error occurs
      • downloadLogs

        @NotNull
        @NotNull Collection<EnvironmentLog> downloadLogs​(@NotNull
                                                         @NotNull String programId,
                                                         @NotNull
                                                         @NotNull String environmentId,
                                                         @NotNull
                                                         @NotNull LogOption logOption,
                                                         int days,
                                                         @NotNull
                                                         @NotNull File dir)
                                                  throws CloudManagerApiException
        Downloads the logs for the environment, to the specified folder.
        Parameters:
        programId - the program id context for the environment
        environmentId - the environment id
        logOption - the log file reference
        days - how many days of log files to retrieve
        dir - the directory in which to save the files
        Returns:
        a list of EnvironmentLogs with details about the downloaded files
        Throws:
        CloudManagerApiException - when any error occurs
      • downloadLogs

        @NotNull
        @NotNull Collection<EnvironmentLog> downloadLogs​(@NotNull
                                                         @NotNull Environment environment,
                                                         @NotNull
                                                         @NotNull LogOption logOption,
                                                         int days,
                                                         @NotNull
                                                         @NotNull File dir)
                                                  throws CloudManagerApiException
        Downloads the logs for the environment, to the specified folder.
        Parameters:
        environment - the environment context
        logOption - the log file reference
        days - how many days of log files to retrieve
        dir - the directory in which to save the files
        Returns:
        a list of EnvironmentLogs with details about the downloaded files
        Throws:
        CloudManagerApiException - when any error occurs