Get Cloud Storage location for DAGs in your environment

Stay organized with collections Save and categorize content based on your preferences.

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

Explore further

For detailed documentation that includes this code sample, see the following:

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.