Ejemplo n.º 1
0
 def get(self):
   services = sorted(
       replication.AuthReplicaState.query(
           ancestor=replication.replicas_root_key()),
       key=lambda x: x.key.id())
   last_auth_state = model.get_replication_state()
   self.send_response({
     'services': [
       x.to_serializable_dict(with_id_as='app_id') for x in services
     ],
     'auth_code_version': version.__version__,
     'auth_db_rev': {
       'primary_id': last_auth_state.primary_id,
       'rev': last_auth_state.auth_db_rev,
       'ts': utils.datetime_to_timestamp(last_auth_state.modified_ts),
     },
     'now': utils.datetime_to_timestamp(utils.utcnow()),
   })
Ejemplo n.º 2
0
 def get(self):
     services = sorted(replication.AuthReplicaState.query(
         ancestor=replication.replicas_root_key()),
                       key=lambda x: x.key.id())
     last_auth_state = model.get_replication_state()
     self.send_response({
         'services':
         [x.to_serializable_dict(with_id_as='app_id') for x in services],
         'auth_code_version':
         version.__version__,
         'auth_db_rev': {
             'primary_id': last_auth_state.primary_id,
             'rev': last_auth_state.auth_db_rev,
             'ts': utils.datetime_to_timestamp(last_auth_state.modified_ts),
         },
         'now':
         utils.datetime_to_timestamp(utils.utcnow()),
     })