

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# `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` コマンドは、次のようになります。

```
curl \
  -X POST https://(your Neptune endpoint)/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` コマンドは、次のようになります。

```
curl \
  -X POST https://(your Neptune endpoint)/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` コマンドは、次のようになります。

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

モデル変換ジョブによって作成されたモデルから既存の推論エンドポイントを更新するための Neptune ML `endpoints` コマンドは、次のようになります。

```
curl \
  -X POST https://(your Neptune endpoint)/ml/endpoints
  -H 'Content-Type: application/json' \
  -d '{
        "id" : "(a unique ID for the new endpoint)",
        "update" : "true",
        "mlModelTransformJobId": "(the model-training 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`** — (*オプション*) トレーニングのモデルタイプ。デフォルトでは、`modelType` に基づき ML モデルは自動的にデータ処理で使用されますが、ここで別のモデルタイプを指定できます。

  *タイプ*: 文字列。*デフォルト値*: `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`**   –   (*オプション*) エンドポイントを実行する ML コンピューティングインスタンス AWS Key Management Service (複数可AWS KMS) にアタッチされたストレージボリュームのデータを暗号化するために SageMaker AI が使用する () キー。

  *タイプ*: 文字列。*デフォルト*: *なし*。

## Neptune ML `endpoints` コマンドを使用した推論エンドポイントのステータスの取得
<a name="machine-learning-api-endpoints-get-endpoint-status"></a>

インスタンスエンドポイントのステータスのサンプル Neptune ML `endpoints` コマンドは、次のようになります。

```
curl -s \
  "https://(your Neptune endpoint)/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` コマンドは、次のようになります。

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

または、このようになります。

```
curl -s \
  -X DELETE "https://(your Neptune endpoint)/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` コマンドは次のようになります。

```
curl -s "https://(your Neptune endpoint)/ml/endpoints" \
  | python -m json.tool
```

または、このようになります。

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

**`dataprocessing` 推論エンドポイントの一覧表示のパラメータ**
+ **`maxItems`** — (*オプション*) 返される項目の最大数。

  *タイプ*: 整数。*デフォルト*: `10`。*最大許容値*: `1024`。
+ **`neptuneIamRoleArn`** — (*オプション*) SageMaker AI および Amazon S3 リソースへの Neptune アクセスを提供する IAM ロールの ARN。

  *タイプ*: 文字列。*注意*: これは DB クラスターパラメータグループに一覧表示されている必要があります。そうしないと、エラーがスローされます。