Interface ModulesController

All Known Implementing Classes:
Modules, Modules, ModulesEE8

public interface ModulesController
Modules query and control operations needed by the ModulesService.
  • Field Details

  • Method Details

    • getModuleNames

      Iterable<String> getModuleNames()
      Returns all the known module names.
    • getVersions

      Iterable<String> getVersions(String moduleName) throws com.google.apphosting.api.ApiProxy.ApplicationException
      Returns all known versions of the requested module.
      Throws:
      com.google.apphosting.api.ApiProxy.ApplicationException - with error code
      invalid reference
      .modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_MODULE_VALUE
      if the requested module is not configured
    • getDefaultVersion

      String getDefaultVersion(String moduleName) throws com.google.apphosting.api.ApiProxy.ApplicationException
      Returns the default version for a named module.
      Throws:
      com.google.apphosting.api.ApiProxy.ApplicationException - with error code
      invalid reference
      .modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_MODULE_VALUE
      if the requested module is not configured
    • getNumInstances

      int getNumInstances(String moduleName, String version) throws com.google.apphosting.api.ApiProxy.ApplicationException
      Returns the number of instances for the requested module version.
      Throws:
      com.google.apphosting.api.ApiProxy.ApplicationException - with error code
      invalid reference
      .modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_MODULE_VALUE
      if the requested module is not configured and
      invalid reference
      .modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_VERSION_VALUE
      if the requested version is not configured.
    • setNumInstances

      void setNumInstances(String moduleName, String version, int numInstances) throws com.google.apphosting.api.ApiProxy.ApplicationException
      Sets the number of instances for the requested module version.
      Throws:
      com.google.apphosting.api.ApiProxy.ApplicationException - with error code
      invalid reference
      .modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_MODULE_VALUE
      if the requested module is not configured and
      invalid reference
      .modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_VERSION_VALUE
      if the requested version is not configured for setting instances .ErrorCode#INVALID_INSTANCES if numInstances is not a legal value.
    • getHostname

      String getHostname(String moduleName, String version, int instance) throws com.google.apphosting.api.ApiProxy.ApplicationException
      Returns the host name of the requested module version instance.
      Parameters:
      moduleName - the moduleName whose host we return.
      version - the version whose host we return.
      instance - the instance whose host we return or
      invalid reference
      .tools.development.LocalEnvironment#MAIN_INSTANCE
      Throws:
      com.google.apphosting.api.ApiProxy.ApplicationException - with error code
      invalid reference
      .modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_MODULE_VALUE
      if the requested module is not configured and
      invalid reference
      .modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_VERSION_VALUE
      if the requested version is not configured and
      invalid reference
      .modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_INSTANCES_VALUE
      if the requested instance is not configured.
    • startModule

      void startModule(String moduleName, String version) throws com.google.apphosting.api.ApiProxy.ApplicationException
      Starts the requested module version.
      Throws:
      com.google.apphosting.api.ApiProxy.ApplicationException -
      invalid reference
      .modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_MODULE_VALUE
      if the requested module is not a configured manual scaling module and .ErrorCode#INVALID_VERSION_VALUE if the requested version is not configured or is not a manual scaling module and .ModulesServiceError.ErrorCode#UNEXPECTED_STATE if the module instance is not stopped and ready to be started.
    • stopModule

      void stopModule(String moduleName, String version) throws com.google.apphosting.api.ApiProxy.ApplicationException
      Stops the requested module version.
      Throws:
      com.google.apphosting.api.ApiProxy.ApplicationException -
      invalid reference
      .modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_MODULE_VALUE
      if the requested module is not a configured manual scaling module and .ModulesServiceError.ErrorCode#INVALID_VERSION_VALUE if the requested version is not configured or is not a manual scaling module and .ErrorCode#UNEXPECTED_STATE if the module instance is not running and ready to be stopped.
    • getScalingType

      String getScalingType(String moduleName) throws com.google.apphosting.api.ApiProxy.ApplicationException
      Returns the type of scaling in use for this module.
      Throws:
      com.google.apphosting.api.ApiProxy.ApplicationException - with error code
      invalid reference
      .modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_MODULE_VALUE
      if the requested module is not configured
    • getModuleState

      ModulesController.ModuleState getModuleState(String moduleName) throws com.google.apphosting.api.ApiProxy.ApplicationException
      Returns the current state of this module.
      Throws:
      com.google.apphosting.api.ApiProxy.ApplicationException - with error code
      invalid reference
      .modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_MODULE_VALUE
      if the requested module is not configured