How to Scan an AWS S3 File for Viruses in Python

pip install cloudmersive-virus-api-client
from __future__ import print_function
import time
import cloudmersive_virus_api_client
from cloudmersive_virus_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: Apikey
configuration = cloudmersive_virus_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'
# create an instance of the API class
api_instance = cloudmersive_virus_api_client.ScanCloudStorageApi(cloudmersive_virus_api_client.ApiClient(configuration))
access_key = 'access_key_example' # str | AWS S3 access key for the S3 bucket; you can get this from My Security Credentials in the AWS console
secret_key = 'secret_key_example' # str | AWS S3 secret key for the S3 bucket; you can get this from My Security Credentials in the AWS console
bucket_region = 'bucket_region_example' # str | Name of the region of the S3 bucket, such as 'US-East-1'
bucket_name = 'bucket_name_example' # str | Name of the S3 bucket
key_name = 'key_name_example' # str | Key name (also called file name) of the file in S3 that you wish to scan for viruses
try:
# Scan an AWS S3 file for viruses
api_response = api_instance.scan_cloud_storage_scan_aws_s3_file(access_key, secret_key, bucket_region, bucket_name, key_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling ScanCloudStorageApi->scan_cloud_storage_scan_aws_s3_file: %s\n" % e)

--

--

--

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

A Sneak Peak at Fall 2021 with Codebase

863. All Nodes Distance K in Binary Tree

Running Chaos Monkey on Spinnaker/Google Compute Engine (GCE)

Linux System and Troubleshooting Tools

AWS Database Services Complete Overview: RDS vs Redshift vs DynamoDB vs SimpleDB

Exposing terra lcd nodes to public

How I Taught Myself to Code - Week 5

Running Machine Learning Predictions inside Docker Containers

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cloudmersive

Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

More from Medium

Build a CI pipeline with GitHub Actions for Python Project

Installing and Setting up MongoDB on Linux

Optimize Docker Size Image with Python Environment

Spice up your terminal with Rich

Eye Feast