Quản lý lưu giữ

Yêu cầu lưu giữ dữ liệu sẽ lưu giữ dữ liệu vô thời hạn để đáp ứng các nghĩa vụ pháp lý hoặc nghĩa vụ lưu giữ. Thông thường, lệnh giữ được áp dụng cho một hoặc nhiều người dùng để đảm bảo rằng dữ liệu có thể liên quan đến một vấn đề sẽ không bị xoá cho đến khi vấn đề đó không còn tồn tại.

Nếu người dùng thuộc diện lưu giữ xoá dữ liệu được lưu giữ, thì dữ liệu đó sẽ bị xoá khỏi chế độ xem của người dùng nhưng vẫn được lưu giữ trong Vault. Miễn là lệnh tạm giữ còn hiệu lực, quản trị viên Vault có thể tìm kiếm và xuất dữ liệu đó.

Lệnh giữ có các thành phần sau:

  • Một dịch vụ – ứng dụng chịu trách nhiệm lưu giữ dữ liệu. Bạn có thể đặt dịch vụ thành Thư, Drive hoặc Groups.
  • Phạm vi –các pháp nhân thuộc diện yêu cầu lưu giữ. Bạn có thể đặt phạm vi cho một hoặc nhiều tài khoản người dùng hoặc cho một đơn vị tổ chức (OU).
  • Các lựa chọn khác (không bắt buộc) – thông tin chi tiết cụ thể (cụm từ tìm kiếm hoặc lựa chọn cấu hình) được dùng để thu hẹp dữ liệu cần lưu giữ trong phạm vi đã xác định. Các lựa chọn bao gồm:
    • thư, Nhóm: cụm từ tìm kiếm để thu hẹp phạm vi giữ lại
    • Drive: đưa bộ nhớ dùng chung vào lệnh giữ lại

Để sử dụng các tài nguyên của Vault, tài khoản phải có các đặc quyền bắt buộc đối với Vault và quyền truy cập vào vấn đề. Để truy cập vào một vấn đề, tài khoản phải là tài khoản đã tạo vấn đề đó, được chia sẻ vấn đề đó hoặc có đặc quyền Xem tất cả vấn đề.

Tạo yêu cầu lưu giữ dữ liệu đối với thư trong tài khoản người dùng cụ thể bằng một cụm từ tìm kiếm

Ví dụ sau đây minh hoạ cách tạo lệnh giữ tên là "Lệnh giữ đầu tiên của tôi đối với tài khoản thư" cho:

  • Dịch vụ: mail
  • Thực thể: tài khoản người dùng "user1" và "user2"
  • Các lựa chọn khác: cụm từ tìm kiếm "to:ceo@company.com"

Truy xuất mã tài khoản người dùng từ Directory API. Xin lưu ý rằng HeldAccount có thể lấy mã tài khoản hoặc email. Nếu bạn cung cấp cả hai, thì email sẽ được dùng và mã nhận dạng tài khoản sẽ bị bỏ qua.

Java

HeldMailQuery mailQuery = new HeldMailQuery().setTerms("to:ceo@company.com");
List accounts = Lists.newArrayList();
accounts.add(new HeldAccount().setAccountId(user1accountId));
accounts.add(new HeldAccount().setEmail(user2Email));
Hold hold = new Hold()
    .setName("My First mail Accounts Hold")
    .setCorpus("MAIL");
    .setQuery(new CorpusQuery().setMailQuery(mailQuery))
    .setAccounts(accounts);
Hold createdHold = client.matters().holds().create(matterId, hold).execute();
  

Python

def create_hold_mail_accounts(service, matter_id, account_id):
    mail_query = {'terms': 'to:ceo@company.com'}
    accounts = [
        {'accountId': user1_account_id},
        {'email': user2_email}
    ]
    wanted_hold = {
        'name': 'My First mail Accounts Hold',
        'corpus': 'MAIL',
        'query': {
            'mailQuery': mail_query
        },
        'accounts': accounts
    }
    return service.matters().holds().create(
        matterId=matter_id, body=wanted_hold).execute()

Tạo lệnh giữ lại cho Drive trên một đơn vị tổ chức và thêm nội dung trong bộ nhớ dùng chung

Ví dụ sau đây minh hoạ cách tạo lệnh giữ tên là "Lệnh giữ đầu tiên của tôi trên đơn vị tổ chức Drive" cho:

  • Dịch vụ: Drive
  • Thực thể: đơn vị tổ chức "Tài chính" (mã đơn vị tổ chức được ghi lại trong orgUnitId)
  • Các lựa chọn khác: bao gồm bộ nhớ dùng chung mà người dùng trong đơn vị tổ chức này là thành viên

Truy xuất mã đơn vị tổ chức từ Directory API.

Java

HeldOrgUnit orgUnit = new HeldOrgUnit().setOrgUnitId(orgUnitId);
// Include shared drives content.
HeldDriveQuery driveQuery = new HeldDriveQuery().setIncludeSharedDriveFiles(true);
// Create the hold.
Hold hold = new Hold()
    .setName("My First Drive OU Hold")
    .setCorpus("DRIVE")
    .setQuery(new CorpusQuery().setDriveQuery(driveQuery))
    .setOrgUnit(orgUnit);
Hold createdHold = client.matters().holds().create(matterId, hold).execute();
return createdHold;

Python

def create_hold_drive_org(service, matter_id, org_unit_id):
    drive_query = {'includeSharedDriveFiles': True}
    org_unit = {'orgUnitId': org_unit_id}
    wanted_hold = {
        'name': 'My First Drive OU Hold',
        'corpus': 'DRIVE',
        'orgUnit': org_unit,
        'query': {
            'driveQuery': drive_query
        }
    }
    return service.matters().holds().create(
        matterId=matter_id, body=wanted_hold).execute()

Tạo lệnh giữ lại cho Nhóm trên các tài khoản nhóm cụ thể trong một phạm vi ngày

Ví dụ sau đây cho thấy cách tạo một lệnh giữ chỗ có tên là "My First Group Hold" (Lệnh giữ chỗ nhóm đầu tiên của tôi) cho:

  • Dịch vụ: Groups
  • Thực thể: tài khoản nhóm "group1" và "group2"
  • Các lựa chọn khác: chỉ giữ lại những thư có ngày gửi nằm trong khoảng thời gian từ "startTime" đến "endTime"

Truy xuất mã tài khoản nhóm từ Directory API.

Java

String APRIL_2_2017_GMT = "2017-04-02T00:00:00Z"; // See below for format*.
 
List accounts = Lists.newArrayList();
accounts.add(new HeldAccount().setAccountId(accountId));
accounts.add(new HeldAccount().setAccountId(accountId2));
HeldGroupsQuery groupQuery = new HeldGroupsQuery();
// Restrict by sent date.
groupQuery.setStartTime(APRIL_2_2017_GMT);
groupQuery.setEndTime(APRIL_2_2017_GMT);
// create the hold
Hold hold = new Hold()
    .setName("My First Group Hold")
    .setCorpus("GROUPS")
    .setQuery(new CorpusQuery().setGroupsQuery(groupQuery));
    hold.setAccounts(accounts);
Hold createdHold = client.matters().holds().create(matterId, hold).execute();
 

Python

def create_hold_groups_date_range(service, matter_id, group_account_id):
    groups_query = {
        'startTime': '2017-04-02T00:00:00Z', # See below for format*
        'endTime': '2017-04-02T00:00:00Z'
    }
    accounts = [{'accountId': group_account_id}]
    wanted_hold = {
        'name': 'My First Group Hold',
        'corpus': 'GROUPS',
        'query': {
            'groupsQuery': groups_query
        },
        'accounts': accounts
    }
    return service.matters().holds().create(
        matterId=matter_id, body=wanted_hold).execute()
 
  • Định dạng dấu thời gian. Ngoài ra, start/endTimes được chuyển đổi thành GMT và làm tròn xuống thành ngày bắt đầu của ngày đã cho.

Truy vấn và sửa đổi lệnh giữ hiện có

Ví dụ sau đây cho thấy cách liệt kê tất cả tài khoản có trong lệnh giữ hiện có:

Java

client.matters().holds().accounts().list(matterId, holdId).execute().getAccounts();

Python

# If no accounts are on hold, ['accounts'] will raise an error.
def list_held_accounts(service, matter_id, hold_id):
    return service.matters().holds().accounts().list(
        matterId=matter_id, holdId=hold_id).execute()['accounts'] 

Ví dụ sau đây minh hoạ cách thêm tài khoản vào và xoá tài khoản khỏi lệnh tạm ngưng hiện có:

Java

// Add an account by id.
client
        .matters()
        .holds()
        .accounts()
        .create(matterId, holdId, new HeldAccount().setAccountId(accountId))
        .execute();
// Remove an account by id.
client.matters().holds().accounts().delete(matterId, holdId, accountId).execute();

String email = "email@email.com";
// Add an account by email.
client
        .matters()
        .holds()
        .accounts()
        .create(matterId, holdId, new HeldAccount().setEmail(email))
        .execute();

Python

 
def add_held_account(service, matter_id, hold_id, account_id):
    held_account = {'accountId': account_id}
    return service.matters().holds().accounts().create(
        matterId=matter_id, holdId=hold_id, body=held_account).execute()

def remove_held_account(service, matter_id, hold_id, account_id):
    return service.matters().holds().accounts().delete(
        matterId=matter_id, holdId=hold_id, accountId=account_id).execute()

def add_held_account(service, matter_id, hold_id, email):
    held_account = {'email': email}
    return service.matters().holds().accounts().create(
        matterId=matter_id, holdId=hold_id, body=held_account).execute()
 

Ví dụ sau đây cho thấy cách sửa đổi OU trong lệnh giữ OU hiện có:

Java

Hold hold = client.matters().holds().get(matterId, holdId).execute();
hold.getOrgUnit().setOrgUnitId(newOrgUnitId);
Hold modifiedHold = client.matters().holds().update(matterId, holdId, hold).execute();
return modifiedHold;
 

Python

def update_hold_ou(service, matter_id, hold_id, org_unit_id):
    current_hold = get_hold(matter_id, hold_id)
    current_hold['orgUnit'] = {'orgUnitId': org_unit_id}
    return service.matters().holds().update(
        matterId=matter_id, holdId=hold_id, body=current_hold).execute() 

Ví dụ sau đây minh hoạ cách liệt kê tất cả lệnh giữ lại đối với một vấn đề:

Java

 
String matterId = "Matter Id";

// List all holds. List holdsList = client.matters().holds().list(matterId).execute().getHolds();

// Paginate on holds. ListHoldsResponse response = client .matters() .holds() .list(matterId) .setPageSize(10) .execute();

String nextPageToken = response.getNextPageToken(); if (nextPageToken != null) { client .matters() .holds() .list(matterId) .setPageSize(10) .setPageToken(nextPageToken) .execute(); }

Python

# This can paginate in the same manner as with matters.
def list_holds(service, matter_id):
    return service.matters().holds().list(matterId=matter_id).execute()