驱动器资源类型drive resource type

重要

Microsoft Graph 中/beta的版本下的 api 可能会发生更改。APIs under the /beta version in Microsoft Graph are subject to change. 不支持在生产应用程序中使用这些 API。Use of these APIs in production applications is not supported.

驱动器资源是表示用户的 OneDrive 或 SharePoint 中文档库的顶级对象。The drive resource is the top level object representing a user's OneDrive or a document library in SharePoint.

OneDrive 用户必须始终具有至少一个可用驱动器,即默认驱动器。没有 OneDrive 许可证的用户不能拥有可用的默认驱动器。OneDrive users will always have at least one drive available, their default drive. Users without a OneDrive license may not have a default drive available.

方法Methods

方法Method 返回类型Return type 说明Description
获取驱动器Get drive 驱动器drive 获取有关驱动器的元数据Get metadata about a user's default drive on OneDrive.
获取驱动器根Get drive root driveItemdriveItem 获取驱动器的根文件夹Get root folder for a drive
列出活动List activities itemActivity 集合itemActivity collection 列出在驱动器下发生的活动List activities that occurred under the drive
列出关注的项List followed Items driveItem 集合driveItem collection 列出用户的关注 driveItemsList the user's followed driveItems
列出子项List children driveItem 集合driveItem collection 列出驱动器根文件夹的子项List children of the root folder of a drive
列出变更List changes driveItem 集合driveItem collection 列出驱动器中所有 DriveItem 的变更List changes for all Items in the Drive
搜索Search driveItem 集合driveItem collection 搜索驱动器中的 DriveItemSearch for driveItems in a drive
获取特殊文件夹Get special folder driveItemdriveItem 通过特殊文件夹的规范名称访问它Access a special (named) folder in the user's OneDrive by its known name.

属性Properties

属性Property 类型Type 说明Description
createdBycreatedBy identitySetidentitySet 识别创建项目的用户、设备或应用程序。只读。Identity of the user, device, or application which created the item. Read-only.
createdDateTimecreatedDateTime dateTimeOffsetdateTimeOffset 创建项的日期和时间。只读。Date and time of item creation. Read-only.
descriptiondescription StringString 提供驱动器的用户可见说明。Provide a user-visible description of the drive. 读写。Read-write.
driveTypedriveType StringString 说明了由该资源表示的驱动器的类型。OneDrive 个人版驱动器将返回 personal。OneDrive for Business 将返回 business。SharePoint 文档库将返回 documentLibrary。只读。Describes the type of drive represented by this resource. OneDrive personal drives will return personal. OneDrive for Business will return business. SharePoint document libraries will return documentLibrary. Read-only.
idid StringString 驱动器唯一标识符。只读。The unique identifier of the drive. Read-only.
lastModifiedBylastModifiedBy identitySetidentitySet 上次修改项目的用户、设备和应用程序的标识。只读。Identity of the user, device, and application which last modified the item. Read-only.
lastModifiedDateTimelastModifiedDateTime dateTimeOffsetdateTimeOffset 上次修改项目的日期和时间。只读。Date and time the item was last modified. Read-only.
namename stringstring 项目名称。读写。The name of the item. Read-write.
所有者owner identitySetidentitySet 可选。拥有此驱动器的用户帐户。只读。Optional. The user account that owns the drive. Read-only.
配额quota 配额quota 可选。有关驱动器的存储空间配额的信息。只读。Optional. Information about the drive's storage space quota. Read-only.
sharepointIdssharepointIds sharepointIdssharepointIds 返回对 SharePoint REST 兼容性有用的标识符。只读。Returns identifiers useful for SharePoint REST compatibility. Read-only.
systemsystem systemFacetsystemFacet 如果存在,则表示这是系统管理的驱动器。If present, indicates that this is a system-managed drive. 只读。Read-only.
WebUrlwebUrl string (url)string (url) 在浏览器中显示此资源的 URL。只读。URL that displays the resource in the browser. Read-only.

关系Relationships

关系Relationship 类型Type 说明Description
activitiesactivities itemActivity 集合itemActivity collection 最近发生在此驱动器下的活动的列表。The list of recent activities that took place under this drive.
捆绑Multiple bundles driveItem 集合driveItem collection 捆绑 (相册和多选共享项目集) 的集合。Collection of bundles (albums and multi-select-shared sets of items). 只在个人的 OneDrive 中。Only in personal OneDrive.
followingfollowing driveItem 集合driveItem collection 用户关注的项列表。The list of items the user is following. 仅适用于 OneDrive for Business 中。Only in OneDrive for Business.
itemsitems driveItem 集合driveItem collection 驱动器中包含的所有项。只读。可为 NULL。All items contained in the drive. Read-only. Nullable.
rootroot driveItemdriveItem 驱动器的根文件夹。只读。The root folder of the drive. Read-only.
specialspecial driveItem 集合driveItem collection OneDrive 中可用的公用文件夹的集合。只读。可为 NULL。Collection of common folders available in OneDrive. Read-only. Nullable.

JSON 表示形式JSON representation

下面是 Drive 资源的 JSON 表示形式。Here is a JSON representation of a Drive resource.

drive 资源派生自 baseItem 并继承该资源的属性。The drive resource is derived from baseItem and inherits properties from that resource.

{
  "activities": [{"@odata.type": "microsoft.graph.itemActivity"}],
  "id": "string",
  "createdBy": {"@odata.type": "microsoft.graph.identitySet"},
  "createdDateTime": "string (timestamp)",
  "description": "string",
  "driveType": "personal | business | documentLibrary",
  "following": [{"@odata.type": "microsoft.graph.driveItem"}],
  "items": [{"@odata.type": "microsoft.graph.driveItem"}],
  "lastModifiedBy": {"@odata.type": "microsoft.graph.identitySet"},
  "lastModifiedDateTime": "string (timestamp)",
  "name": "string",
  "owner": {"@odata.type": "microsoft.graph.identitySet"},
  "quota": {"@odata.type": "microsoft.graph.quota"},
  "root": {"@odata.type": "microsoft.graph.driveItem"},
  "special": [{"@odata.type": "microsoft.graph.driveItem"}],
  "system": {"@odata.type": "microsoft.graph.systemFacet"},
  "webUrl": "string",
  "sharepointIds": {"@odata.type": "microsoft.graph.sharepointIds"}
}