Skip to content

Commit b624f04

Browse files
feat: [google-cloud-orchestration-airflow] add satisfies_pzi to Environment (googleapis#13077)
- [ ] Regenerate this pull request now. BEGIN_COMMIT_OVERRIDE feat: [google-cloud-orchestration-airflow] add `satisfies_pzi` to `Environment` feat: [google-cloud-orchestration-airflow] A new method `CheckUpgrade` is added to service `Environments` feat: A new field `satisfies_pzi` is added to message `.google.cloud.orchestration.airflow.service.v1.Environment` feat: A new message `CheckUpgradeRequest` is added feat: A new field `airflow_metadata_retention_config` is added to message `.google.cloud.orchestration.airflow.service.v1.DataRetentionConfig` feat: A new message `AirflowMetadataRetentionPolicyConfig` is added docs: A comment for field `maintenance_window` in message `.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig` is changed docs: A comment for message `WorkloadsConfig` is changed docs: A comment for field `storage_mode` in message `.google.cloud.orchestration.airflow.service.v1.TaskLogsRetentionConfig` is changed END_COMMIT_OVERRIDE PiperOrigin-RevId: 673910740 Source-Link: googleapis/googleapis@dcc4f93 Source-Link: https://github.com/googleapis/googleapis-gen/commit/0683c793d18547a017f446533bed4bcd09f565d9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW9yY2hlc3RyYXRpb24tYWlyZmxvdy8uT3dsQm90LnlhbWwiLCJoIjoiMDY4M2M3OTNkMTg1NDdhMDE3ZjQ0NjUzM2JlZDRiY2QwOWY1NjVkOSJ9 BEGIN_NESTED_COMMIT feat: [google-cloud-orchestration-airflow] A new method `CheckUpgrade` is added to service `Environments` feat: A new field `satisfies_pzi` is added to message `.google.cloud.orchestration.airflow.service.v1.Environment` feat: A new message `CheckUpgradeRequest` is added feat: A new field `airflow_metadata_retention_config` is added to message `.google.cloud.orchestration.airflow.service.v1.DataRetentionConfig` feat: A new message `AirflowMetadataRetentionPolicyConfig` is added docs: A comment for field `maintenance_window` in message `.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig` is changed docs: A comment for message `WorkloadsConfig` is changed docs: A comment for field `storage_mode` in message `.google.cloud.orchestration.airflow.service.v1.TaskLogsRetentionConfig` is changed PiperOrigin-RevId: 673766368 Source-Link: googleapis/googleapis@0f44538 Source-Link: https://github.com/googleapis/googleapis-gen/commit/802f7c8cdf887527e99fa9c0d774adfd33a16ffe Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW9yY2hlc3RyYXRpb24tYWlyZmxvdy8uT3dsQm90LnlhbWwiLCJoIjoiODAyZjdjOGNkZjg4NzUyN2U5OWZhOWMwZDc3NGFkZmQzM2ExNmZmZSJ9 END_NESTED_COMMIT --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Victor Chudnovsky <vchudnov@google.com>
1 parent 76267b2 commit b624f04

18 files changed

Lines changed: 1400 additions & 6 deletions

File tree

packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
ImageVersionsClient,
3232
)
3333
from google.cloud.orchestration.airflow.service_v1.types.environments import (
34+
AirflowMetadataRetentionPolicyConfig,
35+
CheckUpgradeRequest,
3436
CheckUpgradeResponse,
3537
CloudDataLineageIntegration,
3638
CreateEnvironmentRequest,
@@ -104,6 +106,8 @@
104106
"EnvironmentsAsyncClient",
105107
"ImageVersionsClient",
106108
"ImageVersionsAsyncClient",
109+
"AirflowMetadataRetentionPolicyConfig",
110+
"CheckUpgradeRequest",
107111
"CheckUpgradeResponse",
108112
"CloudDataLineageIntegration",
109113
"CreateEnvironmentRequest",

packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
from .services.environments import EnvironmentsAsyncClient, EnvironmentsClient
2424
from .services.image_versions import ImageVersionsAsyncClient, ImageVersionsClient
2525
from .types.environments import (
26+
AirflowMetadataRetentionPolicyConfig,
27+
CheckUpgradeRequest,
2628
CheckUpgradeResponse,
2729
CloudDataLineageIntegration,
2830
CreateEnvironmentRequest,
@@ -92,6 +94,8 @@
9294
__all__ = (
9395
"EnvironmentsAsyncClient",
9496
"ImageVersionsAsyncClient",
97+
"AirflowMetadataRetentionPolicyConfig",
98+
"CheckUpgradeRequest",
9599
"CheckUpgradeResponse",
96100
"CloudDataLineageIntegration",
97101
"CreateEnvironmentRequest",

packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1/gapic_metadata.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
"grpc": {
1111
"libraryClient": "EnvironmentsClient",
1212
"rpcs": {
13+
"CheckUpgrade": {
14+
"methods": [
15+
"check_upgrade"
16+
]
17+
},
1318
"CreateEnvironment": {
1419
"methods": [
1520
"create_environment"
@@ -130,6 +135,11 @@
130135
"grpc-async": {
131136
"libraryClient": "EnvironmentsAsyncClient",
132137
"rpcs": {
138+
"CheckUpgrade": {
139+
"methods": [
140+
"check_upgrade"
141+
]
142+
},
133143
"CreateEnvironment": {
134144
"methods": [
135145
"create_environment"
@@ -250,6 +260,11 @@
250260
"rest": {
251261
"libraryClient": "EnvironmentsClient",
252262
"rpcs": {
263+
"CheckUpgrade": {
264+
"methods": [
265+
"check_upgrade"
266+
]
267+
},
253268
"CreateEnvironment": {
254269
"methods": [
255270
"create_environment"

packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1/services/environments/async_client.py

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,6 +1448,109 @@ async def sample_list_workloads():
14481448
# Done; return the response.
14491449
return response
14501450

1451+
async def check_upgrade(
1452+
self,
1453+
request: Optional[Union[environments.CheckUpgradeRequest, dict]] = None,
1454+
*,
1455+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1456+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1457+
metadata: Sequence[Tuple[str, str]] = (),
1458+
) -> operation_async.AsyncOperation:
1459+
r"""Check if an upgrade operation on the environment will
1460+
succeed.
1461+
In case of problems detailed info can be found in the
1462+
returned Operation.
1463+
1464+
.. code-block:: python
1465+
1466+
# This snippet has been automatically generated and should be regarded as a
1467+
# code template only.
1468+
# It will require modifications to work:
1469+
# - It may require correct/in-range values for request initialization.
1470+
# - It may require specifying regional endpoints when creating the service
1471+
# client as shown in:
1472+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
1473+
from google.cloud.orchestration.airflow import service_v1
1474+
1475+
async def sample_check_upgrade():
1476+
# Create a client
1477+
client = service_v1.EnvironmentsAsyncClient()
1478+
1479+
# Initialize request argument(s)
1480+
request = service_v1.CheckUpgradeRequest(
1481+
environment="environment_value",
1482+
)
1483+
1484+
# Make the request
1485+
operation = client.check_upgrade(request=request)
1486+
1487+
print("Waiting for operation to complete...")
1488+
1489+
response = (await operation).result()
1490+
1491+
# Handle the response
1492+
print(response)
1493+
1494+
Args:
1495+
request (Optional[Union[google.cloud.orchestration.airflow.service_v1.types.CheckUpgradeRequest, dict]]):
1496+
The request object. Request to check whether image
1497+
upgrade will succeed.
1498+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
1499+
should be retried.
1500+
timeout (float): The timeout for this request.
1501+
metadata (Sequence[Tuple[str, str]]): Strings which should be
1502+
sent along with the request as metadata.
1503+
1504+
Returns:
1505+
google.api_core.operation_async.AsyncOperation:
1506+
An object representing a long-running operation.
1507+
1508+
The result type for the operation will be :class:`google.cloud.orchestration.airflow.service_v1.types.CheckUpgradeResponse` Message containing information about the result of an upgrade check
1509+
operation.
1510+
1511+
"""
1512+
# Create or coerce a protobuf request object.
1513+
# - Use the request object if provided (there's no risk of modifying the input as
1514+
# there are no flattened fields), or create one.
1515+
if not isinstance(request, environments.CheckUpgradeRequest):
1516+
request = environments.CheckUpgradeRequest(request)
1517+
1518+
# Wrap the RPC method; this adds retry and timeout information,
1519+
# and friendly error handling.
1520+
rpc = self._client._transport._wrapped_methods[
1521+
self._client._transport.check_upgrade
1522+
]
1523+
1524+
# Certain fields should be provided within the metadata header;
1525+
# add these here.
1526+
metadata = tuple(metadata) + (
1527+
gapic_v1.routing_header.to_grpc_metadata(
1528+
(("environment", request.environment),)
1529+
),
1530+
)
1531+
1532+
# Validate the universe domain.
1533+
self._client._validate_universe_domain()
1534+
1535+
# Send the request.
1536+
response = await rpc(
1537+
request,
1538+
retry=retry,
1539+
timeout=timeout,
1540+
metadata=metadata,
1541+
)
1542+
1543+
# Wrap the response in an operation future.
1544+
response = operation_async.from_gapic(
1545+
response,
1546+
self._client._transport.operations_client,
1547+
environments.CheckUpgradeResponse,
1548+
metadata_type=operations.OperationMetadata,
1549+
)
1550+
1551+
# Done; return the response.
1552+
return response
1553+
14511554
async def create_user_workloads_secret(
14521555
self,
14531556
request: Optional[

packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1/services/environments/client.py

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,6 +1884,107 @@ def sample_list_workloads():
18841884
# Done; return the response.
18851885
return response
18861886

1887+
def check_upgrade(
1888+
self,
1889+
request: Optional[Union[environments.CheckUpgradeRequest, dict]] = None,
1890+
*,
1891+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1892+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1893+
metadata: Sequence[Tuple[str, str]] = (),
1894+
) -> operation.Operation:
1895+
r"""Check if an upgrade operation on the environment will
1896+
succeed.
1897+
In case of problems detailed info can be found in the
1898+
returned Operation.
1899+
1900+
.. code-block:: python
1901+
1902+
# This snippet has been automatically generated and should be regarded as a
1903+
# code template only.
1904+
# It will require modifications to work:
1905+
# - It may require correct/in-range values for request initialization.
1906+
# - It may require specifying regional endpoints when creating the service
1907+
# client as shown in:
1908+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
1909+
from google.cloud.orchestration.airflow import service_v1
1910+
1911+
def sample_check_upgrade():
1912+
# Create a client
1913+
client = service_v1.EnvironmentsClient()
1914+
1915+
# Initialize request argument(s)
1916+
request = service_v1.CheckUpgradeRequest(
1917+
environment="environment_value",
1918+
)
1919+
1920+
# Make the request
1921+
operation = client.check_upgrade(request=request)
1922+
1923+
print("Waiting for operation to complete...")
1924+
1925+
response = operation.result()
1926+
1927+
# Handle the response
1928+
print(response)
1929+
1930+
Args:
1931+
request (Union[google.cloud.orchestration.airflow.service_v1.types.CheckUpgradeRequest, dict]):
1932+
The request object. Request to check whether image
1933+
upgrade will succeed.
1934+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1935+
should be retried.
1936+
timeout (float): The timeout for this request.
1937+
metadata (Sequence[Tuple[str, str]]): Strings which should be
1938+
sent along with the request as metadata.
1939+
1940+
Returns:
1941+
google.api_core.operation.Operation:
1942+
An object representing a long-running operation.
1943+
1944+
The result type for the operation will be :class:`google.cloud.orchestration.airflow.service_v1.types.CheckUpgradeResponse` Message containing information about the result of an upgrade check
1945+
operation.
1946+
1947+
"""
1948+
# Create or coerce a protobuf request object.
1949+
# - Use the request object if provided (there's no risk of modifying the input as
1950+
# there are no flattened fields), or create one.
1951+
if not isinstance(request, environments.CheckUpgradeRequest):
1952+
request = environments.CheckUpgradeRequest(request)
1953+
1954+
# Wrap the RPC method; this adds retry and timeout information,
1955+
# and friendly error handling.
1956+
rpc = self._transport._wrapped_methods[self._transport.check_upgrade]
1957+
1958+
# Certain fields should be provided within the metadata header;
1959+
# add these here.
1960+
metadata = tuple(metadata) + (
1961+
gapic_v1.routing_header.to_grpc_metadata(
1962+
(("environment", request.environment),)
1963+
),
1964+
)
1965+
1966+
# Validate the universe domain.
1967+
self._validate_universe_domain()
1968+
1969+
# Send the request.
1970+
response = rpc(
1971+
request,
1972+
retry=retry,
1973+
timeout=timeout,
1974+
metadata=metadata,
1975+
)
1976+
1977+
# Wrap the response in an operation future.
1978+
response = operation.from_gapic(
1979+
response,
1980+
self._transport.operations_client,
1981+
environments.CheckUpgradeResponse,
1982+
metadata_type=operations.OperationMetadata,
1983+
)
1984+
1985+
# Done; return the response.
1986+
return response
1987+
18871988
def create_user_workloads_secret(
18881989
self,
18891990
request: Optional[

packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1/services/environments/transports/base.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ def _prep_wrapped_messages(self, client_info):
177177
default_timeout=None,
178178
client_info=client_info,
179179
),
180+
self.check_upgrade: gapic_v1.method.wrap_method(
181+
self.check_upgrade,
182+
default_timeout=None,
183+
client_info=client_info,
184+
),
180185
self.create_user_workloads_secret: gapic_v1.method.wrap_method(
181186
self.create_user_workloads_secret,
182187
default_timeout=None,
@@ -359,6 +364,15 @@ def list_workloads(
359364
]:
360365
raise NotImplementedError()
361366

367+
@property
368+
def check_upgrade(
369+
self,
370+
) -> Callable[
371+
[environments.CheckUpgradeRequest],
372+
Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
373+
]:
374+
raise NotImplementedError()
375+
362376
@property
363377
def create_user_workloads_secret(
364378
self,

packages/google-cloud-orchestration-airflow/google/cloud/orchestration/airflow/service_v1/services/environments/transports/grpc.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,35 @@ def list_workloads(
502502
)
503503
return self._stubs["list_workloads"]
504504

505+
@property
506+
def check_upgrade(
507+
self,
508+
) -> Callable[[environments.CheckUpgradeRequest], operations_pb2.Operation]:
509+
r"""Return a callable for the check upgrade method over gRPC.
510+
511+
Check if an upgrade operation on the environment will
512+
succeed.
513+
In case of problems detailed info can be found in the
514+
returned Operation.
515+
516+
Returns:
517+
Callable[[~.CheckUpgradeRequest],
518+
~.Operation]:
519+
A function that, when called, will call the underlying RPC
520+
on the server.
521+
"""
522+
# Generate a "stub function" on-the-fly which will actually make
523+
# the request.
524+
# gRPC handles serialization and deserialization, so we just need
525+
# to pass in the functions for each.
526+
if "check_upgrade" not in self._stubs:
527+
self._stubs["check_upgrade"] = self.grpc_channel.unary_unary(
528+
"/google.cloud.orchestration.airflow.service.v1.Environments/CheckUpgrade",
529+
request_serializer=environments.CheckUpgradeRequest.serialize,
530+
response_deserializer=operations_pb2.Operation.FromString,
531+
)
532+
return self._stubs["check_upgrade"]
533+
505534
@property
506535
def create_user_workloads_secret(
507536
self,

0 commit comments

Comments
 (0)