Get Cloud Storage location for DAGs in your environment

Retrieves the Cloud Storage bucket and directory for DAGs in your Composer environment.

Documentation pages that include this code sample

To view the code sample used in context, see the following documentation:

Code sample


import google.auth
import google.auth.transport.requests

# Authenticate with Google Cloud.
# See:
credentials, _ = google.auth.default(
authed_session = google.auth.transport.requests.AuthorizedSession(

# project_id = 'YOUR_PROJECT_ID'
# location = 'us-central1'
# composer_environment = 'YOUR_COMPOSER_ENVIRONMENT_NAME'

environment_url = (
    '/environments/{}').format(project_id, location, composer_environment)
response = authed_session.request('GET', environment_url)
environment_data = response.json()

# Print the bucket name from the response body.

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser