Quản lý lưu giữ

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, các yêu cầu lưu giữ dữ liệu đượ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 hoạt động nữa.

Nếu một người dùng bị yêu cầu lưu giữ dữ liệu sẽ 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 dữ liệu vẫn được lưu giữ trong Vault. Miễn là có yêu cầu lưu giữ dữ liệu, quản trị viên Vault có thể tìm kiếm và xuất dữ liệu đó.

Yêu cầu lưu giữ dữ liệu có các thành phần sau:

  • Dịch vụ – ứng dụng chịu trách nhiệm về dữ liệu cần lưu giữ. Bạn có thể đặt dịch vụ thành thư, Drive hoặc Groups.
  • Phạm vi: các thực thể thuộc phạm vi yêu cầu lưu giữ dữ liệu. 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).
  • Tuỳ chọn bổ sung (không bắt buộc): cá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) dùng để thu hẹp dữ liệu được 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 yêu cầu lưu giữ
    • Drive: bao gồm bộ nhớ dùng chung trong yêu cầu lưu giữ dữ liệu

Để 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 nội dung. Để truy cập vào một vấn đề, tài khoản phải đã tạo vấn đề, chia sẻ vấn đề với họ hoặc có đặc quyền Xem tất cả các vấn đề.

Tạo yêu cầu lưu giữ dữ liệu đối với thư trên một số 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 cho biết cách hệ thống tạo yêu cầu lưu giữ dữ liệu có tên "Tạm ngưng tài khoản thư đầu tiên của tôi" đối với:

  • Dịch vụ: thư
  • 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ừ AdminSdk. Xin lưu ý rằng Tài khoản bị giữ lại có thể bao gồm mã tài khoản hoặc email. Nếu bạn cung cấp cả hai, thì email sẽ được sử dụng và mã 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 yêu cầu lưu giữ dữ liệu cho Drive trong đơn vị tổ chức và bao gồm nội dung của bộ nhớ dùng chung

Ví dụ sau đây trình bày cách tạo yêu cầu lưu giữ dữ liệu có tên "Yêu cầu lưu giữ dữ liệu trong OU Drive đầu tiên của tôi" 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)
  • Tuỳ chọn bổ sung: bao gồm những 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ừ AdminSdk.

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 yêu cầu lưu giữ dữ liệu cho Groups trên các tài khoản nhóm cụ thể trong phạm vi ngày

Ví dụ sau đây cho biết cách tạo yêu cầu lưu giữ dữ liệu có tên là "Yêu cầu lưu giữ dữ liệu lần đầu tiên của tôi trong nhóm" cho:

  • Dịch vụ: Groups
  • Thực thể: các tài khoản nhóm "group1" và "group2"
  • Tuỳ chọn bổ sung: chỉ giữ lại những tin nhắn có ngày gửi nằm trong khoảng từ "startTime" đến "endTime"

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

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, thời gian bắt đầu/thời gian kết thúc được chuyển đổi sang giờ GMT và làm tròn xuống ngày bắt đầu của ngày đã cho.

Truy vấn và sửa đổi yêu cầu lưu giữ dữ liệu hiện có

Ví dụ sau đây cho biết cách liệt kê tất cả tài khoản có trong yêu cầu lưu giữ dữ liệu hiện tại:

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 cho biết cách thêm và xoá một tài khoản khỏi trạng thái tạm ngưng hiện tại cho tài khoản:

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 trình bày cách sửa đổi đơn vị tổ chức đang áp dụng yêu cầu lưu giữ dữ liệu của đơn vị tổ chứ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 cho biết cách liệt kê tất cả yêu cầu lưu giữ dữ liệu cho 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()