Download data from Cloud Storage

This page shows you how to use the Transfer service for on-premises data API to transfer data from Cloud Storage to a POSIX filesystem.

Before you begin

Create a transfer job using the REST API

To transfer data from Cloud Storage to a POSIX filesystem, do the following:

  1. Create a destination folder on the POSIX filesystem.

  2. Use transferJobs.create to create a transfer job. Provide a posixDataSink and a gcsDataSource.

    When creating concurrent transfer jobs from Cloud Storage to POSIX file systems and POSIX filesystems to Cloud Storage, isolate each transfer job to use different folders on the source and destination. This will prevent errors and race conditions.

    The following is an example of a Cloud Storage to POSIX filesystem request:

    POST https://storagetransfer.googleapis.com/v1/transferJobs
    {
      "name":"transferJobs/OPImyFirstTransfer",
      "description": "My First Transfer",
      "status": "ENABLED",
      "projectId": "project_id",
      "schedule": {
          "scheduleStartDate": {
              "year": 2020,
              "month": 5,
              "day": 2
          },
          "scheduleEndDate": {
              "year": 2020,
              "month": 5,
              "day": 2
          },
      },
      "transferSpec": {
          "gcsDataSource": {
               "bucketName": "destination_bucket"
               "path": "foo/bar/"
          },
          "posixDataSink": {
               "rootDirectory": "/bar/",
    
          },
       }
    }
    

What's next