Interface ModulesController
- All Known Implementing Classes:
Modules,Modules,ModulesEE8
public interface ModulesController
Modules query and control operations needed by the ModulesService.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumEnum for tracking the state of a module (running/stopped). -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetDefaultVersion(String moduleName) Returns the default version for a named module.getHostname(String moduleName, String version, int instance) Returns the host name of the requested module version instance.Returns all the known module names.getModuleState(String moduleName) Returns the current state of this module.intgetNumInstances(String moduleName, String version) Returns the number of instances for the requested module version.getScalingType(String moduleName) Returns the type of scaling in use for this module.getVersions(String moduleName) Returns all known versions of the requested module.voidsetNumInstances(String moduleName, String version, int numInstances) Sets the number of instances for the requested module version.voidstartModule(String moduleName, String version) Starts the requested module version.voidstopModule(String moduleName, String version) Stops the requested module version.
-
Field Details
-
MODULES_CONTROLLER_ATTRIBUTE_KEY
- See Also:
-
-
Method Details
-
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 codeif the requested module is not configuredinvalid reference
.modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_MODULE_VALUE
-
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 codeif the requested module is not configuredinvalid reference
.modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_MODULE_VALUE
-
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 codeif the requested module is not configured andinvalid reference
.modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_MODULE_VALUEif the requested version is not configured.invalid reference
.modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_VERSION_VALUE
-
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 codeif the requested module is not configured andinvalid reference
.modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_MODULE_VALUEif the requested version is not configured for setting instancesinvalid reference
.modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_VERSION_VALUE.ErrorCode#INVALID_INSTANCESif 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 orinvalid reference
.tools.development.LocalEnvironment#MAIN_INSTANCE- Throws:
com.google.apphosting.api.ApiProxy.ApplicationException- with error codeif the requested module is not configured andinvalid reference
.modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_MODULE_VALUEif the requested version is not configured andinvalid reference
.modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_VERSION_VALUEif the requested instance is not configured.invalid reference
.modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_INSTANCES_VALUE
-
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-if the requested module is not a configured manual scaling module andinvalid reference
.modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_MODULE_VALUE.ErrorCode#INVALID_VERSION_VALUEif the requested version is not configured or is not a manual scaling module and.ModulesServiceError.ErrorCode#UNEXPECTED_STATEif 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-if the requested module is not a configured manual scaling module andinvalid reference
.modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_MODULE_VALUE.ModulesServiceError.ErrorCode#INVALID_VERSION_VALUEif the requested version is not configured or is not a manual scaling module and.ErrorCode#UNEXPECTED_STATEif 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 codeif the requested module is not configuredinvalid reference
.modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_MODULE_VALUE
-
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 codeif the requested module is not configuredinvalid reference
.modules.ModulesServicePb.ModulesServiceError.ErrorCode#INVALID_MODULE_VALUE
-