

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

# SageMaker API または を使用してトレーニングプランを拡張する AWS CLI
<a name="training-plan-extension-using-api-cli-sdk"></a>

SageMaker トレーニングプランは、API を通じてプログラムでトレーニングプランを拡張することをサポートしています。 AWS CLI または SageMaker SDKs を使用して、トレーニングプラン API を操作できます。

トレーニングプランの拡張には、次の API アクションが含まれます。
+ **`SearchTrainingPlanOfferings`:** トレーニングプランの ARN と必要な拡張期間を指定して、使用可能な拡張サービスを検索します。API は、 `TrainingPlanExtensionOfferings`フィールドに拡張機能を返します。
+ **`ExtendTrainingPlan`:** 特定の拡張機能を購入して、 を指定してトレーニングプランを拡張します`TrainingPlanExtensionOfferingId`。これにより、追加のコンピューティング容量が予約され、トレーニングプランの終了日が更新されます。
+ **`DescribeTrainingPlanExtensionHistory`:** ステータス、日付、支払い情報を含む過去のすべての拡張を含む、トレーニングプランの完全な拡張履歴を表示します。

**Topics**
+ [拡張機能を検索する](search-extension-offerings-api-cli-sdk.md)
+ [拡張機能を購入する](extend-training-plan-api-cli-sdk.md)
+ [拡張履歴の表示](describe-extension-history-api-cli-sdk.md)

# 拡張機能を検索する
<a name="search-extension-offerings-api-cli-sdk"></a>

API を `TrainingPlanArn`パラメータ[https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_SearchTrainingPlanOfferings.html](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_SearchTrainingPlanOfferings.html)とともに使用して、トレーニングプランで使用できる拡張機能を見つけます。

次の例では、 AWS CLI コマンドを使用して、既存のトレーニングプランの拡張機能を検索します。

```
aws sagemaker search-training-plan-offerings \
--training-plan-arn "arn:aws:sagemaker:us-east-2:123456789012:training-plan/my-training-plan" \
--duration-hours 48
```

この JSON ドキュメントは、SageMaker トレーニングプラン API からのサンプルレスポンスです。レスポンスには、指定されたトレーニングプランで利用可能な拡張機能`TrainingPlanExtensionOfferings`が含まれます。

```
{
    "TrainingPlanOfferings": [],
    "TrainingPlanExtensionOfferings": [
        {
            "TrainingPlanExtensionOfferingId": "tpeo-SHA-256-hash-value",
            "AvailabilityZone": "us-east-2a",
            "StartDate": "2025-09-23T12:00:00Z",
            "EndDate": "2025-09-25T12:00:00Z",
            "DurationHours": 48,
            "UpfrontFee": "xxxx.xx",
            "CurrencyCode": "USD"
        }
    ]
}
```

以下のセクションでは、拡張機能を検索するときに `SearchTrainingPlanOfferings` API オペレーションの必須およびオプションの入力リクエストパラメータを定義します。

## 必須パラメータ
<a name="search-extension-offerings-required-params"></a>

[https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_SearchTrainingPlanOfferings.html](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_SearchTrainingPlanOfferings.html) API を呼び出して拡張機能を検索する場合は、次の値を指定する必要があります。
+ `TrainingPlanArn`: 拡張するトレーニングプランの 。は、ステータスが `Active`または の既存のトレーニングプランを参照`TrainingPlanArn`する必要があります`Scheduled`。

## 任意指定のパラメータ
<a name="search-extension-offerings-optional-params"></a>

以下のセクションでは、拡張機能を検索するときに `SearchTrainingPlanOfferings` API リクエストに渡すことができるオプションパラメータの詳細について説明します。
+ `DurationHours`: 拡張機能に必要な時間単位の期間。`DurationHours` は、24 の最も近い倍数に切り上げられます。

# 拡張機能を購入する
<a name="extend-training-plan-api-cli-sdk"></a>

拡張機能を選択したら、 [https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ExtendTrainingPlan.html](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ExtendTrainingPlan.html) API を使用して拡張機能を購入します。

次の例では、 AWS CLI コマンドを使用してトレーニングプランを拡張します。

```
aws sagemaker extend-training-plan \
--training-plan-extension-offering-id "tpeo-SHA-256-hash-value"
```

この JSON ドキュメントは、SageMaker トレーニングプラン API からのサンプルレスポンスです。レスポンスには、トレーニングプランの拡張機能のリストが含まれます。

```
{
    "TrainingPlanExtensions": [
        {
            "TrainingPlanExtensionOfferingId": "tpeo-SHA-256-hash-value",
            "ExtendedAt": "2025-09-17T10:00:00Z",
            "StartDate": "2025-09-23T12:00:00Z",
            "EndDate": "2025-09-25T12:00:00Z",
            "Status": "Pending",
            "PaymentStatus": "Pending",
            "AvailabilityZone": "us-east-2a",
            "DurationHours": 48,
            "UpfrontFee": "xxxx.xx",
            "CurrencyCode": "USD"
        }
    ]
}
```

次のセクションでは、 `ExtendTrainingPlan` API オペレーションの必須入力リクエストパラメータを定義します。

## 必須パラメータ
<a name="extend-training-plan-required-params"></a>

[https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ExtendTrainingPlan.html](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ExtendTrainingPlan.html) API を呼び出してトレーニングプランを拡張する場合は、次の値を指定する必要があります。
+ `TrainingPlanExtensionOfferingId`: 購入する拡張機能の ID。この ID は、`SearchTrainingPlanOfferings`API コールのレスポンス`TrainingPlanExtensionOfferings`で から取得できます。形式は `tpeo-*` で始まる必要があります。

# 拡張履歴の表示
<a name="describe-extension-history-api-cli-sdk"></a>

[https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeTrainingPlanExtensionHistory.html](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeTrainingPlanExtensionHistory.html) API を使用して、トレーニングプランの完全な拡張履歴を表示します。

次の例では、 AWS CLI コマンドを使用して拡張履歴を取得します。

```
aws sagemaker describe-training-plan-extension-history \
--training-plan-arn "arn:aws:sagemaker:us-east-2:123456789012:training-plan/my-training-plan"
```

この JSON ドキュメントは、SageMaker トレーニングプラン API からのサンプルレスポンスです。レスポンスには、トレーニングプランのすべての拡張機能のページ分割されたリストが含まれます。

```
{
    "TrainingPlanExtensions": [
        {
            "TrainingPlanExtensionOfferingId": "tpeo-SHA-256-hash-value",
            "ExtendedAt": "2025-09-17T10:00:00Z",
            "StartDate": "2025-09-23T12:00:00Z",
            "EndDate": "2025-09-25T12:00:00Z",
            "Status": "Active",
            "PaymentStatus": "Completed",
            "AvailabilityZone": "us-east-2a",
            "DurationHours": 48,
            "UpfrontFee": "xxxx.xx",
            "CurrencyCode": "USD"
        }
    ],
    "NextToken": null
}
```

以下のセクションでは、時系列予測に使用される `DescribeTrainingPlanExtensionHistory` API の必須およびオプションの入力リクエストパラメータを定義します。

## 必須パラメータ
<a name="describe-extension-history-required-params"></a>

[https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeTrainingPlanExtensionHistory.html](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeTrainingPlanExtensionHistory.html) API を呼び出すときは、次の値を指定する必要があります。
+ `TrainingPlanArn`: 拡張履歴を取得するトレーニングプランの 。

## 任意指定のパラメータ
<a name="describe-extension-history-optional-params"></a>

次のセクションでは、表形式データを使用する場合に `DescribeTrainingPlanExtensionHistory` API アクションに渡すことができるいくつかのオプションのパラメータの詳細を説明します。
+ `NextToken`: 前のレスポンスが切り捨てられた場合は、このトークンを受け取ります。次のリクエストでこれを使用して、次の結果セットを受け取ります。
+ `MaxResults`: レスポンスで返される拡張機能の最大数。

## 拡張ステータス値
<a name="extension-status-values-api"></a>

拡張機能のステータス値は次のとおりです。
+ `Pending`: 拡張機能がリクエストされ、支払い処理を待っています。
+ `Active`: 拡張機能は正常に購入され、アクティブになっています。
+ `Scheduled`: 拡張機能は今後開始される予定です。
+ `Failed`: 拡張機能の購入に失敗しました (支払いの問題など）。
+ `Expired`: 延長期間が終了しました。