Skip to content

ランタイムパラメーターの定義

ランタイムパラメーターを作成および定義して、実行時にカスタムジョブで使用されるスクリプトとタスクに異なる値を指定することができます。これをmetadata.yamlファイルに含めることで、カスタムジョブを再利用しやすくなります。 このファイルのテンプレートは、ファイル > 作成ドロップダウンから使用できます。

ランタイムパラメーターを定義するには、以下のruntimeParameterDefinitionsmetadata.yamlに追加できます。

キー 説明
fieldName ランタイムパラメーターの名前を定義します。
type ランタイムパラメーターに含まれるデータ型(stringbooleannumericcredentialdeployment)を定義します。
defaultValue (オプション)ランタイムパラメーターのデフォルト文字列値(credentialタイプはデフォルト値をサポートしません) defaultValueを指定せずにランタイムパラメーターを定義した場合、デフォルト値はNoneです。
minValue (オプション)numericランタイムパラメーターには、ランタイムパラメーターで使用可能な最小数値を設定します。
maxValue (オプション)numericランタイムパラメーターには、ランタイムパラメーターで使用可能な最大数値を設定します。
credentialType (オプション)credentialランタイムパラメーターの場合、パラメーターに含める資格情報のタイプを設定します。
allowEmpty (オプション)ランタイムパラメーターに空のフィールドポリシーを設定します。
  • True:(デフォルト)空のランタイムパラメーターを許可します。
  • False:デプロイ前にランタイムパラメーターの値を指定するよう徹底します。
description (オプション)ランタイムパラメーターの目的または内容の説明を入力します。
Example: metadata.yaml
name: runtime-parameter-example

runtimeParameterDefinitions:
- fieldName: my_first_runtime_parameter
  type: string
  description: My first runtime parameter.

- fieldName: runtime_parameter_with_default_value
  type: string
  defaultValue: Default
  description: A string-type runtime parameter with a default value.

- fieldName: runtime_parameter_boolean
  type: boolean
  defaultValue: true
  description: A boolean-type runtime parameter with a default value of true.

- fieldName: runtime_parameter_numeric
  type: numeric
  defaultValue: 0
  minValue: -100
  maxValue: 100
  description: A boolean-type runtime parameter with a default value of 0, a minimum value of -100, and a maximum value of 100.

- fieldName: runtime_parameter_for_credentials
  type: credential
  allowEmpty: false
  description: A runtime parameter containing a dictionary of credentials. 

credentialランタイムパラメータータイプは、DataRobot REST APIで使用可能な任意のcredentialType値をサポートします。 以下の例に示すように、含まれる資格情報はcredentialTypeに依存します。

備考

サポートされている資格情報タイプの詳細については、 資格情報のAPIリファレンスドキュメントを参照してください。

資格情報タイプ
basic
basic:
    credentialType: basic
    description: string
    name: string
    password: string
    user: string
        
azure
azure:
    credentialType: azure
    description: string
    name: string
    azureConnectionString: string
        
gcp
gcp:
    credentialType: gcp
    description: string
    name: string
    gcpKey: string
        
s3
s3:
  credentialType: s3
    description: string
    name: string
    awsAccessKeyId: string
    awsSecretAccessKey: string
    awsSessionToken: string
        
api_token
api_token:
    credentialType: api_token
    apiToken: string
    name: string