Skip to content

delete_host_key

delete_host_key(
    server_id: ServerId,
    host_key_id: HostKeyId,
    *,
    config_overrides: Optional[TransferClientConfig] = None,
) -> None

Deletes the host key that's specified in the HostKeyId parameter.

Parameters:

  • server_id (ServerId) –

    The identifier of the server that contains the host key that you are deleting.

  • host_key_id (HostKeyId) –

    The identifier of the host key that you are deleting.

Raises:

Source code in docs_src/capo_transfer/_services/transfer.py
def delete_host_key(
    self,
    server_id: "capo_transfer.types.server_id.ServerId",
    host_key_id: "capo_transfer.types.host_key_id.HostKeyId",
    *,
    config_overrides: Optional[TransferClientConfig] = None,
) -> None:
    """<p>Deletes the host key that's specified in the <code>HostKeyId</code> parameter.</p>

    Args:
        server_id: <p>The identifier of the server that contains the host key that you are deleting.</p>
        host_key_id: <p>The identifier of the host key that you are deleting.</p>

    Raises:
        capo_transfer.errors.internal_service_error.InternalServiceError: <p>This exception is thrown when an error occurs in the Transfer Family service.</p>
        capo_transfer.errors.invalid_request_exception.InvalidRequestException: <p>This exception is thrown when the client submits a malformed request.</p>
        capo_transfer.errors.resource_not_found_exception.ResourceNotFoundException: <p>This exception is thrown when a resource is not found by the Amazon Web ServicesTransfer Family service.</p>
        capo_transfer.errors.service_unavailable_exception.ServiceUnavailableException: <p>The request has failed because the Amazon Web ServicesTransfer Family service is not available.</p>
        capo_transfer.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_transfer.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_transfer.types.delete_host_key_request.DeleteHostKeyRequest]",
    ) -> OperationResponse[None]:
        import capo_transfer._operations.transfer_service.delete_host_key

        output, http_response = (
            capo_transfer._operations.transfer_service.delete_host_key.delete_host_key(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteHostKey")
    )
    input_: capo_transfer.types.delete_host_key_request.DeleteHostKeyRequest = {
        "server_id": server_id,
        "host_key_id": host_key_id,
    }

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