Google Cloud Composer (Orchestration Airflow) API client library for managing Apache Airflow environments
—
Query available Apache Airflow image versions supported by Cloud Composer, including version metadata, compatibility information, and release status.
Retrieve comprehensive information about available Cloud Composer image versions, including supported Airflow versions, Python versions, and release dates.
def list_image_versions(
self,
request: ListImageVersionsRequest,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = ()
) -> pagers.ListImageVersionsPager:
"""
List image versions available for Cloud Composer environments.
Parameters:
request (ListImageVersionsRequest): Required. Request object containing parent location and optional filters.
retry (OptionalRetry): Retry configuration for the request.
timeout (float): Request timeout in seconds.
metadata (Sequence[Tuple[str, str]]): Additional gRPC metadata.
Returns:
pagers.ListImageVersionsPager: Paginated list of available image versions.
Raises:
google.api_core.exceptions.GoogleAPICallError: If the request fails.
"""from google.cloud.orchestration.airflow.service import ImageVersionsClient
# Initialize client
client = ImageVersionsClient()
# List all image versions for a region
project_id = "your-project-id"
location = "us-central1"
parent = f"projects/{project_id}/locations/{location}"
request = {"parent": parent}
page_result = client.list_image_versions(request=request)
for image_version in page_result:
print(f"Image ID: {image_version.image_version_id}")
print(f"Supported Python Versions: {image_version.supported_python_versions}")
print(f"Release Date: {image_version.release_date}")
print(f"Creation Disabled: {image_version.creation_disabled}")
print(f"Upgrade Disabled: {image_version.upgrade_disabled}")
print("---")
# Filter for creation-enabled versions only
enabled_versions = [
version for version in page_result
if not version.creation_disabled
]class ListImageVersionsRequest:
"""
Request to list available image versions.
Attributes:
parent (str): Required. List image versions in region (projects/{project}/locations/{location})
page_size (int): Optional. Maximum number of image versions to return per page
page_token (str): Optional. Token for pagination from previous request
include_past_releases (bool): Optional. Include past releases that are no longer supported
"""
class ListImageVersionsResponse:
"""
Response containing available image versions.
Attributes:
image_versions (MutableSequence[ImageVersion]): List of available image versions
next_page_token (str): Token for retrieving next page of results
"""class ImageVersion:
"""
Information about a Cloud Composer image version.
Attributes:
image_version_id (str): Composer image version identifier (e.g., 'composer-2.1.2-airflow-2.5.1')
is_default (bool): True if this is the default image version for new environments
supported_python_versions (MutableSequence[str]): Supported Python versions (e.g., ['3.8', '3.9', '3.10'])
release_date (google.type.date_pb2.Date): Release date of the image version
creation_disabled (bool): True if creation of new environments is disabled for this version
upgrade_disabled (bool): True if upgrading to this version is disabled
"""class Date:
"""
Date representation used in image version release dates.
Attributes:
year (int): Year (e.g., 2023)
month (int): Month (1-12)
day (int): Day of month (1-31)
"""Install with Tessl CLI
npx tessl i tessl/pypi-google-cloud-orchestration-airflow