Google Cloud Storage

Frends.GoogleCloudStorage.UploadObject / 1.2.0

Summary

Copies local files matching a pattern into a bucket, setting the content type the objects will be served with.

Typical use — publishing files a Process produced, where the content type matters to whatever reads them next

Remarks

UploadObject uses pattern matching for finding files to be uploaded to GoogleCloudStorage.

The search starts from the root directory defined in the input parameters.

  • to match one or more characters in a path segment

** to match any number of path segments, including none

Examples:

**\output*\temp*.txt matches:

test\subfolder\output\2015\temp\file.txt
production\output\2016\temp\example.txt

*\temp matches

prod\test\temp123.xml
test\temp234.xml

subfolder**\temp*.xml matches

subfolder\temp\test.xml
subfolder\foo\bar\is\here\temp\test.xml

Details

Frends version
5.5 and newer
Agent
Crossplatform
Target framework
net6.0

Input parameters.

Name Type Default Example Description
ProjectId String your - project - id your - project - id

Id of the project.

BucketName String your-unique-bucket-name your-unique-bucket-name

Name of the bucket.

Directory String c:\folder\

Directory of the source files.

Pattern String *.txt

File mask for the source files.

ContentType String text/plain

Content to be uploaded to the Google Cloud Storage.

CredentialJson String { "type": "service_account", "project_id": "instant-test-stone-387712", "private_key_id": "17d0g1b5a6e255c0ed67ef7213j8466c336edc55", "private_key": "-----BEGIN PRIVATE KEY-----\jnejbUHBVudhcebuheuwhv....\n-----END PRIVATE KEY-----\n", "client_email": "cloudstorage-testuser@instant-stone-387712.iam.gserviceaccount.com", "client_id": "vjkornijvnerijvneri", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/cloudstorage-testuser%40instant-stone-387712.iam.gserviceaccount.com", "universe_domain": "googleapis.com" }

Google Credentials in JSON format.

CredentialFilePath String C:\folder\google_credentials.json

Full path to the json file which has credentials for Google.

An unhandled error has occurred. Reload 🗙