Method: drives.insert
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 请求
POST https://www.googleapis.com/drive/v2/drives
网址采用 gRPC 转码语法。
查询参数
参数 |
requestId |
string
必需。一个 ID(例如随机 UUID),用于唯一标识此用户对幂等共享云端硬盘创建请求。如果同一用户发出重复请求且请求 ID 相同,系统会避免尝试创建相同的共享云端硬盘,从而避免创建重复内容。如果共享云端硬盘已存在,系统会返回 409 错误。
|
响应正文
如果成功,响应正文将包含一个新创建的 Drive
实例。
授权范围
需要以下 OAuth 范围:
https://www.googleapis.com/auth/drive
某些镜重受限,您的应用需要接受安全评估才能使用它们。如需了解详情,请参阅授权指南。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[],[],null,["# Method: drives.insert\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates a new shared drive.\n\n### HTTP request\n\n`POST https://www.googleapis.com/drive/v2/drives`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `requestId` | `string` Required. An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a shared drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same shared drive. If the shared drive already exists a 409 error will be returned. |\n\n### Request body\n\nThe request body contains an instance of [Drive](/workspace/drive/api/reference/rest/v2/drives#Drive).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Drive](/workspace/drive/api/reference/rest/v2/drives#Drive).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/drive`\n\nSome scopes are restricted and require a security assessment for your app to use them. For more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]