Skip to content

list_autoshifts async

list_autoshifts(
    *,
    config_overrides: Optional[AsyncARCZonalShiftClientConfig] = None,
    next_token: Optional[str] = None,
    status: Optional[AutoshiftExecutionStatus] = None,
    max_results: Optional[MaxResults] = None,
) -> ListAutoshiftsResponse

Returns the autoshifts for an Amazon Web Services Region. By default, the call returns only ACTIVE autoshifts. Optionally, you can specify the status parameter to return COMPLETED autoshifts.

Parameters:

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

    Specifies that you want to receive the next page of results. Valid only if you received a nextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's nextToken response to request the next page of results.

  • status (Optional[AutoshiftExecutionStatus], default: None ) –

    The status of the autoshift.

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

    The number of objects that you want to return with this call.

Raises:

Source code in docs_src/capo_arc_zonal_shift/_services/async_arc_zonal_shift.py
async def list_autoshifts(
    self,
    *,
    config_overrides: Optional[AsyncARCZonalShiftClientConfig] = None,
    next_token: Optional[str] = None,
    status: Optional[
        "capo_arc_zonal_shift.types.autoshift_execution_status.AutoshiftExecutionStatus"
    ] = None,
    max_results: Optional[
        "capo_arc_zonal_shift.types.max_results.MaxResults"
    ] = None,
) -> "capo_arc_zonal_shift.types.list_autoshifts_response.ListAutoshiftsResponse":
    """<p>Returns the autoshifts for an Amazon Web Services Region. By default, the call returns only <code>ACTIVE</code> autoshifts. Optionally, you can specify the <code>status</code> parameter to return <code>COMPLETED</code> autoshifts. </p>

    Args:
        next_token: <p>Specifies that you want to receive the next page of results. Valid only if you received a <code>nextToken</code> response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's <code>nextToken</code> response to request the next page of results.</p>
        status: <p>The status of the autoshift.</p>
        max_results: <p>The number of objects that you want to return with this call.</p>

    Raises:
        capo_arc_zonal_shift.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_arc_zonal_shift.errors.internal_server_exception.InternalServerException: <p>There was an internal server error.</p>
        capo_arc_zonal_shift.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_arc_zonal_shift.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_arc_zonal_shift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_arc_zonal_shift.types.list_autoshifts_request.ListAutoshiftsRequest]",
    ) -> AsyncOperationResponse[
        "capo_arc_zonal_shift.types.list_autoshifts_response.ListAutoshiftsResponse"
    ]:
        import capo_arc_zonal_shift._operations.perc_data_plane.list_autoshifts

        (
            output,
            http_response,
        ) = await capo_arc_zonal_shift._operations.perc_data_plane.list_autoshifts.async_list_autoshifts(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAutoshifts")
    )
    input_: capo_arc_zonal_shift.types.list_autoshifts_request.ListAutoshiftsRequest = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if status is not None:
        input_["status"] = status
    if max_results is not None:
        input_["max_results"] = max_results

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output