【问题标题】:Google Drive Export (Google Vault) for Specific User特定用户的 Google 云端硬盘导出(Google 保险柜)
【发布时间】:2019-08-13 18:06:19
【问题描述】:

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()

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

【问题讨论】:

    标签: python google-api google-drive-api google-vault-api


    【解决方案1】:

    您想使用 searchMethod:account 参考查询:https://developers.google.com/vault/reference/rest/v1/Query 参考搜索方法: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'
      }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多