View a markdown version of this page

SageMaker API または を使用してトレーニングプランで Studio アプリを作成または更新する AWS CLI - Amazon SageMaker AI

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

SageMaker API または を使用してトレーニングプランで Studio アプリを作成または更新する AWS CLI

SageMaker Studio アプリで SageMaker トレーニングプランを使用するには、 CreateApp API オペレーションを呼び出すResourceSpecときに、 の TrainingPlanArnパラメータでトレーニングプランの ARN を指定します。

次の例は、 を使用してトレーニングプランで JupyterLab または Code Editor アプリを作成する方法を示しています AWS CLI。必要に応じて、 --app-type値を JupyterLabまたは に置き換えCodeEditorます。は、トレーニングプランのインスタンスタイプと一致するInstanceType必要があります。

aws sagemaker create-app \ --domain-id d-xxxxxxxxxxxx \ --space-name my-space \ --app-type JupyterLab \ --app-name default \ --resource-spec '{ "InstanceType": "instance-type", "TrainingPlanArn": "arn:aws:sagemaker:us-east-1:123456789012:training-plan/my-training-plan" }'

アプリを作成したら、 DescribeApp API を呼び出してトレーニングプランの関連付けを確認できます。アプリがトレーニングプランで作成されたResourceSpec場合、レスポンスには が TrainingPlanArnに含まれます。

aws sagemaker describe-app \ --domain-id d-xxxxxxxxxxxx \ --space-name my-space \ --app-type JupyterLab \ --app-name default

既存のアプリのトレーニングプランを更新するには、上記のcreate-appコマンドを使用して、現在のアプリを削除し、更新されたトレーニングプラン ARN を使用して新しいアプリを作成します。

aws sagemaker delete-app \ --domain-id d-xxxxxxxxxxxx \ --space-name my-space \ --app-type JupyterLab \ --app-name default