public interface AppAdmin
AppAdminFactory
to retrieve an AppAdmin
instance configured for a specific application.
Synchronous versus Asynchronous requests:
Some requests, such as update(com.google.appengine.tools.admin.UpdateListener)
, occur asynchronously
and must be monitored with a listener
. Other requests, such as
updateIndexes()
, are made synchronously. In either case,
work often continues to occur asynchronously on the remote server after the
request has been completed.
Error handling: Most configuration operations that communicate
with App Engine's remote administration server use a
network connection. In cases where unrecoverable failures occur (such as a
network failure), this API throws an
AdminException
.
Application updates occur transactionally. If a failure occurs during
update, you must rollback()
the incomplete transaction before
beginning another.
Modifier and Type | Interface and Description |
---|---|
static class |
AppAdmin.LogSeverity
The severity levels for App Engine application logging.
|
static class |
AppAdmin.UpdateOptions
Settable options for configuring the behavior of update operations.
|
Modifier and Type | Method and Description |
---|---|
void |
configureBackend(java.lang.String backendName)
Reconfigure the backend with the specified name.
|
java.util.List<CronEntry> |
cronInfo()
Locally parses an application's configured cron entries and reports the
upcoming several execution times.
|
java.lang.String |
debugVersion()
Sends a synchronous request to turn on debugging for the specified vm version.
|
java.lang.String |
debugVersionState()
Sends a synchronous request to get the status of a debug request for the specified version.
|
void |
deleteBackend(java.lang.String backendName)
Delete the backend with the specified name.
|
java.lang.String |
deleteVersion(java.lang.String appId,
java.lang.String moduleId,
java.lang.String versionId)
Sends a synchronous request to delete the specified version
|
com.google.appengine.tools.admin.ResourceLimits |
getResourceLimits()
Gets the resource limits.
|
AppAdmin.UpdateOptions |
getUpdateOptions()
Returns the
AppAdmin.UpdateOptions for this AppAdmin . |
java.util.List<BackendsXml.Entry> |
listBackends()
Retrieve a list of registered backends with their associated state.
|
java.lang.String |
listVersions()
Sends a synchronous request to retrieve the list of versions for each module.
|
void |
migrateTraffic()
Sends a synchronous request to start a traffic migration.
|
java.io.Reader |
requestLogs(int numDays,
AppAdmin.LogSeverity severity,
boolean includeAll)
Retrieves application logs from the remote administration server.
|
void |
rollback()
Rolls back an "in-progress" transaction.
|
void |
rollbackAllBackends()
Rolls back an "in-progress" transaction on all backends.
|
void |
rollbackBackend(java.lang.String backend)
Rolls back an "in-progress" transaction on a backend.
|
void |
setBackendState(java.lang.String backendName,
BackendsXml.State newState)
Update the state of the backend with the specified name to
newState . |
void |
setDefaultVersion()
Sends a synchronous request to update the application's default version.
|
void |
stageApplicationWithDefaultResourceLimits(java.io.File stagingDir)
Stage an application directory with default resource limits
|
void |
stageApplicationWithRemoteResourceLimits(java.io.File stagingDir)
Stage an application directory with remote resource limits
|
void |
startModuleVersion()
Start the specified module version.
|
void |
stopModuleVersion()
Stop the specified module version.
|
void |
update(UpdateListener listener)
Uploads a new version of the application and updates its indexes.
|
void |
updateAllBackends(UpdateListener listener)
Redeploy all backends.
|
void |
updateBackend(java.lang.String backendName,
UpdateListener listener)
Redeploy the backend with the specified name.
|
void |
updateBackends(java.util.List<java.lang.String> backendNames,
UpdateListener listener)
Redeploy the backends with the specified names.
|
void |
updateCron()
Sends a synchronous request to update the application's cron jobs.
|
void |
updateDispatch()
Sends a synchronous request to update the application's Dispatch configuration.
|
void |
updateDos()
Sends a synchronous request to update the application's DoS configuration.
|
void |
updateIndexes()
Sends a synchronous request to update the application's indexes.
|
void |
updateQueues()
Sends a synchronous request to update the application's task queue
definitions.
|
void |
vacuumIndexes(com.google.appengine.tools.admin.ConfirmationCallback<com.google.appengine.tools.admin.IndexDeleter.DeleteIndexAction> callback,
UpdateListener listener)
Performs the following three steps:
Queries the remote administration server for existing indexes
that are not included in the local index configuration file.
|
void update(UpdateListener listener)
UpdateListener
must be installed to track progress.listener
- The listener to be notified of updates. Must not be
null
.AdminException
- if an error occurs.void rollback()
AdminException
- if an error occurs.void rollbackBackend(java.lang.String backend)
backend
- to rollback, or null for default appAdminException
- if an error occurs.void rollbackAllBackends()
AdminException
- if an error occurs.void updateIndexes()
AdminException
- if an error occurs.void updateCron()
AdminException
- if an error occurs.void updateQueues()
AdminException
- if an error occurs.void updateDispatch()
AdminException
- if an error occurs.void updateDos()
AdminException
- if an error occurs.java.util.List<CronEntry> cronInfo()
AdminException
- if an error occurs.com.google.appengine.tools.admin.ResourceLimits getResourceLimits()
AdminException
- if an error occurs.void vacuumIndexes(com.google.appengine.tools.admin.ConfirmationCallback<com.google.appengine.tools.admin.IndexDeleter.DeleteIndexAction> callback, UpdateListener listener)
callback
is not null, then the confirmAction
method will be called once for each of the orphaned indexes
to confirm that it really should be deleted.
callback
- Used to confirm deletions. May be null
in which case no
confirmation will be done.listener
- The listener to be notified of updates. Must not be
null
.AdminException
- if an error occurs.java.io.Reader requestLogs(int numDays, AppAdmin.LogSeverity severity, boolean includeAll)
numDays
- The number of days to retrieve logs for. The cut-off
point is midnight UTC. Use 0 to get all available logs.severity
- The severity of app-level log messages to get. If null,
only request logs are returned.includeAll
- Include everything we know about a request, including
ms, cpu_ms and so on.Reader
which can be used to stream the logs
from the remote administration server. You should
close
the Reader
when you're finished reading
logs. It is ok to close
the Reader
before all logs have
been read (streaming from the server is cancelled).AdminException
- if an error occurs.void updateBackend(java.lang.String backendName, UpdateListener listener)
void updateBackends(java.util.List<java.lang.String> backendNames, UpdateListener listener)
void updateAllBackends(UpdateListener listener)
java.util.List<BackendsXml.Entry> listBackends()
void setBackendState(java.lang.String backendName, BackendsXml.State newState)
newState
.void deleteBackend(java.lang.String backendName)
void configureBackend(java.lang.String backendName)
void startModuleVersion()
void stopModuleVersion()
void setDefaultVersion()
AdminException
- if an error occurs.java.lang.String listVersions()
AdminException
- if an error occurs.java.lang.String deleteVersion(java.lang.String appId, java.lang.String moduleId, java.lang.String versionId)
appId
- The application to delete the version from.moduleId
- The module to delete the version from.versionId
- The version to delete.AdminException
- if an error occurs.java.lang.String debugVersion()
AdminException
- if an error occurs.java.lang.String debugVersionState()
AdminException
- if an error occurs.void migrateTraffic()
AdminException
- if an error occurs.void stageApplicationWithDefaultResourceLimits(java.io.File stagingDir)
void stageApplicationWithRemoteResourceLimits(java.io.File stagingDir)
AppAdmin.UpdateOptions getUpdateOptions()
AppAdmin.UpdateOptions
for this AppAdmin
.