传输数据
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
如需使用 Data Transfer API,您需要定义传输,然后使用 insert
方法启动传输。转移是根据要转移数据的一个或多个应用定义的,并且可以包含特定于应用的参数。
以下是转移流程的概要说明:
- 确定要为哪些应用转移数据。
- 定义
DataTransfer
资源,用于指定源用户和目标用户,以及要将数据传输到的应用。
- 使用
insert()
方法发起转移。
例如,以下 JSON 请求正文会将日历从来源用户 (SOURCE_USER_ID
) 转移到目标用户 (DESTINATION_USER_ID
)。您可以通过调用 Directory API 的 user.get()
方法并提供其电子邮件地址或电子邮件别名来检索每个所有者的用户 ID。
{
"oldOwnerUserId": "SOURCE_USER_ID",
"newOwnerUserId": "DESTINATION_USER_ID",
"applicationDataTransfers": [
{
"applicationId": "435070579839",
"applicationTransferParams": [
{
"key": "RELEASE_RESOURCES",
"value": [
"TRUE"
]
}
]
}
]
}
Data Transfer API 包含其他方法和资源,可帮助您构建和管理转移,让您能够执行以下操作:
- 列出可用于数据传输的应用。
- 根据应用 ID 获取应用信息。
- 按来源用户、目标用户或状态列出转移。
- 按资源 ID 获取转移请求。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-25。
[null,null,["最后更新时间 (UTC):2025-03-25。"],[],[],null,["# Transfer data\n\nTo use the Data Transfer API, you define a transfer and then initiate\nit using the `insert` method. The transfer is defined in terms of one or more\napplications whose data will be transferred, and can include\n[application-specific parameters](/workspace/admin/data-transfer/v1/parameters).\n\nThe following is a high-level summary of the transfer process:\n\n1. Determine the applications for which you want to transfer data.\n2. Define a [`DataTransfer` resource](/workspace/admin/data-transfer/reference/rest/v1/transfers) that specifies the source and destination users and the applications for which to transfer data.\n3. Initiate the transfer by using the [`insert()` method](/workspace/admin/data-transfer/reference/rest/v1/transfers/insert).\n\nFor example, the following JSON request body transfers a calendar from\nthe source user (\u003cvar translate=\"no\"\u003eSOURCE_USER_ID\u003c/var\u003e) to the destination user\n(\u003cvar translate=\"no\"\u003eDESTINATION_USER_ID\u003c/var\u003e). You can retrieve the user IDs for\neach owner by calling the\n[`user.get()` method](/workspace/admin/directory/reference/rest/v1/users/get)\nof the Directory API and providing their email address or email alias. \n\n {\n \"oldOwnerUserId\": \"\u003cvar translate=\"no\"\u003eSOURCE_USER_ID\u003c/var\u003e\",\n \"newOwnerUserId\": \"\u003cvar translate=\"no\"\u003eDESTINATION_USER_ID\u003c/var\u003e\",\n \"applicationDataTransfers\": [\n {\n \"applicationId\": \"435070579839\",\n \"applicationTransferParams\": [\n {\n \"key\": \"RELEASE_RESOURCES\",\n \"value\": [\n \"TRUE\"\n ]\n }\n ]\n }\n ]\n }\n\nRelated topics\n--------------\n\nThe Data Transfer API includes additional methods and resources to\nhelp you construct and administer transfers, allowing you to do things like\nthe following:\n\n- [List](/workspace/admin/data-transfer/v1/reference/applications/list) applications available for data transfer.\n- [Get](/workspace/admin/data-transfer/v1/reference/applications/get) application information by application ID.\n- [List](/workspace/admin/data-transfer/v1/reference/transfers/list) transfers by source user, destination user, or status.\n- [Get](/workspace/admin/data-transfer/v1/reference/transfers/get) a transfer request by resource ID."]]