![]() |
App Engine Python SDK
v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
|
Classes | |
class | Action |
Public Member Functions | |
def | __init__ |
def | Run |
def | Help |
def | DownloadApp |
def | UpdateVersion |
def | UpdateUsingSpecificFiles |
def | Update |
def | VacuumIndexes |
def | UpdateCron |
def | UpdateIndexes |
def | UpdateQueues |
def | UpdateDispatch |
def | UpdateDos |
def | BackendsAction |
def | BackendsPhpCheck |
def | BackendsYamlCheck |
def | BackendsUpdate |
def | BackendsList |
def | BackendsRollback |
def | BackendsStart |
def | BackendsStop |
def | BackendsDelete |
def | BackendsConfigure |
def | ListVersions |
def | DeleteVersion |
def | DebugAction |
def | StartModuleVersion |
def | StopModuleVersion |
def | Rollback |
def | SetDefaultVersion |
def | MigrateTraffic |
def | RequestLogs |
def | CronInfo |
def | InferRemoteApiUrl |
def | RunBulkloader |
def | PerformDownload |
def | PerformUpload |
def | CreateBulkloadConfig |
def | ResourceLimitsInfo |
Static Public Attributes | |
string | function = 'Help' |
string | usage = '%prog help <action>' |
string | short_desc = 'Print help for a specific action.' |
uses_basepath = False), | |
options = _UpdateOptions, | |
string | long_desc |
string | error_desc |
hidden = True), | |
Singleton class to wrap AppCfg tool functionality. This class is responsible for parsing the command line and executing the desired action on behalf of the user. Processing files and communicating with the server is handled by other classes. Attributes: actions: A dictionary mapping action names to Action objects. action: The Action specified on the command line. parser: An instance of optparse.OptionParser. options: The command line options parsed by 'parser'. argv: The original command line as a list. args: The positional command line args left over after parsing the options. raw_input_fn: Function used for getting raw user input, like email. password_input_fn: Function used for getting user password. error_fh: Unexpected HTTPErrors are printed to this file handle. Attributes for testing: parser_class: The class to use for parsing the command line. Because OptionsParser will exit the program when there is a parse failure, it is nice to subclass OptionsParser and catch the error before exiting. read_url_contents: A function to read the contents of a URL. override_java_supported: If not None, forces the code to assume that Java support is (True) or is not (False) present.
def google.appengine.tools.appcfg.AppCfgApp.__init__ | ( | self, | |
argv, | |||
parser_class = optparse.OptionParser , |
|||
rpc_server_class = None , |
|||
raw_input_fn = raw_input , |
|||
password_input_fn = getpass.getpass , |
|||
out_fh = sys.stdout , |
|||
error_fh = sys.stderr , |
|||
update_check_class = sdk_update_checker.SDKUpdateChecker , |
|||
throttle_class = None , |
|||
opener = open , |
|||
file_iterator = FileIterator , |
|||
time_func = time.time , |
|||
wrap_server_error_message = True , |
|||
oauth_client_id = APPCFG_CLIENT_ID , |
|||
oauth_client_secret = APPCFG_CLIENT_NOTSOSECRET , |
|||
oauth_scopes = APPCFG_SCOPES , |
|||
override_java_supported = None |
|||
) |
Initializer. Parses the cmdline and selects the Action to use. Initializes all of the attributes described in the class docstring. Prints help or error messages if there is an error parsing the cmdline. Args: argv: The list of arguments passed to this program. parser_class: Options parser to use for this application. rpc_server_class: RPC server class to use for this application. raw_input_fn: Function used for getting user email. password_input_fn: Function used for getting user password. out_fh: All normal output is printed to this file handle. error_fh: Unexpected HTTPErrors are printed to this file handle. update_check_class: sdk_update_checker.SDKUpdateChecker class (can be replaced for testing). throttle_class: A class to use instead of ThrottledHttpRpcServer (only used in the bulkloader). opener: Function used for opening files. file_iterator: Callable that takes (basepath, skip_files, file_separator) and returns a generator that yields all filenames in the file tree rooted at that path, skipping files that match the skip_files compiled regular expression. time_func: A time.time() compatible function, which can be overridden for testing. wrap_server_error_message: If true, the error messages from urllib2.HTTPError exceptions in Run() are wrapped with '--- begin server output ---' and '--- end server output ---', otherwise the error message is printed as is. oauth_client_id: The client ID of the project providing Auth. Defaults to the SDK default project client ID, the constant APPCFG_CLIENT_ID. oauth_client_secret: The client secret of the project providing Auth. Defaults to the SDK default project client secret, the constant APPCFG_CLIENT_NOTSOSECRET. oauth_scopes: The scope or set of scopes to be accessed by the OAuth2 token retrieved. Defaults to APPCFG_SCOPES. Can be a string or iterable of strings, representing the scope(s) to request. override_java_supported: If not None, forces the code to assume that Java support is (True) or is not (False) present.
def google.appengine.tools.appcfg.AppCfgApp.BackendsAction | ( | self | ) |
Placeholder; we never expect this action to be invoked.
def google.appengine.tools.appcfg.AppCfgApp.BackendsConfigure | ( | self | ) |
Changes the configuration of an existing backend.
def google.appengine.tools.appcfg.AppCfgApp.BackendsDelete | ( | self | ) |
Deletes a backend.
def google.appengine.tools.appcfg.AppCfgApp.BackendsList | ( | self | ) |
Lists all backends for an app.
def google.appengine.tools.appcfg.AppCfgApp.BackendsPhpCheck | ( | self, | |
appyaml | |||
) |
Don't support backends with the PHP runtime. This should be used to prevent use of backends update/start/configure with the PHP runtime. We continue to allow backends stop/delete/list/rollback just in case there are existing PHP backends. Args: appyaml: A parsed app.yaml file.
def google.appengine.tools.appcfg.AppCfgApp.BackendsRollback | ( | self | ) |
Does a rollback of an existing transaction on this backend.
def google.appengine.tools.appcfg.AppCfgApp.BackendsStart | ( | self | ) |
Starts a backend.
def google.appengine.tools.appcfg.AppCfgApp.BackendsStop | ( | self | ) |
Stops a backend.
def google.appengine.tools.appcfg.AppCfgApp.BackendsUpdate | ( | self | ) |
Updates a backend.
def google.appengine.tools.appcfg.AppCfgApp.BackendsYamlCheck | ( | self, | |
basepath, | |||
appyaml, | |||
backend = None |
|||
) |
Check the backends.yaml file is sane and which backends to update.
def google.appengine.tools.appcfg.AppCfgApp.CreateBulkloadConfig | ( | self, | |
run_fn = None |
|||
) |
Create a bulkloader config via the bulkloader wizard. Args: run_fn: Function to invoke the bulkloader, used for testing.
def google.appengine.tools.appcfg.AppCfgApp.CronInfo | ( | self, | |
now = None , |
|||
output = sys.stdout |
|||
) |
Displays information about cron definitions. Args: now: used for testing. output: Used for testing.
def google.appengine.tools.appcfg.AppCfgApp.DebugAction | ( | self | ) |
Sets the specified version and instance for an app to be debuggable.
def google.appengine.tools.appcfg.AppCfgApp.DeleteVersion | ( | self | ) |
Deletes the specified version for an app.
def google.appengine.tools.appcfg.AppCfgApp.DownloadApp | ( | self | ) |
Downloads the given app+version.
def google.appengine.tools.appcfg.AppCfgApp.Help | ( | self, | |
action = None |
|||
) |
Prints help for a specific action. Args: action: If provided, print help for the action provided. Expects self.args[0], or 'action', to contain the name of the action in question. Exits the program after printing the help message.
def google.appengine.tools.appcfg.AppCfgApp.InferRemoteApiUrl | ( | self, | |
appyaml | |||
) |
Uses app.yaml to determine the remote_api endpoint. Args: appyaml: A parsed app.yaml file. Returns: The url of the remote_api endpoint as a string, or None
def google.appengine.tools.appcfg.AppCfgApp.ListVersions | ( | self | ) |
Lists all versions for an app.
def google.appengine.tools.appcfg.AppCfgApp.MigrateTraffic | ( | self | ) |
Migrates traffic.
def google.appengine.tools.appcfg.AppCfgApp.PerformDownload | ( | self, | |
run_fn = None |
|||
) |
Performs a datastore download via the bulkloader. Args: run_fn: Function to invoke the bulkloader, used for testing.
def google.appengine.tools.appcfg.AppCfgApp.PerformUpload | ( | self, | |
run_fn = None |
|||
) |
Performs a datastore upload via the bulkloader. Args: run_fn: Function to invoke the bulkloader, used for testing.
def google.appengine.tools.appcfg.AppCfgApp.RequestLogs | ( | self | ) |
Write request logs to a file.
def google.appengine.tools.appcfg.AppCfgApp.ResourceLimitsInfo | ( | self, | |
output = None |
|||
) |
Outputs the current resource limits. Args: output: The file handle to write the output to (used for testing).
def google.appengine.tools.appcfg.AppCfgApp.Rollback | ( | self | ) |
Does a rollback of an existing transaction for this app version.
def google.appengine.tools.appcfg.AppCfgApp.Run | ( | self | ) |
Executes the requested action. Catches any HTTPErrors raised by the action and prints them to stderr. Returns: 1 on error, 0 if successful.
def google.appengine.tools.appcfg.AppCfgApp.RunBulkloader | ( | self, | |
arg_dict | |||
) |
Invokes the bulkloader with the given keyword arguments. Args: arg_dict: Dictionary of arguments to pass to bulkloader.Run().
def google.appengine.tools.appcfg.AppCfgApp.SetDefaultVersion | ( | self | ) |
Sets the default version.
def google.appengine.tools.appcfg.AppCfgApp.StartModuleVersion | ( | self | ) |
Starts one or more versions.
def google.appengine.tools.appcfg.AppCfgApp.StopModuleVersion | ( | self | ) |
Stops one or more versions.
def google.appengine.tools.appcfg.AppCfgApp.Update | ( | self | ) |
Updates and deploys a new appversion and global app configs.
def google.appengine.tools.appcfg.AppCfgApp.UpdateCron | ( | self | ) |
Updates any new or changed cron definitions.
def google.appengine.tools.appcfg.AppCfgApp.UpdateDispatch | ( | self | ) |
Updates new or changed dispatch definitions.
def google.appengine.tools.appcfg.AppCfgApp.UpdateDos | ( | self | ) |
Updates any new or changed dos definitions.
def google.appengine.tools.appcfg.AppCfgApp.UpdateIndexes | ( | self | ) |
Updates indexes.
def google.appengine.tools.appcfg.AppCfgApp.UpdateQueues | ( | self | ) |
Updates any new or changed task queue definitions.
def google.appengine.tools.appcfg.AppCfgApp.UpdateUsingSpecificFiles | ( | self | ) |
Updates and deploys new app versions based on given config files.
def google.appengine.tools.appcfg.AppCfgApp.UpdateVersion | ( | self, | |
rpcserver, | |||
basepath, | |||
appyaml, | |||
module_yaml_path, | |||
backend = None |
|||
) |
Updates and deploys a new appversion. Args: rpcserver: An AbstractRpcServer instance on which RPC calls can be made. basepath: The root directory of the version to update. appyaml: The AppInfoExternal object parsed from an app.yaml-like file. module_yaml_path: The (string) path to the yaml file, relative to the bundle directory. backend: The name of the backend to update, if any. Returns: An appinfo.AppInfoSummary if one was returned from the Deploy, None otherwise. Raises: RuntimeError: If go-app-builder fails to generate a mapping from relative paths to absolute paths, its stderr is raised.
def google.appengine.tools.appcfg.AppCfgApp.VacuumIndexes | ( | self | ) |
Deletes unused indexes.
|
static |
|
static |