

AWS Data Pipeline は新規顧客には利用できなくなりました。の既存のお客様は、通常どおりサービスを AWS Data Pipeline 引き続き使用できます。[詳細はこちら](https://aws.amazon.com/blogs/big-data/migrate-workloads-from-aws-data-pipeline/)

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

# スケジュール
<a name="dp-object-schedule"></a>

アクティビティの実行など、予定されているイベントのタイミングを定義します。

**注記**  
スケジュールの開始時刻が過去の場合、 はパイプラインを AWS Data Pipeline バックフィルし、指定された開始時刻からすぐに実行のスケジュールを開始します。テストまたは開発の場合は、比較的短い期間を使用してください。それ以外の場合、 AWS Data Pipeline はその間隔のすべてのパイプラインの実行をキューに入れ、スケジュールしようとします。 AWS Data Pipeline は、パイプラインのアクティブ化をブロックして、パイプラインコンポーネント`scheduledStartTime`が 1 日前より前に誤ってバックフィルされないようにします。

## 例
<a name="schedule-example"></a>

以下は、このオブジェクト型の例です。これは、2012-09-01 の 00 00:00 に開始し 2012-10-01 の 00:00:00 に終了する毎時間のスケジュールを定義します。最初の期間は 2012-09-01 の 01:00:00 に終了します。

```
{
  "id" : "Hourly",
  "type" : "Schedule",
  "period" : "1 hours",
  "startDateTime" : "2012-09-01T00:00:00",
  "endDateTime" : "2012-10-01T00:00:00"
}
```

次のパイプラインは、`FIRST_ACTIVATION_DATE_TIME` に開始され、2014 年 4 月 25 日の 22:00:00 まで 1 時間ごとに実行されます。

```
{
     "id": "SchedulePeriod",
     "name": "SchedulePeriod",
     "startAt": "FIRST_ACTIVATION_DATE_TIME",
     "period": "1 hours",
     "type": "Schedule",
     "endDateTime": "2014-04-25T22:00:00"
   }
```

次のパイプラインは、`FIRST_ACTIVATION_DATE_TIME` に開始されます。1 時間ごとに実行され、3 回の実行後、終了されます。

```
{
     "id": "SchedulePeriod",
     "name": "SchedulePeriod",
     "startAt": "FIRST_ACTIVATION_DATE_TIME",
     "period": "1 hours",
     "type": "Schedule",
     "occurrences": "3"
   }
```

次のパイプラインは、2014 年 4 月 25 日の 22:00:00 に開始されます。1 時間ごとに実行され、3 回の実行後、終了されます。

```
{
     "id": "SchedulePeriod",
     "name": "SchedulePeriod",
     "startDateTime": "2014-04-25T22:00:00",
     "period": "1 hours",
     "type": "Schedule",
     "occurrences": "3"
   }
```

Default オブジェクトを使用したオンデマンド

```
{
  "name": "Default",
  "resourceRole": "DataPipelineDefaultResourceRole",
  "role": "DataPipelineDefaultRole",
  "scheduleType": "ondemand"
}
```

明示的な Schedule オブジェクトを使用したオンデマンド

```
{
  "name": "Default",
  "resourceRole": "DataPipelineDefaultResourceRole",
  "role": "DataPipelineDefaultRole",
  "scheduleType": "ondemand"
},
{
  "name": "DefaultSchedule",
  "type": "Schedule",
  "id": "DefaultSchedule",
  "period": "ONDEMAND_PERIOD",
  "startAt": "ONDEMAND_ACTIVATION_TIME"
},
```

次の例は、Default オブジェクトから Schedule を継承する方法、そのオブジェクトに対して明示的に設定する方法、または親参照から指定する方法を示します。

Default オブジェクトから継承されたスケジュール

```
{
  "objects": [
  {       
      "id": "Default",
      "failureAndRerunMode":"cascade",
      "resourceRole": "DataPipelineDefaultResourceRole",
      "role": "DataPipelineDefaultRole",
      "pipelineLogUri": "s3://myLogsbucket",
      "scheduleType": "cron",
      "schedule": {
        "ref": "DefaultSchedule"
      }
   },
   {
      "type": "Schedule",
      "id": "DefaultSchedule",
      "occurrences": "1",
      "period": "1 Day",
      "startAt": "FIRST_ACTIVATION_DATE_TIME"
    },
    { 
      "id": "A_Fresh_NewEC2Instance",
      "type": "Ec2Resource",
      "terminateAfter": "1 Hour"
    },
    {
      "id": "ShellCommandActivity_HelloWorld",
      "runsOn": {
        "ref": "A_Fresh_NewEC2Instance"
      },
      "type": "ShellCommandActivity",
      "command": "echo 'Hello World!'"
    }
  ]
}
```

オブジェクトの明示的なスケジュール

```
{
  "objects": [
  {       
      "id": "Default",
      "failureAndRerunMode":"cascade",
      "resourceRole": "DataPipelineDefaultResourceRole",
      "role": "DataPipelineDefaultRole",
      "pipelineLogUri": "s3://myLogsbucket",
      "scheduleType": "cron"
      
   },
   {
      "type": "Schedule",
      "id": "DefaultSchedule",
      "occurrences": "1",
      "period": "1 Day",
      "startAt": "FIRST_ACTIVATION_DATE_TIME"
    },
    { 
      "id": "A_Fresh_NewEC2Instance",
      "type": "Ec2Resource",
      "terminateAfter": "1 Hour"
    },
    {
      "id": "ShellCommandActivity_HelloWorld",
      "runsOn": {
        "ref": "A_Fresh_NewEC2Instance"
      },
      "schedule": {
        "ref": "DefaultSchedule"
      },
      "type": "ShellCommandActivity",
      "command": "echo 'Hello World!'"
    }
  ]
}
```

親参照からのスケジュール

```
{
  "objects": [
  {       
      "id": "Default",
      "failureAndRerunMode":"cascade",
      "resourceRole": "DataPipelineDefaultResourceRole",
      "role": "DataPipelineDefaultRole",
      "pipelineLogUri": "s3://myLogsbucket",
      "scheduleType": "cron"
      
   },
   {       
      "id": "parent1",
      "schedule": {
        "ref": "DefaultSchedule"
      }
      
   },
   {
      "type": "Schedule",
      "id": "DefaultSchedule",
      "occurrences": "1",
      "period": "1 Day",
      "startAt": "FIRST_ACTIVATION_DATE_TIME"
    },
    { 
      "id": "A_Fresh_NewEC2Instance",
      "type": "Ec2Resource",
      "terminateAfter": "1 Hour"
    },
    {
      "id": "ShellCommandActivity_HelloWorld",
      "runsOn": {
        "ref": "A_Fresh_NewEC2Instance"
      },
      "parent": {
        "ref": "parent1"
      },
      "type": "ShellCommandActivity",
      "command": "echo 'Hello World!'"
    }
  ]
}
```

## 構文
<a name="schedule-syntax"></a>


****  

| 必須フィールド | 説明 | スロットタイプ | 
| --- | --- | --- | 
| 期間 | パイプラインの実行頻度。形式は、"N [minutes\$1hours\$1days\$1weeks\$1months]" です。ここで N は数字で、その後に時間指定子の 1 つを続けます。たとえば、"15 minutes" は、15 分ごとにパイプラインを実行します。最小間隔は 15 分で、最大間隔は 3 年です。 | Period | 

 


****  

| 必須のグループ (次のいずれかが必要です) | 説明 | スロットタイプ | 
| --- | --- | --- | 
| startAt | スケジュールされたパイプライン実行を開始する日時。有効な値は FIRST\$1ACTIVATION\$1DATE\$1TIME ですが、この値はオンデマンドパイプラインの作成には推奨されていません。 | 一覧表 | 
| startDateTime | スケジュールした実行を開始する日時。startDateTime または startAt を使用する必要があります。両方使用することはできません。 | DateTime | 

 


****  

| オプションのフィールド | 説明 | スロットタイプ | 
| --- | --- | --- | 
| endDateTime | スケジュールした実行が終了する日時。startDateTime または startAt の値より後の日時である必要があります。デフォルトの動作では、パイプラインがシャットダウンされるまで実行をスケジューします。 | DateTime | 
| occurrences | パイプラインをアクティブ化してから実行する回数。endDateTime で occurrences を使用することはできません。 | 整数 | 
| parent | スロットの継承元となる現在のオブジェクトの親。 | 参照オブジェクト ("parent":\$1"ref":"myBaseObjectId"\$1 など) | 

 


****  

| 実行時フィールド | 説明 | スロットタイプ | 
| --- | --- | --- | 
| @version | オブジェクトが作成されたパイプラインのバージョン。 | String | 

 


****  

| システムフィールド | 説明 | スロットタイプ | 
| --- | --- | --- | 
| @error | 形式が正しくないオブジェクトを説明するエラー | String | 
| @firstActivationTime | オブジェクト作成の時刻。 | DateTime | 
| @pipelineId | このオブジェクトが属するパイプラインの ID | String | 
| @sphere | オブジェクトの球は、ライフサイクルにおける場所を示します。コンポーネントオブジェクトにより、試行オブジェクトを実行するインスタンスオブジェクトが発生します | String | 