App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | Public Attributes | List of all members
google.appengine.tools.appcfg.VacuumIndexesOperation Class Reference
Inheritance diagram for google.appengine.tools.appcfg.VacuumIndexesOperation:
google.appengine.tools.appcfg.IndexOperation

Public Member Functions

def __init__
 
def GetConfirmation
 
def DoVacuum
 
- Public Member Functions inherited from google.appengine.tools.appcfg.IndexOperation
def __init__
 
def DoDiff
 
def DoDelete
 

Public Attributes

 force
 
 confirmation_fn
 
- Public Attributes inherited from google.appengine.tools.appcfg.IndexOperation
 rpcserver
 
 error_fh
 

Detailed Description

Provide facilities to request the deletion of datastore indexes.

Constructor & Destructor Documentation

def google.appengine.tools.appcfg.VacuumIndexesOperation.__init__ (   self,
  rpcserver,
  force,
  confirmation_fn = raw_input,
  error_fh = sys.stderr 
)
Creates a new VacuumIndexesOperation.

Args:
  rpcserver: The RPC server to use.  Should be an instance of HttpRpcServer
or TestRpcServer.
  force: True to force deletion of indexes, else False.
  confirmation_fn: Function used for getting input form user.
  error_fh: Where to send status and error messages.

Member Function Documentation

def google.appengine.tools.appcfg.VacuumIndexesOperation.DoVacuum (   self,
  definitions 
)
Vacuum indexes in datastore.

This method will query the server to determine which indexes are not
being used according to the user's local index.yaml file.  Once it has
made this determination, it confirms with the user which unused indexes
should be deleted.  Once confirmation for each index is receives, it
deletes those indexes.

Because another user may in theory delete the same indexes at the same
time as the user, there is a potential race condition.  In this rare cases,
some of the indexes previously confirmed for deletion will not be found.
The user is notified which indexes these were.

Args:
  definitions: datastore_index.IndexDefinitions as loaded from users
index.yaml file.
def google.appengine.tools.appcfg.VacuumIndexesOperation.GetConfirmation (   self,
  index 
)
Get confirmation from user to delete an index.

This method will enter an input loop until the user provides a
response it is expecting.  Valid input is one of three responses:

  y: Confirm deletion of index.
  n: Do not delete index.
  a: Delete all indexes without asking for further confirmation.

If the user enters nothing at all, the default action is to skip
that index and do not delete.

If the user selects 'a', as a side effect, the 'force' flag is set.

Args:
  index: Index to confirm.

Returns:
  True if user enters 'y' or 'a'.  False if user enter 'n'.

The documentation for this class was generated from the following file: