이 가이드에서는 Enterprise Knowledge Graph를 처음 사용하는 데 필요한 모든 설정 단계를 제공합니다.
Google Cloud 콘솔 정보
Google Cloud console 은 Google Cloud 제품을 사용하는 시스템을 프로비저닝, 구성, 관리, 모니터링하는 데 사용되는 웹 UI입니다. Google Cloud 콘솔을 사용하여 Enterprise Knowledge Graph 리소스를 설정하고 관리합니다.
프로젝트 만들기
Google Cloud에서 제공하는 서비스를 사용하려면 프로젝트를 만들어야 합니다.
프로젝트는 모든 Google Cloud 리소스를 구성합니다. 프로젝트는 다음 구성요소로 구성됩니다.
- 공동작업자 그룹
- 사용 설정된 API (및 기타 리소스)
- 모니터링 도구
- 결제 정보
- 인증 및 액세스 제어
하나의 프로젝트를 만들거나 여러 프로젝트를 만들 수 있습니다. 프로젝트를 사용하여 리소스 계층 구조에서 Google Cloud 리소스를 구성할 수 있습니다. 프로젝트에 대한 자세한 내용은 Resource Manager 문서를 참고하세요.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
API 사용 설정
프로젝트에 Enterprise Knowledge Graph API를 사용 설정해야 합니다. API 사용 설정에 대한 자세한 내용은 서비스 사용 문서를 참조하세요.
Enable the Enterprise Knowledge Graph API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM
role (roles/serviceusage.serviceUsageAdmin), which
contains the serviceusage.services.enable permission. Learn how to grant
roles.
인증 설정
API를 사용하는 모든 클라이언트 애플리케이션은 인증되어야 하며 요청된 리소스에 대한 액세스 권한을 받아야 합니다. 이 섹션에서는 중요한 인증 개념을 설명하고 설정 단계를 안내합니다. 자세한 내용은 인증 개요를 참고하세요.
서비스 계정 정보
인증에는 여러 옵션이 있지만 인증 및 액세스 제어에는 서비스 계정을 사용하는 것이 좋습니다. 서비스 계정은 최종 사용자가 아닌 애플리케이션의 사용자 인증 정보를 제공합니다. 프로젝트에는 서비스 계정이 있습니다. 한 프로젝트에 여러 서비스 계정을 만들 수 있습니다. 자세한 내용은 서비스 계정을 참조하세요.
역할 정보
API를 호출할 때 Google Cloud 호출하는 ID(관련된 사람, 항목 또는 프로세스와 정의된 속성)에 적절한 권한이 있어야 합니다. 서비스 계정에 역할을 부여하여 권한을 부여할 수 있습니다. 자세한 내용은 Identity and Access Management(IAM) 문서를 참조하세요.
Enterprise Knowledge Graph API를 사용해 보려면 다음 단계에서 프로젝트 > 소유자 역할을 사용할 수 있습니다. 프로젝트 > 소유자 역할은 프로젝트의 리소스에 서비스 계정 전체 권한을 부여합니다. 서비스 계정에 전체 권한이 필요하지 않다면 Google Cloud 콘솔을 사용하여 더 제한적인 역할을 지정합니다. Enterprise Knowledge Graph의 권한 및 역할 목록은 Enterprise Knowledge Graph 권한 및 Enterprise Knowledge Graph 역할을 참고하세요. IAM 역할을 사용한 권한 관리에 대한 자세한 내용은 서비스 계정에 역할 부여를 참고하세요.
서비스 계정 키 정보
서비스 계정은 하나 이상의 공개 키 또는 비공개 키 쌍과 연결됩니다. 새 키 쌍을 만들 때 비공개 키를 다운로드합니다. Google Cloud CLI는 API를 호출할 때 비공개 키를 사용하여 사용자 인증 정보를 생성합니다.
서비스 계정을 만들고 비공개 키 파일을 다운로드합니다.
Create a service account:
-
Ensure that you have the Create Service Accounts IAM role
(
roles/iam.serviceAccountCreator) and the Project IAM Admin role (roles/resourcemanager.projectIamAdmin). Learn how to grant roles. -
In the Google Cloud console, go to the Create service account page.
Go to Create service account - Select your project.
-
In the Service account name field, enter a name. The Google Cloud console fills in the Service account ID field based on this name.
In the Service account description field, enter a description. For example,
Service account for quickstart. - Click Create and continue.
-
Grant the Project > Owner role to the service account.
To grant the role, find the Select a role list, then select Project > Owner.
- Click Continue.
-
Click Done to finish creating the service account.
Do not close your browser window. You will use it in the next step.
Create a service account key:
- In the Google Cloud console, click the email address for the service account that you created.
- Click Keys.
- Click Add key, and then click Create new key.
- Click Create. A JSON key file is downloaded to your computer.
- Click Close.
환경에서 서비스 계정 키 파일 사용
Provide authentication credentials to your application code by setting the
environment variable GOOGLE_APPLICATION_CREDENTIALS. This
variable applies only to your current shell session. If you want the variable
to apply to future shell sessions, set the variable in your shell startup file,
for example in the ~/.bashrc or ~/.profile file.
Linux 또는 macOS
export GOOGLE_APPLICATION_CREDENTIALS="KEY_PATH"Replace KEY_PATH with the path of the JSON file that contains your credentials.
For example:
export GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/service-account-file.json"
Windows
For PowerShell:
$env:GOOGLE_APPLICATION_CREDENTIALS="KEY_PATH"Replace KEY_PATH with the path of the JSON file that contains your credentials.
For example:
$env:GOOGLE_APPLICATION_CREDENTIALS="C:\Users\username\Downloads\service-account-file.json"
For command prompt:
set GOOGLE_APPLICATION_CREDENTIALS=KEY_PATHReplace KEY_PATH with the path of the JSON file that contains your credentials.