How to Check a GCP Storage File for Viruses in Ruby

gem 'cloudmersive-virus-scan-api-client', '~> 2.0.3'
# load the gem
require 'cloudmersive-virus-scan-api-client'
# setup authorization
CloudmersiveVirusScanApiClient.configure do |config|
# Configure API key authorization: Apikey
config.api_key['Apikey'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Apikey'] = 'Bearer'
end
api_instance = CloudmersiveVirusScanApiClient::ScanCloudStorageApi.newbucket_name = 'bucket_name_example' # String | Name of the bucket in Google Cloud Storageobject_name = 'object_name_example' # String | Name of the object or file in Google Cloud Storagejson_credential_file = File.new('/path/to/inputfile') # File | Service Account credential for Google Cloud stored in a JSON file.begin
#Scan an Google Cloud Platform (GCP) Storage file for viruses
result = api_instance.scan_cloud_storage_scan_gcp_storage_file(bucket_name, object_name, json_credential_file)
p result
rescue CloudmersiveVirusScanApiClient::ApiError => e
puts "Exception when calling ScanCloudStorageApi->scan_cloud_storage_scan_gcp_storage_file: #{e}"
end

--

--

--

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

Accessing WSL2 Files from Windows’ File Explorer

Kubernetes network deep dive: Did you make the right choice?

Apache Hadoop Code Quality: Production VS Test

Multi-Threading and MultiProcessing in Python

It’s on! Welcome to PP.io!

Your Guide to Mobile App Development in 2022 and beyond: From the experts at Toobler

Making money from an Android app in 2018 (part 2/3)

Setting up DB link in PostgreSQL

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

Retrieve Docker-deployed files/source code on EC2

ELK Dealing with Mappings | Part4

Overview of API Gateway

A marketer learns symphony – Kubernetes and microservices