Skip to content

Commit

Permalink
Copybara import of the project:
Browse files Browse the repository at this point in the history
--
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
  • Loading branch information
gcf-owl-bot[bot] authored and copybara-github committed Nov 19, 2024
1 parent 74077b5 commit 6a22bef
Show file tree
Hide file tree
Showing 34 changed files with 3,557 additions and 130 deletions.
1 change: 0 additions & 1 deletion .github/release-trigger.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
enabled: true
multiScmName: python-aiplatform
6 changes: 6 additions & 0 deletions google/cloud/aiplatform_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
)
from .types.deployment_resource_pool_service import UpdateDeploymentResourcePoolRequest
from .types.encryption_spec import EncryptionSpec
from .types.endpoint import ClientConnectionConfig
from .types.endpoint import DeployedModel
from .types.endpoint import Endpoint
from .types.endpoint import FasterDeploymentConfig
Expand All @@ -199,6 +200,8 @@
from .types.endpoint_service import UndeployModelOperationMetadata
from .types.endpoint_service import UndeployModelRequest
from .types.endpoint_service import UndeployModelResponse
from .types.endpoint_service import UpdateEndpointLongRunningRequest
from .types.endpoint_service import UpdateEndpointOperationMetadata
from .types.endpoint_service import UpdateEndpointRequest
from .types.entity_type import EntityType
from .types.env_var import EnvVar
Expand Down Expand Up @@ -1028,6 +1031,7 @@
"CheckTrialEarlyStoppingStateResponse",
"Citation",
"CitationMetadata",
"ClientConnectionConfig",
"CoherenceInput",
"CoherenceInstance",
"CoherenceResult",
Expand Down Expand Up @@ -1762,6 +1766,8 @@
"UpdateDatasetVersionRequest",
"UpdateDeploymentResourcePoolOperationMetadata",
"UpdateDeploymentResourcePoolRequest",
"UpdateEndpointLongRunningRequest",
"UpdateEndpointOperationMetadata",
"UpdateEndpointRequest",
"UpdateEntityTypeRequest",
"UpdateExecutionRequest",
Expand Down
15 changes: 15 additions & 0 deletions google/cloud/aiplatform_v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,11 @@
"methods": [
"update_endpoint"
]
},
"UpdateEndpointLongRunning": {
"methods": [
"update_endpoint_long_running"
]
}
}
},
Expand Down Expand Up @@ -507,6 +512,11 @@
"methods": [
"update_endpoint"
]
},
"UpdateEndpointLongRunning": {
"methods": [
"update_endpoint_long_running"
]
}
}
},
Expand Down Expand Up @@ -552,6 +562,11 @@
"methods": [
"update_endpoint"
]
},
"UpdateEndpointLongRunning": {
"methods": [
"update_endpoint_long_running"
]
}
}
}
Expand Down
129 changes: 129 additions & 0 deletions google/cloud/aiplatform_v1/services/endpoint_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,135 @@ async def sample_update_endpoint():
# Done; return the response.
return response

async def update_endpoint_long_running(
self,
request: Optional[
Union[endpoint_service.UpdateEndpointLongRunningRequest, dict]
] = None,
*,
endpoint: Optional[gca_endpoint.Endpoint] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Updates an Endpoint with a long running operation.
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import aiplatform_v1
async def sample_update_endpoint_long_running():
# Create a client
client = aiplatform_v1.EndpointServiceAsyncClient()
# Initialize request argument(s)
endpoint = aiplatform_v1.Endpoint()
endpoint.display_name = "display_name_value"
request = aiplatform_v1.UpdateEndpointLongRunningRequest(
endpoint=endpoint,
)
# Make the request
operation = client.update_endpoint_long_running(request=request)
print("Waiting for operation to complete...")
response = (await operation).result()
# Handle the response
print(response)
Args:
request (Optional[Union[google.cloud.aiplatform_v1.types.UpdateEndpointLongRunningRequest, dict]]):
The request object. Request message for
[EndpointService.UpdateEndpointLongRunning][google.cloud.aiplatform.v1.EndpointService.UpdateEndpointLongRunning].
endpoint (:class:`google.cloud.aiplatform_v1.types.Endpoint`):
Required. The Endpoint which replaces the resource on
the server. Currently we only support updating the
``client_connection_config`` field, all the other
fields' update will be blocked.
This corresponds to the ``endpoint`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
Returns:
google.api_core.operation_async.AsyncOperation:
An object representing a long-running operation.
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
predictions and explanations.
"""
# Create or coerce a protobuf request object.
# - Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([endpoint])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)

# - Use the request object if provided (there's no risk of modifying the input as
# there are no flattened fields), or create one.
if not isinstance(request, endpoint_service.UpdateEndpointLongRunningRequest):
request = endpoint_service.UpdateEndpointLongRunningRequest(request)

# If we have keyword arguments corresponding to fields on the
# request, apply these.
if endpoint is not None:
request.endpoint = endpoint

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._client._transport._wrapped_methods[
self._client._transport.update_endpoint_long_running
]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("endpoint.name", request.endpoint.name),)
),
)

# Validate the universe domain.
self._client._validate_universe_domain()

# Send the request.
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Wrap the response in an operation future.
response = operation_async.from_gapic(
response,
self._client._transport.operations_client,
gca_endpoint.Endpoint,
metadata_type=endpoint_service.UpdateEndpointOperationMetadata,
)

# Done; return the response.
return response

async def delete_endpoint(
self,
request: Optional[Union[endpoint_service.DeleteEndpointRequest, dict]] = None,
Expand Down
128 changes: 128 additions & 0 deletions google/cloud/aiplatform_v1/services/endpoint_service/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,134 @@ def sample_update_endpoint():
# Done; return the response.
return response

def update_endpoint_long_running(
self,
request: Optional[
Union[endpoint_service.UpdateEndpointLongRunningRequest, dict]
] = None,
*,
endpoint: Optional[gca_endpoint.Endpoint] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> gac_operation.Operation:
r"""Updates an Endpoint with a long running operation.
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import aiplatform_v1
def sample_update_endpoint_long_running():
# Create a client
client = aiplatform_v1.EndpointServiceClient()
# Initialize request argument(s)
endpoint = aiplatform_v1.Endpoint()
endpoint.display_name = "display_name_value"
request = aiplatform_v1.UpdateEndpointLongRunningRequest(
endpoint=endpoint,
)
# Make the request
operation = client.update_endpoint_long_running(request=request)
print("Waiting for operation to complete...")
response = operation.result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.aiplatform_v1.types.UpdateEndpointLongRunningRequest, dict]):
The request object. Request message for
[EndpointService.UpdateEndpointLongRunning][google.cloud.aiplatform.v1.EndpointService.UpdateEndpointLongRunning].
endpoint (google.cloud.aiplatform_v1.types.Endpoint):
Required. The Endpoint which replaces the resource on
the server. Currently we only support updating the
``client_connection_config`` field, all the other
fields' update will be blocked.
This corresponds to the ``endpoint`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
Returns:
google.api_core.operation.Operation:
An object representing a long-running operation.
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
predictions and explanations.
"""
# Create or coerce a protobuf request object.
# - Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([endpoint])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)

# - Use the request object if provided (there's no risk of modifying the input as
# there are no flattened fields), or create one.
if not isinstance(request, endpoint_service.UpdateEndpointLongRunningRequest):
request = endpoint_service.UpdateEndpointLongRunningRequest(request)
# If we have keyword arguments corresponding to fields on the
# request, apply these.
if endpoint is not None:
request.endpoint = endpoint

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[
self._transport.update_endpoint_long_running
]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(("endpoint.name", request.endpoint.name),)
),
)

# Validate the universe domain.
self._validate_universe_domain()

# Send the request.
response = rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Wrap the response in an operation future.
response = gac_operation.from_gapic(
response,
self._transport.operations_client,
gca_endpoint.Endpoint,
metadata_type=endpoint_service.UpdateEndpointOperationMetadata,
)

# Done; return the response.
return response

def delete_endpoint(
self,
request: Optional[Union[endpoint_service.DeleteEndpointRequest, dict]] = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=None,
client_info=client_info,
),
self.update_endpoint_long_running: gapic_v1.method.wrap_method(
self.update_endpoint_long_running,
default_timeout=None,
client_info=client_info,
),
self.delete_endpoint: gapic_v1.method.wrap_method(
self.delete_endpoint,
default_timeout=None,
Expand Down Expand Up @@ -281,6 +286,15 @@ def update_endpoint(
]:
raise NotImplementedError()

@property
def update_endpoint_long_running(
self,
) -> Callable[
[endpoint_service.UpdateEndpointLongRunningRequest],
Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
]:
raise NotImplementedError()

@property
def delete_endpoint(
self,
Expand Down
Loading

0 comments on commit 6a22bef

Please sign in to comment.