def add_schedule(self, name, activation_date, day_period='one_time',
                     final_action='ALERT_FAILURE', activated=True,
                     minute_period='one_time', day_mask=None,
                     repeat_until_date=None, comment=None):
        """
        Add a schedule to an existing task.
        
        :param str name: name for this schedule
        :param int activation_date: when to start this task. Activation date
            should be a UTC time represented in milliseconds.
        :param str day_period: when this task should be run. Valid options:
            'one_time', 'daily', 'weekly', 'monthly', 'yearly'. If 'daily' is
            selected, you can also provide a value for 'minute_period'.
            (default: 'one_time')
        :param str minute_period: only required if day_period is set to 'daily'.
            Valid options: 'each_quarter' (15 min), 'each_half' (30 minutes), or
            'hourly', 'one_time' (default: 'one_time')
        :param int day_mask: If the task day_period=weekly, then specify the day
            or days for repeating. Day masks are: sun=1, mon=2, tue=4, wed=8,
            thu=16, fri=32, sat=64. To repeat for instance every Monday, Wednesday
            and Friday, the value must be 2 + 8 + 32 = 42
        :param str final_action: what type of action to perform after the
            scheduled task runs. Options are: 'ALERT_FAILURE', 'ALERT', or
            'NO_ACTION' (default: ALERT_FAILURE)
        :param bool activated: whether to activate the schedule (default: True)
        :param str repeat_until_date: if this is anything but a one time task run,
            you can specify the date when this task should end. The format is the
            same as the `activation_date` param.
        :param str comment: optional comment
        :raises ActionCommandFailed: failed adding schedule
        :return: None
        """
        json = {
            'name': name,
            'activation_date': activation_date,
            'day_period': day_period,
            'day_mask': day_mask,
            'activated': activated,
            'final_action': final_action,
            'minute_period': minute_period,
            'repeat_until_date': repeat_until_date if repeat_until_date else None,
            'comment': comment}
        
        if 'daily' in day_period:
            minute_period = minute_period if minute_period != 'one_time' else 'hourly'
            json['minute_period'] = minute_period
        
        return self.make_request(
            ActionCommandFailed,
            method='create',
            resource='task_schedule',
            json=json)