0

docs之后,有一个为特定 OU 导出所有内容的示例

def create_drive_ou_all_data_export(service, matter_id):
  ou_to_search = 'ou id retrieved from admin sdk'
  drive_query_options = {'includeSharedDrives': True}
  drive_query = {
      'corpus': 'DRIVE',
      'dataScope': 'ALL_DATA',
      'searchMethod': 'ORG_UNIT',
      'orgUnitInfo': {
          'org_unit_id': ou_to_search
      },
      'driveOptions': drive_query_options,
      'startTime': '2017-03-16T00:00:00Z',
      'endTime': '2017-09-23T00:00:00Z',
      'timeZone': 'Etc/GMT+2'
  }
  drive_export_options = {'includeAccessInfo': False}
  wanted_export = {
      'name': 'My first drive ou export',
      'query': drive_query,
      'exportOptions': {
          'driveOptions': drive_export_options
      }
  }
  return service.matters().exports().create(
      matterId=matter_id, body=wanted_export).execute()

但是,它没有显示如何为给定用户导出,这可能吗?此外,用于创建导出的所有不同主体选项在哪里?这些示例似乎并未显示所有可用的参数。

4

1 回答 1

0

您想使用 searchMethod:account 参考查询:https ://developers.google.com/vault/reference/rest/v1/ 查询参考搜索方法:https : //developers.google.com/vault/reference/rest/ v1/Query#SearchMethod 参考 AccountInfo:https ://developers.google.com/vault/reference/rest/v1/Query#AccountInfo

drive_query = {
      'corpus': 'DRIVE',
      'dataScope': 'ALL_DATA',
      'searchMethod': 'ACCOUNT', # This is different
      'accountInfo': { # This is different
          'emails': ['email1@company.com', 'email2@company.com', 'email3@company.com']
      },
      'driveOptions': drive_query_options,
      'startTime': '2017-03-16T00:00:00Z',
      'endTime': '2017-09-23T00:00:00Z',
      'timeZone': 'Etc/GMT+2'
  }
于 2019-09-04T23:12:37.707 回答