

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

# `endpoints` 명령을 사용하여 추론 엔드포인트 관리
<a name="machine-learning-api-endpoints"></a>

Neptune ML `endpoints` 명령을 사용하여 추론 엔드포인트를 생성하거나, 상태를 확인하거나, 삭제하거나, 기존 추론 엔드포인트를 나열할 수 있습니다.

## Neptune ML `endpoints` 명령을 사용하여 추론 엔드포인트 생성
<a name="machine-learning-api-endpoints-create-job"></a>

훈련 작업으로 만든 모델에서 추론 엔드포인트를 생성하는 Neptune ML `endpoints` 명령은 다음과 같습니다.

------
#### [ AWS CLI ]

```
aws neptunedata create-ml-endpoint \
  --endpoint-url https://your-neptune-endpoint:port \
  --id "(a unique ID for the new endpoint)" \
  --ml-model-training-job-id "(the model-training job-id of a completed job)"
```

자세한 내용은 AWS CLI 명령 참조의 [create-ml-endpoint](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/create-ml-endpoint.html)를 참조하세요.

------
#### [ SDK ]

```
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.create_ml_endpoint(
    id='(a unique ID for the new endpoint)',
    mlModelTrainingJobId='(the model-training job-id of a completed job)'
)

print(response)
```

------
#### [ awscurl ]

```
awscurl https://your-neptune-endpoint:port/ml/endpoints \
  --region us-east-1 \
  --service neptune-db \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{
        "id" : "(a unique ID for the new endpoint)",
        "mlModelTrainingJobId": "(the model-training job-id of a completed job)"
      }'
```

**참고**  
이 예제에서는 자격 AWS 증명이 환경에 구성되어 있다고 가정합니다. *us-east-1*을 Neptune 클러스터의 리전으로 바꿉니다.

------
#### [ curl ]

```
curl \
  -X POST https://your-neptune-endpoint:port/ml/endpoints \
  -H 'Content-Type: application/json' \
  -d '{
        "id" : "(a unique ID for the new endpoint)",
        "mlModelTrainingJobId": "(the model-training job-id of a completed job)"
      }'
```

------

훈련 작업으로 만든 모델에서 기존 추론 엔드포인트를 업데이트하는 Neptune ML `endpoints` 명령은 다음과 같습니다.

------
#### [ AWS CLI ]

```
aws neptunedata create-ml-endpoint \
  --endpoint-url https://your-neptune-endpoint:port \
  --id "(a unique ID for the new endpoint)" \
  --update \
  --ml-model-training-job-id "(the model-training job-id of a completed job)"
```

자세한 내용은 AWS CLI 명령 참조의 [create-ml-endpoint](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/create-ml-endpoint.html)를 참조하세요.

------
#### [ SDK ]

```
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.create_ml_endpoint(
    id='(a unique ID for the new endpoint)',
    update=True,
    mlModelTrainingJobId='(the model-training job-id of a completed job)'
)

print(response)
```

------
#### [ awscurl ]

```
awscurl https://your-neptune-endpoint:port/ml/endpoints \
  --region us-east-1 \
  --service neptune-db \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{
        "id" : "(a unique ID for the new endpoint)",
        "update" : "true",
        "mlModelTrainingJobId": "(the model-training job-id of a completed job)"
      }'
```

**참고**  
이 예제에서는 자격 AWS 증명이 환경에 구성되어 있다고 가정합니다. *us-east-1*을 Neptune 클러스터의 리전으로 바꿉니다.

------
#### [ curl ]

```
curl \
  -X POST https://your-neptune-endpoint:port/ml/endpoints \
  -H 'Content-Type: application/json' \
  -d '{
        "id" : "(a unique ID for the new endpoint)",
        "update" : "true",
        "mlModelTrainingJobId": "(the model-training job-id of a completed job)"
      }'
```

------

모델 변환 작업으로 만든 모델에서 추론 엔드포인트를 생성하는 Neptune ML `endpoints` 명령은 다음과 같습니다.

------
#### [ AWS CLI ]

```
aws neptunedata create-ml-endpoint \
  --endpoint-url https://your-neptune-endpoint:port \
  --id "(a unique ID for the new endpoint)" \
  --ml-model-transform-job-id "(the model-transform job-id of a completed job)"
```

자세한 내용은 AWS CLI 명령 참조의 [create-ml-endpoint](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/create-ml-endpoint.html)를 참조하세요.

------
#### [ SDK ]

```
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.create_ml_endpoint(
    id='(a unique ID for the new endpoint)',
    mlModelTransformJobId='(the model-transform job-id of a completed job)'
)

print(response)
```

------
#### [ awscurl ]

```
awscurl https://your-neptune-endpoint:port/ml/endpoints \
  --region us-east-1 \
  --service neptune-db \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{
        "id" : "(a unique ID for the new endpoint)",
        "mlModelTransformJobId": "(the model-transform job-id of a completed job)"
      }'
```

**참고**  
이 예제에서는 자격 AWS 증명이 환경에 구성되어 있다고 가정합니다. *us-east-1*을 Neptune 클러스터의 리전으로 바꿉니다.

------
#### [ curl ]

```
curl \
  -X POST https://your-neptune-endpoint:port/ml/endpoints \
  -H 'Content-Type: application/json' \
  -d '{
        "id" : "(a unique ID for the new endpoint)",
        "mlModelTransformJobId": "(the model-transform job-id of a completed job)"
      }'
```

------

모델 변환 작업으로 만든 모델에서 기존 추론 엔드포인트를 업데이트하는 Neptune ML `endpoints` 명령은 다음과 같습니다.

------
#### [ AWS CLI ]

```
aws neptunedata create-ml-endpoint \
  --endpoint-url https://your-neptune-endpoint:port \
  --id "(a unique ID for the new endpoint)" \
  --update \
  --ml-model-transform-job-id "(the model-transform job-id of a completed job)"
```

자세한 내용은 AWS CLI 명령 참조의 [create-ml-endpoint](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/create-ml-endpoint.html)를 참조하세요.

------
#### [ SDK ]

```
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.create_ml_endpoint(
    id='(a unique ID for the new endpoint)',
    update=True,
    mlModelTransformJobId='(the model-transform job-id of a completed job)'
)

print(response)
```

------
#### [ awscurl ]

```
awscurl https://your-neptune-endpoint:port/ml/endpoints \
  --region us-east-1 \
  --service neptune-db \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{
        "id" : "(a unique ID for the new endpoint)",
        "update" : "true",
        "mlModelTransformJobId": "(the model-transform job-id of a completed job)"
      }'
```

**참고**  
이 예제에서는 자격 AWS 증명이 환경에 구성되어 있다고 가정합니다. *us-east-1*을 Neptune 클러스터의 리전으로 바꿉니다.

------
#### [ curl ]

```
curl \
  -X POST https://your-neptune-endpoint:port/ml/endpoints \
  -H 'Content-Type: application/json' \
  -d '{
        "id" : "(a unique ID for the new endpoint)",
        "update" : "true",
        "mlModelTransformJobId": "(the model-transform job-id of a completed job)"
      }'
```

------

**추론 엔드포인트를 생성하는 `endpoints` 파라미터**
+ **`id`**   –   (*선택 사항*) 새 추론 엔드포인트의 고유 식별자입니다.

  *유형*: 문자열. *기본값*: 자동 생성된 타임스탬프 이름.
+ **`mlModelTrainingJobId`**   –   추론 엔드포인트가 가리키는 모델을 생성하여 완료된 모델 훈련 작업의 작업 ID입니다.

  *유형*: 문자열.

  *참고*: `mlModelTrainingJobId` 또는 `mlModelTransformJobId`를 제공해야 합니다.
+ **`mlModelTransformJobId`**   –   완료된 모델 변환 작업의 작업 ID입니다.

  *유형*: 문자열.

  *참고*: `mlModelTrainingJobId` 또는 `mlModelTransformJobId`를 제공해야 합니다.
+ **`update`**   –   (*선택 사항*) 이 파라미터가 있는 경우 이 파라미터는 업데이트 요청임을 나타냅니다.

  *유형*: 부울. *기본값*: `false`

  *참고*: `mlModelTrainingJobId` 또는 `mlModelTransformJobId`를 제공해야 합니다.
+ **`neptuneIamRoleArn`** – (*선택 사항*) SageMaker AI와 Amazon S3 리소스에 대한 Neptune의 액세스 권한을 제공하는 IAM 역할의 ARN입니다.

  *유형*: 문자열. *참고*: 이는 DB 클러스터 파라미터 그룹에 나열되어 있어야 합니다. 그렇지 않으면 오류가 발생합니다.
+ **`modelName`**   –   (*선택 사항*) 훈련을 위한 모델 유형입니다. 기본적으로 ML 모델은 자동으로 데이터 처리에 사용되는 `modelType`을 기반으로 하지만, 여기에서 다른 모델 유형을 지정할 수도 있습니다.

  *유형*: 문자열. *기본값*: 이기종 그래프용 `rgcn` 및 지식 그래프용 `kge`. *유효 값*: 이기종 그래프의 경우 `rgcn`, 지식 그래프의 경우 `kge`, `transe`, `distmult` 또는 `rotate`.
+ **`instanceType`**   –   (*선택 사항*) 온라인 서비스에 사용되는 ML 인스턴스 유형입니다.

  *유형*: 문자열. *기본값*: `ml.m5.xlarge`.

  *참고*: 추론 엔드포인트의 ML 인스턴스를 선택하는 것은 작업 유형, 그래프 크기, 예산에 따라 달라집니다. [추론 엔드포인트용 인스턴스 선택](machine-learning-on-graphs-instance-selection.md#machine-learning-on-graphs-inference-endpoint-instance-size)을(를) 참조하세요.
+ **`instanceCount`**   –   (*선택 사항*) 예측을 위해 엔드포인트에 배포할 최소 Amazon EC2 인스턴스 수입니다.

  *유형*: 정수. *기본값*: `1`.
+ **`volumeEncryptionKMSKey`**   –   (*선택 사항*) SageMaker AI가 엔드포인트를 실행하는 ML 컴퓨팅 인스턴스 AWS Key Management Service (들AWS KMS)에 연결된 스토리지 볼륨의 데이터를 암호화하는 데 사용하는 () 키입니다.

  *유형*: 문자열. *기본값*: *없음*.

## Neptune ML `endpoints` 명령을 사용하여 추론 엔드포인트의 상태 가져오기
<a name="machine-learning-api-endpoints-get-endpoint-status"></a>

인스턴스 엔드포인트 상태를 나타내는 샘플 Neptune ML `endpoints` 명령은 다음과 같습니다.

------
#### [ AWS CLI ]

```
aws neptunedata get-ml-endpoint \
  --endpoint-url https://your-neptune-endpoint:port \
  --id "(the inference endpoint ID)"
```

자세한 내용은 AWS CLI 명령 참조의 [get-ml-endpoint](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/get-ml-endpoint.html)를 참조하세요.

------
#### [ SDK ]

```
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.get_ml_endpoint(
    id='(the inference endpoint ID)'
)

print(response)
```

------
#### [ awscurl ]

```
awscurl https://your-neptune-endpoint:port/ml/endpoints/(the inference endpoint ID) \
  --region us-east-1 \
  --service neptune-db \
  -X GET
```

**참고**  
이 예제에서는 자격 AWS 증명이 환경에 구성되어 있다고 가정합니다. *us-east-1*을 Neptune 클러스터의 리전으로 바꿉니다.

------
#### [ curl ]

```
curl -s \
  "https://your-neptune-endpoint:port/ml/endpoints/(the inference endpoint ID)" \
  | python -m json.tool
```

------

**인스턴스 엔드포인트 상태를 나타내는 `endpoints` 파라미터**
+ **`id`**   –   (*필수*) 추론 엔드포인트의 고유 식별자입니다.

  *유형*: 문자열.
+ **`neptuneIamRoleArn`** – (*선택 사항*) SageMaker AI와 Amazon S3 리소스에 대한 Neptune의 액세스 권한을 제공하는 IAM 역할의 ARN입니다.

  *유형*: 문자열. *참고*: 이는 DB 클러스터 파라미터 그룹에 나열되어 있어야 합니다. 그렇지 않으면 오류가 발생합니다.

## Neptune ML `endpoints` 명령을 사용하여 인스턴스 엔드포인트 삭제
<a name="machine-learning-api-endpoints-delete-endpoint"></a>

인스턴스 엔드포인트를 삭제하는 샘플 Neptune ML `endpoints` 명령은 다음과 같습니다.

------
#### [ AWS CLI ]

```
aws neptunedata delete-ml-endpoint \
  --endpoint-url https://your-neptune-endpoint:port \
  --id "(the inference endpoint ID)"
```

관련 아티팩트를 정리하려면:

```
aws neptunedata delete-ml-endpoint \
  --endpoint-url https://your-neptune-endpoint:port \
  --id "(the inference endpoint ID)" \
  --clean
```

자세한 내용은 AWS CLI 명령 참조의 [delete-ml-endpoint](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/delete-ml-endpoint.html)를 참조하세요.

------
#### [ SDK ]

```
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.delete_ml_endpoint(
    id='(the inference endpoint ID)',
    clean=True
)

print(response)
```

------
#### [ awscurl ]

```
awscurl https://your-neptune-endpoint:port/ml/endpoints/(the inference endpoint ID) \
  --region us-east-1 \
  --service neptune-db \
  -X DELETE
```

관련 아티팩트를 정리하려면:

```
awscurl "https://your-neptune-endpoint:port/ml/endpoints/(the inference endpoint ID)?clean=true" \
  --region us-east-1 \
  --service neptune-db \
  -X DELETE
```

**참고**  
이 예제에서는 자격 AWS 증명이 환경에 구성되어 있다고 가정합니다. *us-east-1*을 Neptune 클러스터의 리전으로 바꿉니다.

------
#### [ curl ]

```
curl -s \
  -X DELETE "https://your-neptune-endpoint:port/ml/endpoints/(the inference endpoint ID)"
```

아니면 다음을 사용해도 됩니다.

```
curl -s \
  -X DELETE "https://your-neptune-endpoint:port/ml/endpoints/(the inference endpoint ID)?clean=true"
```

------

**추론 엔드포인트를 삭제하는 `endpoints` 파라미터**
+ **`id`**   –   (*필수*) 추론 엔드포인트의 고유 식별자입니다.

  *유형*: 문자열.
+ **`neptuneIamRoleArn`** – (*선택 사항*) SageMaker AI와 Amazon S3 리소스에 대한 Neptune의 액세스 권한을 제공하는 IAM 역할의 ARN입니다.

  *유형*: 문자열. *참고*: 이는 DB 클러스터 파라미터 그룹에 나열되어 있어야 합니다. 그렇지 않으면 오류가 발생합니다.
+ **`clean`**   –   (*선택 사항*) 이 엔드포인트와 관련된 모든 아티팩트도 삭제해야 함을 나타냅니다.

  *유형*: 부울. *기본값*: `FALSE`.

## Neptune ML `endpoints` 명령을 사용하여 추론 엔드포인트 나열
<a name="machine-learning-api-endpoints-list-endpoints"></a>

추론 엔드포인트를 나열하는 Neptune ML `endpoints` 명령은 다음과 같습니다.

------
#### [ AWS CLI ]

```
aws neptunedata list-ml-endpoints \
  --endpoint-url https://your-neptune-endpoint:port
```

결과 수를 제한하려면:

```
aws neptunedata list-ml-endpoints \
  --endpoint-url https://your-neptune-endpoint:port \
  --max-items 3
```

자세한 내용은 AWS CLI 명령 참조의 [list-ml-endpoints](https://docs.aws.amazon.com/cli/latest/reference/neptunedata/list-ml-endpoints.html)를 참조하세요.

------
#### [ SDK ]

```
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.list_ml_endpoints(
    maxItems=3
)

print(response)
```

------
#### [ awscurl ]

```
awscurl https://your-neptune-endpoint:port/ml/endpoints \
  --region us-east-1 \
  --service neptune-db \
  -X GET
```

결과 수를 제한하려면:

```
awscurl "https://your-neptune-endpoint:port/ml/endpoints?maxItems=3" \
  --region us-east-1 \
  --service neptune-db \
  -X GET
```

**참고**  
이 예제에서는 자격 AWS 증명이 환경에 구성되어 있다고 가정합니다. *us-east-1*을 Neptune 클러스터의 리전으로 바꿉니다.

------
#### [ curl ]

```
curl -s "https://your-neptune-endpoint:port/ml/endpoints" \
  | python -m json.tool
```

아니면 다음을 사용해도 됩니다.

```
curl -s "https://your-neptune-endpoint:port/ml/endpoints?maxItems=3" \
  | python -m json.tool
```

------

**추론 엔드포인트를 나열하는 `dataprocessing` 파라미터**
+ **`maxItems`**   –   (*선택 사항*) 반환할 최대 항목 수입니다.

  *유형*: 정수. *기본값*: `10`. *최대 허용 값*: `1024`.
+ **`neptuneIamRoleArn`** – (*선택 사항*) SageMaker AI와 Amazon S3 리소스에 대한 Neptune의 액세스 권한을 제공하는 IAM 역할의 ARN입니다.

  *유형*: 문자열. *참고*: 이는 DB 클러스터 파라미터 그룹에 나열되어 있어야 합니다. 그렇지 않으면 오류가 발생합니다.