python - 特定用户的 Google 云端硬盘导出(Google 保险柜)
问题描述
在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()
但是,它没有显示如何为给定用户导出,这可能吗?此外,用于创建导出的所有不同主体选项在哪里?这些示例似乎并未显示所有可用的参数。
解决方案
您想使用 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'
}
推荐阅读
- reactjs - 如何删除输入颜色选择器图像?
- c++ - 如何在 OpenGL 中使用立方体贴图数组来渲染带有阴影贴图的多个点光源?
- r - R采样数据帧行N次以运行聚类并捕获输出
- python - 指定时间后自动删除对象
- c - 使用win32 api(C语言)从串口读取问题
- javascript - 有没有办法为通过克隆节点创建的项目分配唯一 ID?
- java - 如何使用 javap 反汇编所有代码?
- zig - zig cc 是否公开链接器(ld)?
- jquery - 使用 jquery .toggleClass() 时切换虚线边框
- c# - 对应用程序进行编程以在应用程序窗口/ c# 中显示另一台设备的 vga 输出