Skip to content

describe_scheduled_instance_availability

describe_scheduled_instance_availability(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    filters: Optional[FilterList] = None,
    first_slot_start_time_range: Optional[SlotDateTimeRangeRequest] = None,
    max_results: Optional[DescribeScheduledInstanceAvailabilityMaxResults] = None,
    max_slot_duration_in_hours: Optional[Integer] = None,
    min_slot_duration_in_hours: Optional[Integer] = None,
    next_token: Optional[String] = None,
    recurrence: Optional[ScheduledInstanceRecurrenceRequest] = None,
) -> DescribeScheduledInstanceAvailabilityResult

Finds available schedules that meet the specified criteria.

You can search for an available schedule no more than 3 months in advance. You must meet the minimum required duration of 1,200 hours per year. For example, the minimum daily schedule is 4 hours, the minimum weekly schedule is 24 hours, and the minimum monthly schedule is 100 hours.

After you find a schedule that meets your needs, call PurchaseScheduledInstances to purchase Scheduled Instances with that schedule.

Parameters:

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • filters (Optional[FilterList], default: None ) –

    The filters.

    • availability-zone - The Availability Zone (for example, us-west-2a).

    • instance-type - The instance type (for example, c4.large).

    • platform - The platform (Linux/UNIX or Windows).

  • first_slot_start_time_range (Optional[SlotDateTimeRangeRequest], default: None ) –

    The time period for the first schedule to start.

  • max_results (Optional[DescribeScheduledInstanceAvailabilityMaxResults], default: None ) –

    The maximum number of results to return in a single call. This value can be between 5 and 300. The default value is 300. To retrieve the remaining results, make another call with the returned NextToken value.

  • max_slot_duration_in_hours (Optional[Integer], default: None ) –

    The maximum available duration, in hours. This value must be greater than MinSlotDurationInHours and less than 1,720.

  • min_slot_duration_in_hours (Optional[Integer], default: None ) –

    The minimum available duration, in hours. The minimum required duration is 1,200 hours per year. For example, the minimum daily schedule is 4 hours, the minimum weekly schedule is 24 hours, and the minimum monthly schedule is 100 hours.

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

    The token for the next set of results.

  • recurrence (Optional[ScheduledInstanceRecurrenceRequest], default: None ) –

    The schedule recurrence.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def describe_scheduled_instance_availability(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
    first_slot_start_time_range: Optional[
        "capo_ec2.types.slot_date_time_range_request.SlotDateTimeRangeRequest"
    ] = None,
    max_results: Optional[
        "capo_ec2.types.describe_scheduled_instance_availability_max_results.DescribeScheduledInstanceAvailabilityMaxResults"
    ] = None,
    max_slot_duration_in_hours: Optional["capo_ec2.types.integer.Integer"] = None,
    min_slot_duration_in_hours: Optional["capo_ec2.types.integer.Integer"] = None,
    next_token: Optional["capo_ec2.types.string.String"] = None,
    recurrence: Optional[
        "capo_ec2.types.scheduled_instance_recurrence_request.ScheduledInstanceRecurrenceRequest"
    ] = None,
) -> "capo_ec2.types.describe_scheduled_instance_availability_result.DescribeScheduledInstanceAvailabilityResult":
    """<p>Finds available schedules that meet the specified criteria.</p> <p>You can search for an available schedule no more than 3 months in advance. You must meet the minimum required duration of 1,200 hours per year. For example, the minimum daily schedule is 4 hours, the minimum weekly schedule is 24 hours, and the minimum monthly schedule is 100 hours.</p> <p>After you find a schedule that meets your needs, call <a>PurchaseScheduledInstances</a> to purchase Scheduled Instances with that schedule.</p>

    Args:
        dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        filters: <p>The filters.</p> <ul> <li> <p> <code>availability-zone</code> - The Availability Zone (for example, <code>us-west-2a</code>).</p> </li> <li> <p> <code>instance-type</code> - The instance type (for example, <code>c4.large</code>).</p> </li> <li> <p> <code>platform</code> - The platform (<code>Linux/UNIX</code> or <code>Windows</code>).</p> </li> </ul>
        first_slot_start_time_range: <p>The time period for the first schedule to start.</p>
        max_results: <p>The maximum number of results to return in a single call. This value can be between 5 and 300. The default value is 300. To retrieve the remaining results, make another call with the returned <code>NextToken</code> value.</p>
        max_slot_duration_in_hours: <p>The maximum available duration, in hours. This value must be greater than <code>MinSlotDurationInHours</code> and less than 1,720.</p>
        min_slot_duration_in_hours: <p>The minimum available duration, in hours. The minimum required duration is 1,200 hours per year. For example, the minimum daily schedule is 4 hours, the minimum weekly schedule is 24 hours, and the minimum monthly schedule is 100 hours.</p>
        next_token: <p>The token for the next set of results.</p>
        recurrence: <p>The schedule recurrence.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.describe_scheduled_instance_availability_request.DescribeScheduledInstanceAvailabilityRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.describe_scheduled_instance_availability_result.DescribeScheduledInstanceAvailabilityResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_scheduled_instance_availability

        output, http_response = (
            capo_ec2._operations.amazon_ec2.describe_scheduled_instance_availability.describe_scheduled_instance_availability(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeScheduledInstanceAvailability")
    )
    input_: capo_ec2.types.describe_scheduled_instance_availability_request.DescribeScheduledInstanceAvailabilityRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if filters is not None:
        input_["filters"] = filters
    if first_slot_start_time_range is not None:
        input_["first_slot_start_time_range"] = first_slot_start_time_range
    if max_results is not None:
        input_["max_results"] = max_results
    if max_slot_duration_in_hours is not None:
        input_["max_slot_duration_in_hours"] = max_slot_duration_in_hours
    if min_slot_duration_in_hours is not None:
        input_["min_slot_duration_in_hours"] = min_slot_duration_in_hours
    if next_token is not None:
        input_["next_token"] = next_token
    if recurrence is not None:
        input_["recurrence"] = recurrence

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