This directory contains samples for Google Cloud Composer. Google Cloud Composer is a managed Apache Airflow service that helps you create, schedule, monitor and manage workflows. Cloud Composer automation helps you create Airflow environments quickly and use Airflow-native tools, such as the powerful Airflow web interface and command line tools, so you can focus on your workflows and not your infrastructure.
This sample requires you to have authentication setup. Refer to the Authentication Getting Started Guide for instructions on setting up credentials for applications.
- Install pip and virtualenv if you do not already have them. You may want to refer to the Python Development Environment Setup Guide for Google Cloud Platform for instructions.
Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.
$ virtualenv env $ source env/bin/activate
Install the dependencies needed to run the samples.
$ pip install -r requirements.txt
To run this sample:
$ python get_dag_prefix.py
usage: get_dag_prefix.py [-h] project_id location composer_environment
Get a Cloud Composer environment via the REST API.
This code sample gets a Cloud Composer environment resource and prints the
Cloud Storage path used to store Apache Airflow DAGs.
positional arguments:
project_id Your Project ID.
location Region of the Cloud Composer environent.
composer_environment Name of the Cloud Composer environent.
optional arguments:
-h, --help show this help message and exit