

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# Neptune 로더 예제
<a name="load-api-reference-load-examples"></a>

 이 예제에서는 Neptune 로더를 사용하여 Gremlin CSV 형식을 사용하여 Neptune 그래프 데이터베이스에 데이터를 로드하는 방법을 보여줍니다. 요청은 Neptune 로더 엔드포인트에 HTTP POST 요청으로 전송되며, 요청 본문에는 데이터 소스, 형식, IAM 역할 및 기타 구성 옵션을 지정하는 데 필요한 파라미터가 포함되어 있습니다. 응답에는 데이터 로드 프로세스의 진행 상황을 추적하는 데 사용할 수 있는 로드 ID가 포함됩니다.

**Example 요청**  
다음은 `curl` 명령을 사용하여 HTTP POST를 통해 전송된 요청입니다. Neptune CSV 형식의 파일을 로드합니다. 자세한 내용은 [Gremlin 로드 데이터 형식](bulk-load-tutorial-format-gremlin.md) 단원을 참조하십시오.  

```
aws neptunedata start-loader-job \
  --endpoint-url https://{{your-neptune-endpoint}}:{{port}} \
  --source "s3://{{bucket-name}}/{{object-key-name}}" \
  --format "csv" \
  --iam-role-arn "{{ARN for the IAM role you are using}}" \
  --s3-bucket-region "{{region}}" \
  --no-fail-on-error \
  --parallelism "MEDIUM" \
  --no-update-single-cardinality-properties \
  --no-queue-request
```
자세한 내용은 AWS CLI 명령 참조의 [start-loader-job](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/start-loader-job.html)을 참조하세요.

```
import boto3
from botocore.config import Config

client = boto3.client(
    'neptunedata',
    endpoint_url='https://{{your-neptune-endpoint}}:{{port}}',
    config=Config(read_timeout=None, retries={'total_max_attempts': 1})
)

response = client.start_loader_job(
    source='s3://{{bucket-name}}/{{object-key-name}}',
    format='csv',
    iamRoleArn='{{ARN for the IAM role you are using}}',
    s3BucketRegion='{{region}}',
    failOnError=False,
    parallelism='MEDIUM',
    updateSingleCardinalityProperties=False,
    queueRequest=False
)

print(response)
```

```
awscurl https://{{your-neptune-endpoint}}:{{port}}/loader \
  --region {{us-east-1}} \
  --service neptune-db \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{
        "source" : "s3://{{bucket-name}}/{{object-key-name}}",
        "format" : "csv",
        "iamRoleArn" : "{{ARN for the IAM role you are using}}",
        "region" : "{{region}}",
        "failOnError" : "FALSE",
        "parallelism" : "MEDIUM",
        "updateSingleCardinalityProperties" : "FALSE",
        "queueRequest" : "FALSE"
      }'
```
이 예제에서는 자격 AWS 증명이 환경에 구성되어 있다고 가정합니다. {{us-east-1}}을 Neptune 클러스터의 리전으로 바꿉니다.

```
curl -X POST https://{{your-neptune-endpoint}}:{{port}}/loader \
  -H 'Content-Type: application/json' \
  -d '{
        "source" : "s3://{{bucket-name}}/{{object-key-name}}",
        "format" : "csv",
        "iamRoleArn" : "{{ARN for the IAM role you are using}}",
        "region" : "{{region}}",
        "failOnError" : "FALSE",
        "parallelism" : "MEDIUM",
        "updateSingleCardinalityProperties" : "FALSE",
        "queueRequest" : "FALSE"
      }'
```

**Example 응답**  

```
{
    "status" : "200 OK",
    "payload" : {
        "loadId" : "{{ef478d76-d9da-4d94-8ff1-08d9d4863aa5}}"
    }
}
```