Class: AWSCDK::Datasync::CfnTask::TaskScheduleProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
datasync/cfn_task.rb

Overview

Configures your AWS DataSync task to run on a schedule (at a minimum interval of 1 hour).

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schedule_expression: nil, status: nil) ⇒ TaskScheduleProperty

Returns a new instance of TaskScheduleProperty.

Parameters:

  • schedule_expression (String, nil) (defaults to: nil)

    Specifies your task schedule by using a cron or rate expression.

  • status (String, nil) (defaults to: nil)

    Specifies whether to enable or disable your task schedule.



1491
1492
1493
1494
1495
1496
# File 'datasync/cfn_task.rb', line 1491

def initialize(schedule_expression: nil, status: nil)
  @schedule_expression = schedule_expression
  Jsii::Type.check_type(@schedule_expression, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "scheduleExpression") unless @schedule_expression.nil?
  @status = status
  Jsii::Type.check_type(@status, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "status") unless @status.nil?
end

Instance Attribute Details

#schedule_expressionString? (readonly)

Specifies your task schedule by using a cron or rate expression.

Use cron expressions for task schedules that run on a specific time and day. For example, the following cron expression creates a task schedule that runs at 8 AM on the first Wednesday of every month:

cron(0 8 * * 3#1)

Use rate expressions for task schedules that run on a regular interval. For example, the following rate expression creates a task schedule that runs every 12 hours:

rate(12 hours)

For information about cron and rate expression syntax, see the Amazon EventBridge User Guide .



1512
1513
1514
# File 'datasync/cfn_task.rb', line 1512

def schedule_expression
  @schedule_expression
end

#statusString? (readonly)

Specifies whether to enable or disable your task schedule.

Your schedule is enabled by default, but there can be situations where you need to disable it. For example, you might need to pause a recurring transfer to fix an issue with your task or perform maintenance on your storage system.

DataSync might disable your schedule automatically if your task fails repeatedly with the same error. For more information, see TaskScheduleDetails .



1521
1522
1523
# File 'datasync/cfn_task.rb', line 1521

def status
  @status
end

Class Method Details

.jsii_propertiesObject



1523
1524
1525
1526
1527
1528
# File 'datasync/cfn_task.rb', line 1523

def self.jsii_properties
  {
    :schedule_expression => "scheduleExpression",
    :status => "status",
  }
end

Instance Method Details

#to_jsiiObject



1530
1531
1532
1533
1534
1535
1536
1537
# File 'datasync/cfn_task.rb', line 1530

def to_jsii
  result = {}
  result.merge!({
    "scheduleExpression" => @schedule_expression,
    "status" => @status,
  })
  result.compact
end