Skip to content

describe_scheduled_actions

describe_scheduled_actions(
    *,
    config_overrides: Optional[AutoScalingClientConfig] = None,
    auto_scaling_group_name: Optional[XmlStringMaxLen255] = None,
    scheduled_action_names: Optional[ScheduledActionNames] = None,
    start_time: Optional[TimestampType] = None,
    end_time: Optional[TimestampType] = None,
    next_token: Optional[XmlString] = None,
    max_records: Optional[MaxRecords] = None,
) -> ScheduledActionsType

Gets information about the scheduled actions that haven't run or that have not reached their end time.

To describe the scaling activities for scheduled actions that have already run, call the DescribeScalingActivities API.

Parameters:

  • auto_scaling_group_name (Optional[XmlStringMaxLen255], default: None ) –

    The name of the Auto Scaling group.

  • scheduled_action_names (Optional[ScheduledActionNames], default: None ) –

    The names of one or more scheduled actions. If you omit this property, all scheduled actions are described. If you specify an unknown scheduled action, it is ignored with no error.

    Array Members: Maximum number of 50 actions.

  • start_time (Optional[TimestampType], default: None ) –

    The earliest scheduled start time to return. If scheduled action names are provided, this property is ignored.

  • end_time (Optional[TimestampType], default: None ) –

    The latest scheduled start time to return. If scheduled action names are provided, this property is ignored.

  • next_token (Optional[XmlString], default: None ) –

    The token for the next set of items to return. (You received this token from a previous call.)

  • max_records (Optional[MaxRecords], default: None ) –

    The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.

Raises:

  • InvalidNextToken –

    The NextToken value is not valid.

  • ResourceContentionFault –

    You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To describe scheduled actions This example describes the scheduled actions for the specified Auto Scaling group.

>>> client.describe_scheduled_actions(auto_scaling_group_name='my-auto-scaling-group')
Source code in docs_src/capo_auto_scaling/_services/auto_scaling.py
def describe_scheduled_actions(
    self,
    *,
    config_overrides: Optional[AutoScalingClientConfig] = None,
    auto_scaling_group_name: Optional[
        "capo_auto_scaling.types.xml_string_max_len255.XmlStringMaxLen255"
    ] = None,
    scheduled_action_names: Optional[
        "capo_auto_scaling.types.scheduled_action_names.ScheduledActionNames"
    ] = None,
    start_time: Optional[
        "capo_auto_scaling.types.timestamp_type.TimestampType"
    ] = None,
    end_time: Optional[
        "capo_auto_scaling.types.timestamp_type.TimestampType"
    ] = None,
    next_token: Optional["capo_auto_scaling.types.xml_string.XmlString"] = None,
    max_records: Optional["capo_auto_scaling.types.max_records.MaxRecords"] = None,
) -> "capo_auto_scaling.types.scheduled_actions_type.ScheduledActionsType":
    """<p>Gets information about the scheduled actions that haven't run or that have not reached their end time.</p> <p>To describe the scaling activities for scheduled actions that have already run, call the <a href="https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeScalingActivities.html">DescribeScalingActivities</a> API.</p>

    Args:
        auto_scaling_group_name: <p>The name of the Auto Scaling group.</p>
        scheduled_action_names: <p>The names of one or more scheduled actions. If you omit this property, all scheduled actions are described. If you specify an unknown scheduled action, it is ignored with no error.</p> <p>Array Members: Maximum number of 50 actions.</p>
        start_time: <p>The earliest scheduled start time to return. If scheduled action names are provided, this property is ignored.</p>
        end_time: <p>The latest scheduled start time to return. If scheduled action names are provided, this property is ignored.</p>
        next_token: <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
        max_records: <p>The maximum number of items to return with this call. The default value is <code>50</code> and the maximum value is <code>100</code>.</p>

    Raises:
        capo_auto_scaling.errors.invalid_next_token.InvalidNextToken: <p>The <code>NextToken</code> value is not valid.</p>
        capo_auto_scaling.errors.resource_contention_fault.ResourceContentionFault: <p>You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).</p>
        capo_auto_scaling.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe scheduled actions
        This example describes the scheduled actions for the specified Auto Scaling group.

        >>> client.describe_scheduled_actions(auto_scaling_group_name='my-auto-scaling-group')
    """

    def _handler(
        req: "OperationRequest[capo_auto_scaling.types.describe_scheduled_actions_type.DescribeScheduledActionsType]",
    ) -> OperationResponse[
        "capo_auto_scaling.types.scheduled_actions_type.ScheduledActionsType"
    ]:
        import capo_auto_scaling._operations.auto_scaling_2011_01_01.describe_scheduled_actions

        output, http_response = (
            capo_auto_scaling._operations.auto_scaling_2011_01_01.describe_scheduled_actions.describe_scheduled_actions(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeScheduledActions")
    )
    input_: capo_auto_scaling.types.describe_scheduled_actions_type.DescribeScheduledActionsType = {}
    if auto_scaling_group_name is not None:
        input_["auto_scaling_group_name"] = auto_scaling_group_name
    if scheduled_action_names is not None:
        input_["scheduled_action_names"] = scheduled_action_names
    if start_time is not None:
        input_["start_time"] = start_time
    if end_time is not None:
        input_["end_time"] = end_time
    if next_token is not None:
        input_["next_token"] = next_token
    if max_records is not None:
        input_["max_records"] = max_records

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output