0
# Image Versions
1
2
Query available Apache Airflow image versions supported by Cloud Composer, including version metadata, compatibility information, and release status.
3
4
## Capabilities
5
6
### Image Version Listing
7
8
Retrieve comprehensive information about available Cloud Composer image versions, including supported Airflow versions, Python versions, and release dates.
9
10
```python { .api }
11
def list_image_versions(
12
self,
13
request: ListImageVersionsRequest,
14
retry: OptionalRetry = gapic_v1.method.DEFAULT,
15
timeout: float = None,
16
metadata: Sequence[Tuple[str, str]] = ()
17
) -> pagers.ListImageVersionsPager:
18
"""
19
List image versions available for Cloud Composer environments.
20
21
Parameters:
22
request (ListImageVersionsRequest): Required. Request object containing parent location and optional filters.
23
retry (OptionalRetry): Retry configuration for the request.
24
timeout (float): Request timeout in seconds.
25
metadata (Sequence[Tuple[str, str]]): Additional gRPC metadata.
26
27
Returns:
28
pagers.ListImageVersionsPager: Paginated list of available image versions.
29
30
Raises:
31
google.api_core.exceptions.GoogleAPICallError: If the request fails.
32
"""
33
```
34
35
### Usage Examples
36
37
```python
38
from google.cloud.orchestration.airflow.service import ImageVersionsClient
39
40
# Initialize client
41
client = ImageVersionsClient()
42
43
# List all image versions for a region
44
project_id = "your-project-id"
45
location = "us-central1"
46
parent = f"projects/{project_id}/locations/{location}"
47
48
request = {"parent": parent}
49
page_result = client.list_image_versions(request=request)
50
51
for image_version in page_result:
52
print(f"Image ID: {image_version.image_version_id}")
53
print(f"Supported Python Versions: {image_version.supported_python_versions}")
54
print(f"Release Date: {image_version.release_date}")
55
print(f"Creation Disabled: {image_version.creation_disabled}")
56
print(f"Upgrade Disabled: {image_version.upgrade_disabled}")
57
print("---")
58
59
# Filter for creation-enabled versions only
60
enabled_versions = [
61
version for version in page_result
62
if not version.creation_disabled
63
]
64
```
65
66
## Request/Response Types
67
68
### Image Version Request Types
69
70
```python { .api }
71
class ListImageVersionsRequest:
72
"""
73
Request to list available image versions.
74
75
Attributes:
76
parent (str): Required. List image versions in region (projects/{project}/locations/{location})
77
page_size (int): Optional. Maximum number of image versions to return per page
78
page_token (str): Optional. Token for pagination from previous request
79
include_past_releases (bool): Optional. Include past releases that are no longer supported
80
"""
81
82
class ListImageVersionsResponse:
83
"""
84
Response containing available image versions.
85
86
Attributes:
87
image_versions (MutableSequence[ImageVersion]): List of available image versions
88
next_page_token (str): Token for retrieving next page of results
89
"""
90
```
91
92
### Image Version Data Types
93
94
```python { .api }
95
class ImageVersion:
96
"""
97
Information about a Cloud Composer image version.
98
99
Attributes:
100
image_version_id (str): Composer image version identifier (e.g., 'composer-2.1.2-airflow-2.5.1')
101
is_default (bool): True if this is the default image version for new environments
102
supported_python_versions (MutableSequence[str]): Supported Python versions (e.g., ['3.8', '3.9', '3.10'])
103
release_date (google.type.date_pb2.Date): Release date of the image version
104
creation_disabled (bool): True if creation of new environments is disabled for this version
105
upgrade_disabled (bool): True if upgrading to this version is disabled
106
"""
107
```
108
109
### Supporting Date Type
110
111
```python { .api }
112
class Date:
113
"""
114
Date representation used in image version release dates.
115
116
Attributes:
117
year (int): Year (e.g., 2023)
118
month (int): Month (1-12)
119
day (int): Day of month (1-31)
120
"""
121
```