내보내기 관리

Vault API를 사용하여 Vault 내보내기를 관리할 수 있습니다. 다음과 같은 작업을 할 수 있습니다.

  • 내보내기 만들기 - 내보내기에 필요한 메일 또는 파일을 찾는 요청을 Vault에 전송 쿼리를 일치시키고 Google Cloud로 내보냅니다

    참고: 조직 전체에서 진행 중인 내보내기는 20개까지만 가능합니다. 성능을 개선하려면 대용량 내보내기를 더 작은 세트로 나누세요. 예를 들어 모든 데이터를 한 번에 내보내는 대신 월별로 내보내기를 분할할 수 있습니다. 또 다른 예는 각 내보내기에 더 적은 수의 항목 (예: 사용자 및 그룹, 채팅 공간 등의 특수 항목)을 포함하는 것입니다.

    예:

  • 내보내기 목록 - 연결된 모든 내보내기의 상태를 가져옵니다. 할 수 있습니다.

  • 내보내기 가져오기: 내보내기에 대한 정보를 가져옵니다.

  • 내보내기 다운로드: Google Cloud에서 내보내기를 다운로드합니다.

  • 내보내기 삭제: 법적 사안에서 내보내기를 삭제하면 더 이상 필요하지 않습니다

시작하기 전에

필요한 라이브러리와 인증을 설정하려면 빠른 시작을 따르세요. 프로그래밍 언어에 구애받지 않는 것입니다

Vault 리소스를 사용하려면 계정에 필요한 Vault가 있어야 합니다. 권한과 중요합니다 법적 사안에 액세스하려면 계정에서 법적 사안을 만든 상태여야 합니다. 법적 사안이 공유되었거나 모든 법적 사안 보기 권한이 있어야 합니다.

Gmail 내보내기 만들기

다음 예시에서는 Gmail 내보내기를 만드는 방법을 보여줍니다. 이 요청은 다음 기준을 충족하는 모든 Gmail 및 기존 행아웃 메시지:

  • email1email2 계정에서 소유한 메일
  • 임시보관 메일이 제외됩니다.
  • 메시지가 [email protected](으)로 전송되었습니다.

도움말: 다음 예에서는 기존 Gmail 내보내기 시스템을 사용합니다. 다음을 사용하여 내보내려면 새 내보내기 시스템 MailExportOptions에서 useNewExport를 true로 설정합니다.

자바

public Export createMailAccountHeldDataExports(Vault client, String matterId) {
  AccountInfo emailsToSearch = new AccountInfo().setEmails(ImmutableList.of("email1", "email2"));
  MailOptions mailQueryOptions = new MailOptions().setExportFormat("PST");
  String queryTerms = "to:[email protected]";
  Query mailQuery =
      new Query()
          .setCorpus("MAIL")
          .setDataScope("HELD_DATA")
          .setSearchMethod("ACCOUNT")
          .setAccountInfo(emailsToSearch)
          .setTerms(queryTerms)
          .setMailOptions(mailQueryOptions);
  MailExportOptions mailExportOptions =
      new MailExportOptions()
          .setExportFormat("MBOX")
          .showConfidentialModeContent(true);
  Export wantedExport =
      new Export()
          .setMatterId(matterId)
          .setName("My first mail accounts export")
          .setQuery(mailQuery)
          .setExportOptions(new ExportOptions().setMailOptions(mailExportOptions));
  return client.matters().exports().create(matter, wantedExport).execute();
}

Python

def create_mail_account_held_data_export(service, matter_id):
  emails_to_search = ['email1', 'email2']
  mail_query_options = {'excludeDrafts': True}
  query_terms = 'to:[email protected]'
  mail_query = {
      'corpus': 'MAIL',
      'dataScope': 'HELD_DATA',
      'searchMethod': 'ACCOUNT',
      'accountInfo': {
          'emails': emails_to_search
      },
      'terms': query_terms,
      'mailOptions': mail_query_options,
  }
  mail_export_options = {
      'exportFormat': 'MBOX',
      'showConfidentialModeContent': True
      }
  wanted_export = {
      'name': 'My first mail accounts export',
      'query': mail_query,
      'exportOptions': {
          'mailOptions': mail_export_options
  }
}
return service.matters().exports().create(
  matterId=matter_id, body=wanted_export).execute()

Drive 내보내기 만들기

다음 예에서는 Drive 내보내기를 만드는 방법을 보여줍니다. 이 요청은 공유 드라이브의 파일을 포함하여 다음 기준을 충족하는 모든 파일:

  • Admin SDK로 획득한 지정된 조직 단위에 속해야 합니다.
  • 지정된 기간 동안 곱합니다.

자바

public Export createDriveOuAllDataExport(Vault client, String matterId) {
  OrgUnitInfo ouToSearch = new OrgUnitInfo().setOrgUnitId("ou id retrieved from admin sdk");
  DriveOptions driveQueryOptions = new DriveOptions().setIncludeSharedDrives(true);
  Query driveQuery =
      new Query()
          .setCorpus("DRIVE")
          .setDataScope("ALL_DATA")
          .setSearchMethod("ORG_UNIT")
          .setOrgUnitInfo(ouToSearch)
          .setDriveOptions(driveQueryOptions)
          .setStartTime("2017-03-16T00:00:00Z")
          .setEndTime("2017-03-16T00:00:00Z")
          .setTimeZone("Etc/GMT 2");
  DriveExportOptions driveExportOptions = new DriveExportOptions().setIncludeAccessInfo(false);
  Export wantedExport =
      new Export()
          .setName("My first drive ou export")
          .setQuery(driveQuery)
          .setExportOptions(new ExportOptions().setDriveOptions(driveExportOptions));
  return client.matters().exports().create(matter, wantedExport).execute();
}

Python

def create_drive_ou_all_data_export(service, matter_id):
  ou_to_search = 'ou id retrieved from admin sdk'
  drive_query_options = {'includeSharedDrives': True}
  drive_query = {
    'corpus': 'DRIVE',
    'dataScope': 'ALL_DATA',
    'searchMethod': 'ORG_UNIT',
    'orgUnitInfo': {
        'org_unit_id': ou_to_search
    },
    'driveOptions': drive_query_options,
    'startTime': '2017-03-16T00:00:00Z',
    'endTime': '2017-09-23T00:00:00Z',
    'timeZone': 'Etc/GMT 2'
  }
  drive_export_options = {'includeAccessInfo': False}
  wanted_export = {
    'name': 'My first drive ou export',
    'query': drive_query,
    'exportOptions': {
        'driveOptions': drive_export_options
    }
  }
return service.matters().exports().create(
  matterId=matter_id, body=wanted_export).execute()

Meet 내보내기 만들기

다음 예시에서는 Meet 내보내기를 만드는 방법을 보여줍니다. 이 요청은 특정 조직 단위의 파일 이름을 지정합니다.

Python

def create_meet_export(service, matter_id, ou_to_search, export_name):
  export = {
    'name': export_name,
    'query': {
        'corpus': 'DRIVE',
        'dataScope': 'ALL_DATA',
        'searchMethod': 'ORG_UNIT',
        'terms': 'title:"...-...-... \\(....-..-.. at ..:.. *\\)"',
        'orgUnitInfo': {
            'orgUnitId': 'id:' ou_to_search
        },
        'driveOptions': {
            'includeTeamDrives': True,
            'includeSharedDrives': True
        },
        'timeZone': 'Etc/GMT',
        'method': 'ORG_UNIT'
    },
    'exportOptions': {
        'driveOptions': {},
        'region': 'ANY'
    },
  }

  return service.matters().exports().create(
    matterId=matter_id, body=export).execute()

저장된 쿼리에서 내보내기

다음 예시에서는 저장된 쿼리에서 내보내기를 만드는 방법을 보여줍니다.

Python

def create_mail_export_from_saved_query(service, matter_id, saved_query_id, export_name):
  export = {
    'name': export_name,
    'exportOptions': {
      'mailOptions': {
        'exportFormat': 'PST',
        'showConfidentialModeContent': True
      },
    'region': 'ANY'
    }
  }

  export['query'] = service.matters().savedQueries().get(
    savedQueryId=saved_query_id, matterId=matter_id).execute()['query']
  return service.matters().exports().create(
    matterId=matter_id, body=export).execute()

내보내기 나열

다음 예시에서는 법적 사안과 관련된 내보내기 목록을 검색하는 방법을 보여줍니다.

자바

public class exports {
  public ListExportsResponse listExports(Vault client, String matterId) {
    return client.matters().exports().list(matterId).execute();
}

Python

def list_exports(service, matter_id):
 return service.matters().exports().list(matterId=matter_id).execute()

내보내기 정보 가져오기

다음 예시에서는 특정 내보내기에 대한 정보를 가져오는 방법을 보여줍니다. 참고: 내보낸 파일과 메시지를 다운로드하려면 Cloud API (다음 예)

자바

public Export getExportById(Vault client, String matterId, String exportId) {
  return client.matters().exports().get(matterId, exportId).execute();
}

Python

def get_export_by_id(service, matter_id, export_id):
  return service.matters().exports().get(
    matterId=matter_id, exportId=export_id).execute()

Google Cloud에서 내보내기 다운로드

다음 예시는 법적 사안에서 완료된 모든 내보내기를 다운로드하는 방법을 보여줍니다. Google Cloud에서 사용할 수 있습니다 이 요청은 Vault 및 Cloud API를 사용합니다.

참고: 내보내기를 다운로드하려면 계정에 내보내기 권한 관리 및 정보를 공유할 수 있습니다.

Python

def download_exports(service, matter_id):
"""Google Cloud storage service is authenticated by running
`gcloud auth application-default login` and expects a billing enabled project
in ENV variable `GOOGLE_CLOUD_PROJECT` """
gcpClient = storage.Client()
matter_id = os.environ['MATTERID']
  for export in vaultService.matters().exports().list(
      matterId=matter_id).execute()['exports']:
    if 'cloudStorageSink' in export:
      directory = export['name']
      if not os.path.exists(directory):
        os.makedirs(directory)
      print(export['id'])
      for sinkFile in export['cloudStorageSink']['files']:
        filename = '%s/%s' % (directory, sinkFile['objectName'].split('/')[-1])
        objectURI = 'gs://%s/%s' % (sinkFile['bucketName'],
                                    sinkFile['objectName'])
        print('get %s to %s' % (objectURI, filename))
        gcpClient.download_blob_to_file(objectURI, open(filename, 'wb '))

내보내기 삭제하기

다음 예시에서는 내보내기를 삭제하는 방법을 보여줍니다.

자바

public void deleteExportById(Vault client, String matterId, String exportId) {
   client.matters().exports().delete(matterId, exportId).execute();

Python

def delete_export_by_id(service, matter_id, export_id):
  return service.matters().exports().delete(
    matterId=matter_id, exportId=export_id).execute()

검색 한도를 포함하여 검색 및 내보내기에 관한 앱별 정보는 Vault 검색 및 내보내기 시작하기를 참고하세요.