Skip to content

stop_discovery async

stop_discovery(
    id: StringWithLengthBetween1And1600,
    *,
    config_overrides: Optional[AsyncAPIPortalClientConfig] = None,
) -> None

Stops the running API discovery process.

Parameters:

  • id (StringWithLengthBetween1And1600) –

    Identifier of the discovery configuration to stop. Required. Today this is the configuration ARN, which carries the owner account id so a delegated admin or org admin can stop an org-scoped configuration that lives in a different account.

Raises:

  • AccessDeniedException –

    You do not have permission to perform this operation.

  • BadRequestException –

    The request is not valid. The message identifies the field or value that failed validation.

  • ConflictException –

    The request conflicts with the current state of the resource, for example because another operation on it is still in progress.

  • InternalServerException –

    The service encountered an internal error. Try the request again.

  • ResourceNotFoundException –

    The requested resource does not exist, or you do not have access to it.

  • UnknownServiceError –

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

Source code in docs_src/capo_apiportal/_services/async_api_portal.py
async def stop_discovery(
    self,
    id: "capo_apiportal.types.string_with_length_between1_and1600.StringWithLengthBetween1And1600",
    *,
    config_overrides: Optional[AsyncAPIPortalClientConfig] = None,
) -> None:
    """Stops the running API discovery process.

    Args:
        id: Identifier of the discovery configuration to stop. Required. Today this is the configuration ARN, which carries the owner account id so a delegated admin or org admin can stop an org-scoped configuration that lives in a different account.

    Raises:
        capo_apiportal.errors.access_denied_exception.AccessDeniedException: You do not have permission to perform this operation.
        capo_apiportal.errors.bad_request_exception.BadRequestException: The request is not valid. The message identifies the field or value that failed validation.
        capo_apiportal.errors.conflict_exception.ConflictException: The request conflicts with the current state of the resource, for example because another operation on it is still in progress.
        capo_apiportal.errors.internal_server_exception.InternalServerException: The service encountered an internal error. Try the request again.
        capo_apiportal.errors.resource_not_found_exception.ResourceNotFoundException: The requested resource does not exist, or you do not have access to it.
        capo_apiportal.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_apiportal.types.stop_discovery_request.StopDiscoveryRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_apiportal._operations.api_portal_control_service.stop_discovery

        (
            output,
            http_response,
        ) = await capo_apiportal._operations.api_portal_control_service.stop_discovery.async_stop_discovery(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopDiscovery")
    )
    input_: capo_apiportal.types.stop_discovery_request.StopDiscoveryRequest = {
        "id": id
    }

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