Hướng dẫn này chứa các công việc liên quan đến việc quản lý bộ nhớ dùng chung, chẳng hạn như tạo bộ nhớ dùng chung, cách quản lý thành viên và quyền truy cập.
Để biết thêm thông tin về giới hạn đối với thư mục trong bộ nhớ dùng chung, hãy xem phần Thư mục .
Tạo bộ nhớ dùng chung
Để tạo một bộ nhớ dùng chung, hãy sử dụng phương thức drives.create
.
Java
Python
Node.js
PHP
.NET
Các lệnh gọi đến phương thức drives.create
không thay đổi giá trị.
Tham số requestId
xác định nỗ lực logic để tạo tệp chia sẻ
Drive. Nếu yêu cầu hết thời gian chờ hoặc trả về một lỗi phụ trợ không xác định,
có thể lặp lại cùng một yêu cầu. requestId
và nội dung của yêu cầu phải
vẫn giữ nguyên.
Nếu bộ nhớ dùng chung được tạo thành công theo yêu cầu trước đó hoặc do
thử lại thì phản hồi bình thường sẽ được trả về. Đôi khi, chẳng hạn như sau một thời gian dài
thời gian hoặc nếu nội dung của yêu cầu đã thay đổi, thì có thể có lỗi 409
được trả về cho biết phải loại bỏ requestId
.
Thêm hoặc xoá thành viên của bộ nhớ dùng chung
Thêm hoặc xoá thành viên của bộ nhớ dùng chung bằng
Tài nguyên permissions
.
Để thêm một thành viên, hãy tạo quyền trên bộ nhớ dùng chung. Quyền các phương thức cũng có thể được sử dụng trên các tệp riêng lẻ trong bộ nhớ dùng chung để cấp đặc quyền bổ sung cho thành viên hoặc cho phép những người không phải là thành viên cộng tác mục cụ thể.
Để biết thêm thông tin và mã mẫu, hãy xem phần Chia sẻ tệp, thư mục và Drive.
Xoá bộ nhớ dùng chung
Sử dụng phương thức drives.delete
để xoá
bộ nhớ dùng chung. Tất cả nội dung trong bộ nhớ dùng chung phải được chuyển vào thùng rác hoặc xoá
trước khi xoá bộ nhớ dùng chung.
Quản lý bộ nhớ dùng chung dành cho quản trị viên miền
Áp dụng thông số useDomainAdminAccess
với các tài nguyên drives
và permissions
để quản lý bộ nhớ dùng chung trên một
tổ chức.
Người dùng gọi các phương thức này bằng useDomainAdminAccess=true
phải có
Quản trị viên Drive and Docs
đặc quyền.
Quản trị viên có thể tìm kiếm tệp được chia sẻ
Drive hoặc cập nhật quyền cho các tài khoản được chia sẻ
các ổ đĩa thuộc sở hữu của tổ chức của họ, bất kể tư cách thành viên của quản trị viên
trong bộ nhớ dùng chung bất kỳ.
Khôi phục bộ nhớ dùng chung không có người tổ chức
Ví dụ sau đây minh hoạ cách sử dụng những tài nguyên này để khôi phục những tài nguyên được chia sẻ những ổ không còn trình tổ chức.
Java
Python
Node.js
PHP
.NET
Giới hạn thư mục
Thư mục trên bộ nhớ dùng chung có một số hạn mức bộ nhớ. Để biết thông tin, hãy xem phần Được chia sẻ hạn mức lái xe trong Google Drive.
Giới hạn mục
Mỗi thư mục trong bộ nhớ dùng chung của người dùng chỉ được có tối đa 500.000 mục, bao gồm tệp, thư mục và lối tắt.
Khi đạt đến giới hạn, bộ nhớ dùng chung không thể chấp nhận các mục nữa. Người nhận nhận lại tệp, người dùng phải xoá vĩnh viễn các mục khỏi thư mục. Ghi chú các mục trong thùng rác được tính vào giới hạn nhưng các mục đã bị xoá vĩnh viễn thì không. Để biết thêm thông tin, hãy xem phần Thùng rác hoặc xoá tệp và các thư mục.
Giới hạn về chiều sâu của thư mục
Một thư mục trong bộ nhớ dùng chung không được chứa hơn 100 cấp của các thư mục lồng nhau. Điều này có nghĩa là bạn không thể lưu trữ thư mục con trong một thư mục có dung lượng lớn hơn Sâu 99 cấp. Giới hạn này chỉ áp dụng cho các thư mục con.
Cố gắng thêm hơn 100 cấp độ thư mục sẽ trả về một
teamDriveHierarchyTooDeep
Phản hồi của mã trạng thái HTTP.