Skip to content

send_object_malware_scan

send_object_malware_scan(
    *,
    config_overrides: Optional[GuardDutyClientConfig] = None,
    s3_object: Optional[S3ObjectForSendObjectMalwareScan] = None,
) -> SendObjectMalwareScanResponse

Initiates a malware scan for a specific S3 object. This API allows you to perform on-demand malware scanning of individual objects in S3 buckets that have Malware Protection for S3 enabled.

When you use this API, the Amazon Web Services service terms for GuardDuty Malware Protection apply. For more information, see Amazon Web Services service terms for GuardDuty Malware Protection.

Parameters:

  • s3_object (Optional[S3ObjectForSendObjectMalwareScan], default: None ) –

    The S3 object information for the object you want to scan. The bucket must have a Malware Protection plan configured to use this API.

Raises:

Source code in docs_src/capo_guardduty/_services/guard_duty.py
def send_object_malware_scan(
    self,
    *,
    config_overrides: Optional[GuardDutyClientConfig] = None,
    s3_object: Optional[
        "capo_guardduty.types.s3_object_for_send_object_malware_scan.S3ObjectForSendObjectMalwareScan"
    ] = None,
) -> "capo_guardduty.types.send_object_malware_scan_response.SendObjectMalwareScanResponse":
    """<p>Initiates a malware scan for a specific S3 object. This API allows you to perform on-demand malware scanning of individual objects in S3 buckets that have Malware Protection for S3 enabled.</p> <p>When you use this API, the Amazon Web Services service terms for GuardDuty Malware Protection apply. For more information, see <a href="http://aws.amazon.com/service-terms/#87._Amazon_GuardDuty">Amazon Web Services service terms for GuardDuty Malware Protection</a>.</p>

    Args:
        s3_object: <p>The S3 object information for the object you want to scan. The bucket must have a Malware Protection plan configured to use this API.</p>

    Raises:
        capo_guardduty.errors.access_denied_exception.AccessDeniedException: <p>An access denied exception object.</p>
        capo_guardduty.errors.bad_request_exception.BadRequestException: <p>A bad request exception object.</p>
        capo_guardduty.errors.internal_server_error_exception.InternalServerErrorException: <p>An internal server error exception object.</p>
        capo_guardduty.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_guardduty.types.send_object_malware_scan_request.SendObjectMalwareScanRequest]",
    ) -> OperationResponse[
        "capo_guardduty.types.send_object_malware_scan_response.SendObjectMalwareScanResponse"
    ]:
        import capo_guardduty._operations.guard_duty_api_service.send_object_malware_scan

        output, http_response = (
            capo_guardduty._operations.guard_duty_api_service.send_object_malware_scan.send_object_malware_scan(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SendObjectMalwareScan")
    )
    input_: capo_guardduty.types.send_object_malware_scan_request.SendObjectMalwareScanRequest = {}
    if s3_object is not None:
        input_["s3_object"] = s3_object

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