Interface AppAdmin
-
public interface AppAdminThe application administration interface to App Engine. Use this API to update, configure, and otherwise manage an App Engine application. UseAppAdminFactoryto retrieve anAppAdmininstance 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 alistener. Other requests, such asupdateIndexes(), 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 require communicating to App Engine's remote administration server occur over 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface and Description static classAppAdmin.LogSeverityThe severity levels for App Engine application logging.static classAppAdmin.UpdateOptionsSettable options for configuring the behavior of update operations.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidconfigureBackend(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.StringdebugVersion()Sends a synchronous request to turn on debugging for the specified vm version.java.lang.StringdebugVersionState()Sends a synchronous request to get the status of a debug request for the specified version.voiddeleteBackend(java.lang.String backendName)Delete the backend with the specified name.java.lang.StringdeleteVersion(java.lang.String appId, java.lang.String moduleId, java.lang.String versionId)Sends a synchronous request to delete the specified versioncom.google.appengine.tools.admin.ResourceLimitsgetResourceLimits()Gets the resource limits.AppAdmin.UpdateOptionsgetUpdateOptions()Returns theAppAdmin.UpdateOptionsfor thisAppAdmin.java.util.List<BackendsXml.Entry>listBackends()Retrieve a list of registered backends with their associated state.java.lang.StringlistVersions()Sends a synchronous request to retrieve the list of versions for each module.voidmigrateTraffic()Sends a synchronous request to start a traffic migration.java.io.ReaderrequestLogs(int numDays, AppAdmin.LogSeverity severity, boolean includeAll)Retrieves application logs from the remote administration server.voidrollback()Rolls back an "in-progress" transaction.voidrollbackAllBackends()Rolls back an "in-progress" transaction on all backends.voidrollbackBackend(java.lang.String backend)Rolls back an "in-progress" transaction on a backend.voidsetBackendState(java.lang.String backendName, BackendsXml.State newState)Update the state of the backend with the specified name tonewState.voidsetDefaultVersion()Sends a synchronous request to update the application's default version.voidstageApplicationWithDefaultResourceLimits(java.io.File stagingDir)Stage an application directory with default resource limitsvoidstageApplicationWithRemoteResourceLimits(java.io.File stagingDir)Stage an application directory with remote resource limitsvoidstartModuleVersion()Start the specified module version.voidstopModuleVersion()Stop the specified module version.voidupdate(UpdateListener listener)Uploads a new version of the application and updates its indexes.voidupdateAllBackends(UpdateListener listener)Redeploy all backends.voidupdateBackend(java.lang.String backendName, UpdateListener listener)Redeploy the backend with the specified name.voidupdateBackends(java.util.List<java.lang.String> backendNames, UpdateListener listener)Redeploy the backends with the specified names.voidupdateCron()Sends a synchronous request to update the application's cron jobs.voidupdateDispatch()Sends a synchronous request to update the application's Dispatch configuration.voidupdateDos()Sends a synchronous request to update the application's DoS configuration.voidupdateIndexes()Sends a synchronous request to update the application's indexes.voidupdateQueues()Sends a synchronous request to update the application's task queue definitions.voidvacuumIndexes(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.
-
-
-
Method Detail
-
update
void update(UpdateListener listener)
Uploads a new version of the application and updates its indexes. The update may occur asynchronously, so anUpdateListenermust be installed to track progress.- Parameters:
listener- The listener to be notified of updates. Must not benull.- Throws:
AdminException- if an error occurs.
-
rollback
void rollback()
Rolls back an "in-progress" transaction. This operation occurs synchronously.- Throws:
AdminException- if an error occurs.
-
rollbackBackend
void rollbackBackend(java.lang.String backend)
Rolls back an "in-progress" transaction on a backend. This operation occurs synchronously.- Parameters:
backend- to rollback, or null for default app- Throws:
AdminException- if an error occurs.
-
rollbackAllBackends
void rollbackAllBackends()
Rolls back an "in-progress" transaction on all backends. This operation occurs synchronously.- Throws:
AdminException- if an error occurs.
-
updateIndexes
void updateIndexes()
Sends a synchronous request to update the application's indexes. This work completes asynchronously on the server.- Throws:
AdminException- if an error occurs.
-
updateCron
void updateCron()
Sends a synchronous request to update the application's cron jobs. This work completes synchronously on the server.- Throws:
AdminException- if an error occurs.
-
updateQueues
void updateQueues()
Sends a synchronous request to update the application's task queue definitions. This work completes synchronously on the server.- Throws:
AdminException- if an error occurs.
-
updateDispatch
void updateDispatch()
Sends a synchronous request to update the application's Dispatch configuration.- Throws:
AdminException- if an error occurs.
-
updateDos
void updateDos()
Sends a synchronous request to update the application's DoS configuration. This work completes synchronously on the server.- Throws:
AdminException- if an error occurs.
-
cronInfo
java.util.List<CronEntry> cronInfo()
Locally parses an application's configured cron entries and reports the upcoming several execution times.- Throws:
AdminException- if an error occurs.
-
getResourceLimits
com.google.appengine.tools.admin.ResourceLimits getResourceLimits()
Gets the resource limits. The values returned are a combination of values reported by the adminconsole/appserver plus locally defined defaults for any missing values.- Returns:
- The ResourceLimits object.
- Throws:
AdminException- if an error occurs.
-
vacuumIndexes
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. We will refer to these as orphaned indexes.
- If
callbackis not null, then theconfirmActionmethod will be called once for each of the orphaned indexes to confirm that it really should be deleted. - A request will be sent to the server to delete each of the confirmed indexes. This work completes asynchronously on the server.
- Parameters:
callback- Used to confirm deletions. May benullin which case no confirmation will be done.listener- The listener to be notified of updates. Must not benull.- Throws:
AdminException- if an error occurs.
-
requestLogs
java.io.Reader requestLogs(int numDays, AppAdmin.LogSeverity severity, boolean includeAll)Retrieves application logs from the remote administration server.- Parameters:
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.- Returns:
- a non-null
Readerwhich can be used to stream the logs from the remote administration server. You shouldclosetheReaderwhen you're finished reading logs. It is ok toclosetheReaderbefore all logs have been read (streaming from the server is cancelled). - Throws:
AdminException- if an error occurs.
-
updateBackend
void updateBackend(java.lang.String backendName, UpdateListener listener)Redeploy the backend with the specified name.
-
updateBackends
void updateBackends(java.util.List<java.lang.String> backendNames, UpdateListener listener)Redeploy the backends with the specified names.
-
updateAllBackends
void updateAllBackends(UpdateListener listener)
Redeploy all backends.
-
listBackends
java.util.List<BackendsXml.Entry> listBackends()
Retrieve a list of registered backends with their associated state.
-
setBackendState
void setBackendState(java.lang.String backendName, BackendsXml.State newState)Update the state of the backend with the specified name tonewState.
-
deleteBackend
void deleteBackend(java.lang.String backendName)
Delete the backend with the specified name.
-
configureBackend
void configureBackend(java.lang.String backendName)
Reconfigure the backend with the specified name.
-
startModuleVersion
void startModuleVersion()
Start the specified module version.
-
stopModuleVersion
void stopModuleVersion()
Stop the specified module version.
-
setDefaultVersion
void setDefaultVersion()
Sends a synchronous request to update the application's default version. This work completes synchronously on the server.- Throws:
AdminException- if an error occurs.
-
listVersions
java.lang.String listVersions()
Sends a synchronous request to retrieve the list of versions for each module.- Returns:
- Returns the YAML server response as a String.
- Throws:
AdminException- if an error occurs.
-
deleteVersion
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- Parameters:
appId- The application to delete the version from.moduleId- The module to delete the version from.versionId- The version to delete.- Returns:
- Returns the YAML server response as a String
- Throws:
AdminException- if an error occurs.
-
debugVersion
java.lang.String debugVersion()
Sends a synchronous request to turn on debugging for the specified vm version.- Returns:
- Returns the YAML server response as a String
- Throws:
AdminException- if an error occurs.
-
debugVersionState
java.lang.String debugVersionState()
Sends a synchronous request to get the status of a debug request for the specified version.- Returns:
- Returns the YAML server response as a String
- Throws:
AdminException- if an error occurs.
-
migrateTraffic
void migrateTraffic()
Sends a synchronous request to start a traffic migration. This work continues asynchronously on the server.- Throws:
AdminException- if an error occurs.
-
stageApplicationWithDefaultResourceLimits
void stageApplicationWithDefaultResourceLimits(java.io.File stagingDir)
Stage an application directory with default resource limits
-
stageApplicationWithRemoteResourceLimits
void stageApplicationWithRemoteResourceLimits(java.io.File stagingDir)
Stage an application directory with remote resource limits
-
getUpdateOptions
AppAdmin.UpdateOptions getUpdateOptions()
Returns theAppAdmin.UpdateOptionsfor thisAppAdmin.
-
-