Revision created by MOE tool push_codebase.
[gae.git] / java / src / main / com / google / appengine / tools / development / ServersController.java
blob3d30909397f1281e3c40f15ae8e21bb1cee0edb4
1 package com.google.appengine.tools.development;
3 import com.google.apphosting.api.ApiProxy;
5 /**
6 * Servers query and control operations needed by the ServersService.
7 */
8 public interface ServersController {
9 /**
10 * Returns all the known server names.
12 Iterable<String> getServerNames();
14 /**
15 * Returns all known versions of the requested server.
17 * @throws ApiProxy.ApplicationException with error code {@link com.google.appengine.api
18 * .labs.servers.ServersServicePb.ServersServiceError.ErrorCode#INVALID_SERVER_VALUE} if
19 * the requested server is not configured
21 Iterable<String> getVersions(String serverName) throws ApiProxy.ApplicationException;
23 /**
24 * Returns the default version for a named server.
26 * @throws ApiProxy.ApplicationException with error code {@link com.google.appengine.api
27 * .labs.servers.ServersServicePb.ServersServiceError.ErrorCode#INVALID_SERVER_VALUE} if
28 * the requested server is not configured
30 String getDefaultVersion(String serverName) throws ApiProxy.ApplicationException;
32 /**
33 * Returns the number of instances for the requested server/version.
35 * @throws ApiProxy.ApplicationException with error code {@link com.google.appengine.api
36 * .labs.servers.ServersServicePb.ServersServiceError.ErrorCode#INVALID_SERVER_VALUE} if
37 * the requested server is not configured and {@link com.google.appengine.api
38 * .labs.servers.ServersServicePb.ServersServiceError.ErrorCode#INVALID_VERSION_VALUE}
39 * if the requested version is not configured.
41 int getNumInstances(String serverName, String version) throws ApiProxy.ApplicationException;
43 /**
44 * Returns the hostname the requested server/version/instance.
46 * @param serverName the serverName whose host we return.
47 * @param version the version whose host we return.
48 * @param instance the instance whose host we return or {@link com.google.appengine
49 * .tools.development.LocalEnvironment#MAIN_INSTANCE}
51 * @throws ApiProxy.ApplicationException with error code {@link com.google.appengine.api
52 * .labs.servers.ServersServicePb.ServersServiceError.ErrorCode#INVALID_SERVER_VALUE} if
53 * the requested server is not configured and {@link com.google.appengine.api
54 * .labs.servers.ServersServicePb.ServersServiceError.ErrorCode#INVALID_VERSION_VALUE}
55 * if the requested version is not configured and {@link com.google.appengine.api
56 * .labs.servers.ServersServicePb.ServersServiceError.ErrorCode#INVALID_INSTANCES_VALUE}
57 * if the requested instance is not configured.
59 String getHostname(String serverName, String version, int instance)
60 throws ApiProxy.ApplicationException;
62 /**
63 * Starts the requested server version.
64 * @throws ApiProxy.ApplicationException {@link com.google.appengine.api
65 * .labs.servers.ServersServicePb.ServersServiceError.ErrorCode#INVALID_SERVER_VALUE} if
66 * the requested server is not a configured manual scaling server and
67 * {@link com.google.appengine.api.labs.servers.ServersServicePb
68 * .ServersServiceError.ErrorCode#INVALID_VERSION_VALUE} if the requested
69 * version is not configured or is not a manual scaling server and
70 * {@link com.google.appengine.api.labs.servers.ServersServicePb
71 * .ServersServiceError.ErrorCode#UNEXPECTED_STATE} if the server instance is
72 * not stopped and ready to be started.
74 void startServer(String serverName, String version) throws ApiProxy.ApplicationException;
76 /**
77 * Stops the requested server version.
78 * @throws ApiProxy.ApplicationException {@link com.google.appengine.api
79 * .labs.servers.ServersServicePb.ServersServiceError.ErrorCode#INVALID_SERVER_VALUE} if
80 * the requested server is not a configured manual scaling server and
81 * {@link com.google.appengine.api.labs.servers.ServersServicePb
82 * .ServersServiceError.ErrorCode#INVALID_VERSION_VALUE} if the requested
83 * version is not configured or is not a manual scaling server and
84 * {@link com.google.appengine.api.labs.servers.ServersServicePb
85 * .ServersServiceError.ErrorCode#UNEXPECTED_STATE} if the server instance is
86 * not running and ready to be stopped.
88 void stopServer(String serverName, String version) throws ApiProxy.ApplicationException;