Skip to content

Commit 6a22bef

Browse files
gcf-owl-bot[bot]copybara-github
authored andcommitted
Copybara import of the project:
-- 6fa15c7 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: add CustomEnvironmentSpec to NotebookExecutionJob PiperOrigin-RevId: 697694162 Source-Link: googleapis/googleapis@7b30cb5 Source-Link: googleapis/googleapis-gen@7243ba9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzI0M2JhOWJjOTRkNDNhYWMzNGE5ZGYzOTY0ZjhlNTdiNWUzNjNhYyJ9 docs: clarity and typo fixes for documentation docs: fix example rpc naming chore: add objective C packaging option PiperOrigin-RevId: 696556327 Source-Link: googleapis/googleapis@0c5b3eb Source-Link: googleapis/googleapis-gen@288b20d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjg4YjIwZGJmZWE0ODJmMGVlYTlmMGFmNzk1OTJmMGVkYjFmNGQ4ZCJ9 feat: add a `nfs_mounts` to RaySpec in PersistentResource API PiperOrigin-RevId: 696288226 Source-Link: googleapis/googleapis@50d87b4 Source-Link: googleapis/googleapis-gen@f635540 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjYzNTU0MDQ2MDBiZmU3MWYwZjgzNGZhZWU0MzlkNmRhMTYyMjU1NCJ9 -- 797f01d by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md -- 6c0da58 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: add CustomEnvironmentSpec to NotebookExecutionJob PiperOrigin-RevId: 697698546 Source-Link: googleapis/googleapis@caa9439 Source-Link: googleapis/googleapis-gen@d16c0f0 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDE2YzBmMDI3MTk5YWFmOGIxNTczN2QwYzgzODM4MTM2MTk4M2M2ZiJ9 -- 5798569 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: Trajectory eval metrics added to evaluation service proto docs: Fixed typo for field `use_strict_string_match` in message `.google.cloud.aiplatform.v1beta1.ToolParameterKVMatchSpec` PiperOrigin-RevId: 697705080 Source-Link: googleapis/googleapis@231f232 Source-Link: googleapis/googleapis-gen@1c17fe0 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMWMxN2ZlMDBmZGZjMGEwOTczOGE0M2QyN2IzZjJiNzNlNDVmNzQ3NyJ9 -- 3cb050e by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: add a v1 UpdateEndpointLongRunning API PiperOrigin-RevId: 697715678 Source-Link: googleapis/googleapis@4ab02f3 Source-Link: googleapis/googleapis-gen@829605e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODI5NjA1ZTE2ZGVlMWQ4ZDc5NWQ0ZGVhNDViNGMxMmQ4ZDk4M2ExYyJ9 -- 6c2f480 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md COPYBARA_INTEGRATE_REVIEW=#4652 from googleapis:owl-bot-copy 5d46d0d PiperOrigin-RevId: 697806930
1 parent 74077b5 commit 6a22bef

34 files changed

+3557
-130
lines changed

.github/release-trigger.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
enabled: true
2-
multiScmName: python-aiplatform

google/cloud/aiplatform_v1/__init__.py

+6
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@
179179
)
180180
from .types.deployment_resource_pool_service import UpdateDeploymentResourcePoolRequest
181181
from .types.encryption_spec import EncryptionSpec
182+
from .types.endpoint import ClientConnectionConfig
182183
from .types.endpoint import DeployedModel
183184
from .types.endpoint import Endpoint
184185
from .types.endpoint import FasterDeploymentConfig
@@ -199,6 +200,8 @@
199200
from .types.endpoint_service import UndeployModelOperationMetadata
200201
from .types.endpoint_service import UndeployModelRequest
201202
from .types.endpoint_service import UndeployModelResponse
203+
from .types.endpoint_service import UpdateEndpointLongRunningRequest
204+
from .types.endpoint_service import UpdateEndpointOperationMetadata
202205
from .types.endpoint_service import UpdateEndpointRequest
203206
from .types.entity_type import EntityType
204207
from .types.env_var import EnvVar
@@ -1028,6 +1031,7 @@
10281031
"CheckTrialEarlyStoppingStateResponse",
10291032
"Citation",
10301033
"CitationMetadata",
1034+
"ClientConnectionConfig",
10311035
"CoherenceInput",
10321036
"CoherenceInstance",
10331037
"CoherenceResult",
@@ -1762,6 +1766,8 @@
17621766
"UpdateDatasetVersionRequest",
17631767
"UpdateDeploymentResourcePoolOperationMetadata",
17641768
"UpdateDeploymentResourcePoolRequest",
1769+
"UpdateEndpointLongRunningRequest",
1770+
"UpdateEndpointOperationMetadata",
17651771
"UpdateEndpointRequest",
17661772
"UpdateEntityTypeRequest",
17671773
"UpdateExecutionRequest",

google/cloud/aiplatform_v1/gapic_metadata.json

+15
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,11 @@
462462
"methods": [
463463
"update_endpoint"
464464
]
465+
},
466+
"UpdateEndpointLongRunning": {
467+
"methods": [
468+
"update_endpoint_long_running"
469+
]
465470
}
466471
}
467472
},
@@ -507,6 +512,11 @@
507512
"methods": [
508513
"update_endpoint"
509514
]
515+
},
516+
"UpdateEndpointLongRunning": {
517+
"methods": [
518+
"update_endpoint_long_running"
519+
]
510520
}
511521
}
512522
},
@@ -552,6 +562,11 @@
552562
"methods": [
553563
"update_endpoint"
554564
]
565+
},
566+
"UpdateEndpointLongRunning": {
567+
"methods": [
568+
"update_endpoint_long_running"
569+
]
555570
}
556571
}
557572
}

google/cloud/aiplatform_v1/services/endpoint_service/async_client.py

+129
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,135 @@ async def sample_update_endpoint():
798798
# Done; return the response.
799799
return response
800800

801+
async def update_endpoint_long_running(
802+
self,
803+
request: Optional[
804+
Union[endpoint_service.UpdateEndpointLongRunningRequest, dict]
805+
] = None,
806+
*,
807+
endpoint: Optional[gca_endpoint.Endpoint] = None,
808+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
809+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
810+
metadata: Sequence[Tuple[str, str]] = (),
811+
) -> operation_async.AsyncOperation:
812+
r"""Updates an Endpoint with a long running operation.
813+
814+
.. code-block:: python
815+
816+
# This snippet has been automatically generated and should be regarded as a
817+
# code template only.
818+
# It will require modifications to work:
819+
# - It may require correct/in-range values for request initialization.
820+
# - It may require specifying regional endpoints when creating the service
821+
# client as shown in:
822+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
823+
from google.cloud import aiplatform_v1
824+
825+
async def sample_update_endpoint_long_running():
826+
# Create a client
827+
client = aiplatform_v1.EndpointServiceAsyncClient()
828+
829+
# Initialize request argument(s)
830+
endpoint = aiplatform_v1.Endpoint()
831+
endpoint.display_name = "display_name_value"
832+
833+
request = aiplatform_v1.UpdateEndpointLongRunningRequest(
834+
endpoint=endpoint,
835+
)
836+
837+
# Make the request
838+
operation = client.update_endpoint_long_running(request=request)
839+
840+
print("Waiting for operation to complete...")
841+
842+
response = (await operation).result()
843+
844+
# Handle the response
845+
print(response)
846+
847+
Args:
848+
request (Optional[Union[google.cloud.aiplatform_v1.types.UpdateEndpointLongRunningRequest, dict]]):
849+
The request object. Request message for
850+
[EndpointService.UpdateEndpointLongRunning][google.cloud.aiplatform.v1.EndpointService.UpdateEndpointLongRunning].
851+
endpoint (:class:`google.cloud.aiplatform_v1.types.Endpoint`):
852+
Required. The Endpoint which replaces the resource on
853+
the server. Currently we only support updating the
854+
``client_connection_config`` field, all the other
855+
fields' update will be blocked.
856+
857+
This corresponds to the ``endpoint`` field
858+
on the ``request`` instance; if ``request`` is provided, this
859+
should not be set.
860+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
861+
should be retried.
862+
timeout (float): The timeout for this request.
863+
metadata (Sequence[Tuple[str, str]]): Strings which should be
864+
sent along with the request as metadata.
865+
866+
Returns:
867+
google.api_core.operation_async.AsyncOperation:
868+
An object representing a long-running operation.
869+
870+
The result type for the operation will be :class:`google.cloud.aiplatform_v1.types.Endpoint` Models are deployed into it, and afterwards Endpoint is called to obtain
871+
predictions and explanations.
872+
873+
"""
874+
# Create or coerce a protobuf request object.
875+
# - Quick check: If we got a request object, we should *not* have
876+
# gotten any keyword arguments that map to the request.
877+
has_flattened_params = any([endpoint])
878+
if request is not None and has_flattened_params:
879+
raise ValueError(
880+
"If the `request` argument is set, then none of "
881+
"the individual field arguments should be set."
882+
)
883+
884+
# - Use the request object if provided (there's no risk of modifying the input as
885+
# there are no flattened fields), or create one.
886+
if not isinstance(request, endpoint_service.UpdateEndpointLongRunningRequest):
887+
request = endpoint_service.UpdateEndpointLongRunningRequest(request)
888+
889+
# If we have keyword arguments corresponding to fields on the
890+
# request, apply these.
891+
if endpoint is not None:
892+
request.endpoint = endpoint
893+
894+
# Wrap the RPC method; this adds retry and timeout information,
895+
# and friendly error handling.
896+
rpc = self._client._transport._wrapped_methods[
897+
self._client._transport.update_endpoint_long_running
898+
]
899+
900+
# Certain fields should be provided within the metadata header;
901+
# add these here.
902+
metadata = tuple(metadata) + (
903+
gapic_v1.routing_header.to_grpc_metadata(
904+
(("endpoint.name", request.endpoint.name),)
905+
),
906+
)
907+
908+
# Validate the universe domain.
909+
self._client._validate_universe_domain()
910+
911+
# Send the request.
912+
response = await rpc(
913+
request,
914+
retry=retry,
915+
timeout=timeout,
916+
metadata=metadata,
917+
)
918+
919+
# Wrap the response in an operation future.
920+
response = operation_async.from_gapic(
921+
response,
922+
self._client._transport.operations_client,
923+
gca_endpoint.Endpoint,
924+
metadata_type=endpoint_service.UpdateEndpointOperationMetadata,
925+
)
926+
927+
# Done; return the response.
928+
return response
929+
801930
async def delete_endpoint(
802931
self,
803932
request: Optional[Union[endpoint_service.DeleteEndpointRequest, dict]] = None,

google/cloud/aiplatform_v1/services/endpoint_service/client.py

+128
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,134 @@ def sample_update_endpoint():
13021302
# Done; return the response.
13031303
return response
13041304

1305+
def update_endpoint_long_running(
1306+
self,
1307+
request: Optional[
1308+
Union[endpoint_service.UpdateEndpointLongRunningRequest, dict]
1309+
] = None,
1310+
*,
1311+
endpoint: Optional[gca_endpoint.Endpoint] = None,
1312+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1313+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1314+
metadata: Sequence[Tuple[str, str]] = (),
1315+
) -> gac_operation.Operation:
1316+
r"""Updates an Endpoint with a long running operation.
1317+
1318+
.. code-block:: python
1319+
1320+
# This snippet has been automatically generated and should be regarded as a
1321+
# code template only.
1322+
# It will require modifications to work:
1323+
# - It may require correct/in-range values for request initialization.
1324+
# - It may require specifying regional endpoints when creating the service
1325+
# client as shown in:
1326+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
1327+
from google.cloud import aiplatform_v1
1328+
1329+
def sample_update_endpoint_long_running():
1330+
# Create a client
1331+
client = aiplatform_v1.EndpointServiceClient()
1332+
1333+
# Initialize request argument(s)
1334+
endpoint = aiplatform_v1.Endpoint()
1335+
endpoint.display_name = "display_name_value"
1336+
1337+
request = aiplatform_v1.UpdateEndpointLongRunningRequest(
1338+
endpoint=endpoint,
1339+
)
1340+
1341+
# Make the request
1342+
operation = client.update_endpoint_long_running(request=request)
1343+
1344+
print("Waiting for operation to complete...")
1345+
1346+
response = operation.result()
1347+
1348+
# Handle the response
1349+
print(response)
1350+
1351+
Args:
1352+
request (Union[google.cloud.aiplatform_v1.types.UpdateEndpointLongRunningRequest, dict]):
1353+
The request object. Request message for
1354+
[EndpointService.UpdateEndpointLongRunning][google.cloud.aiplatform.v1.EndpointService.UpdateEndpointLongRunning].
1355+
endpoint (google.cloud.aiplatform_v1.types.Endpoint):
1356+
Required. The Endpoint which replaces the resource on
1357+
the server. Currently we only support updating the
1358+
``client_connection_config`` field, all the other
1359+
fields' update will be blocked.
1360+
1361+
This corresponds to the ``endpoint`` field
1362+
on the ``request`` instance; if ``request`` is provided, this
1363+
should not be set.
1364+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1365+
should be retried.
1366+
timeout (float): The timeout for this request.
1367+
metadata (Sequence[Tuple[str, str]]): Strings which should be
1368+
sent along with the request as metadata.
1369+
1370+
Returns:
1371+
google.api_core.operation.Operation:
1372+
An object representing a long-running operation.
1373+
1374+
The result type for the operation will be :class:`google.cloud.aiplatform_v1.types.Endpoint` Models are deployed into it, and afterwards Endpoint is called to obtain
1375+
predictions and explanations.
1376+
1377+
"""
1378+
# Create or coerce a protobuf request object.
1379+
# - Quick check: If we got a request object, we should *not* have
1380+
# gotten any keyword arguments that map to the request.
1381+
has_flattened_params = any([endpoint])
1382+
if request is not None and has_flattened_params:
1383+
raise ValueError(
1384+
"If the `request` argument is set, then none of "
1385+
"the individual field arguments should be set."
1386+
)
1387+
1388+
# - Use the request object if provided (there's no risk of modifying the input as
1389+
# there are no flattened fields), or create one.
1390+
if not isinstance(request, endpoint_service.UpdateEndpointLongRunningRequest):
1391+
request = endpoint_service.UpdateEndpointLongRunningRequest(request)
1392+
# If we have keyword arguments corresponding to fields on the
1393+
# request, apply these.
1394+
if endpoint is not None:
1395+
request.endpoint = endpoint
1396+
1397+
# Wrap the RPC method; this adds retry and timeout information,
1398+
# and friendly error handling.
1399+
rpc = self._transport._wrapped_methods[
1400+
self._transport.update_endpoint_long_running
1401+
]
1402+
1403+
# Certain fields should be provided within the metadata header;
1404+
# add these here.
1405+
metadata = tuple(metadata) + (
1406+
gapic_v1.routing_header.to_grpc_metadata(
1407+
(("endpoint.name", request.endpoint.name),)
1408+
),
1409+
)
1410+
1411+
# Validate the universe domain.
1412+
self._validate_universe_domain()
1413+
1414+
# Send the request.
1415+
response = rpc(
1416+
request,
1417+
retry=retry,
1418+
timeout=timeout,
1419+
metadata=metadata,
1420+
)
1421+
1422+
# Wrap the response in an operation future.
1423+
response = gac_operation.from_gapic(
1424+
response,
1425+
self._transport.operations_client,
1426+
gca_endpoint.Endpoint,
1427+
metadata_type=endpoint_service.UpdateEndpointOperationMetadata,
1428+
)
1429+
1430+
# Done; return the response.
1431+
return response
1432+
13051433
def delete_endpoint(
13061434
self,
13071435
request: Optional[Union[endpoint_service.DeleteEndpointRequest, dict]] = None,

google/cloud/aiplatform_v1/services/endpoint_service/transports/base.py

+14
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ def _prep_wrapped_messages(self, client_info):
156156
default_timeout=None,
157157
client_info=client_info,
158158
),
159+
self.update_endpoint_long_running: gapic_v1.method.wrap_method(
160+
self.update_endpoint_long_running,
161+
default_timeout=None,
162+
client_info=client_info,
163+
),
159164
self.delete_endpoint: gapic_v1.method.wrap_method(
160165
self.delete_endpoint,
161166
default_timeout=None,
@@ -281,6 +286,15 @@ def update_endpoint(
281286
]:
282287
raise NotImplementedError()
283288

289+
@property
290+
def update_endpoint_long_running(
291+
self,
292+
) -> Callable[
293+
[endpoint_service.UpdateEndpointLongRunningRequest],
294+
Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
295+
]:
296+
raise NotImplementedError()
297+
284298
@property
285299
def delete_endpoint(
286300
self,

0 commit comments

Comments
 (0)