GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Copybara import of the project: · Russ76/python-aiplatform@921bfc0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • docs/aiplatform_v1beta1
    • model_garden_service.rst
    • services.rst
  • google/cloud
    • aiplatform_v1beta1
      • __init__.py
      • gapic_metadata.json
      • services
        • endpoint_service
          • async_client.py
          • client.py
          • transports
            • base.py
            • grpc.py
            • grpc_asyncio.py
        • featurestore_service
          • async_client.py
          • client.py
        • job_service
          • async_client.py
          • client.py
        • model_garden_service
          • __init__.py
          • async_client.py
          • client.py
          • transports
            • __init__.py
            • base.py
            • grpc.py
            • grpc_asyncio.py
        • schedule_service
          • async_client.py
          • client.py
      • types
        • __init__.py
        • accelerator_type.py
        • batch_prediction_job.py
        • custom_job.py
        • dataset.py
        • endpoint.py
        • endpoint_service.py
        • evaluated_annotation.py
        • explanation.py
        • feature.py
        • featurestore_online_service.py
        • featurestore_service.py
        • index_endpoint.py
        • match_service.py
        • model.py
        • model_garden_service.py
        • model_service.py
        • pipeline_job.py
        • publisher_model.py
        • schedule.py
        • tensorboard_experiment.py
        • tensorboard_service.py
    • aiplatform_v1
      • __init__.py
      • gapic_metadata.json
      • services
        • endpoint_service
          • async_client.py
          • client.py
          • transports
            • base.py
            • grpc.py
            • grpc_asyncio.py
        • featurestore_service
          • async_client.py
          • client.py
        • job_service
          • async_client.py
          • client.py
        • migration_service
          • client.py
      • types
        • __init__.py
        • accelerator_type.py
        • batch_prediction_job.py
        • custom_job.py
        • dataset.py
        • endpoint.py
        • endpoint_service.py
        • entity_type.py
        • evaluated_annotation.py
        • explanation.py
        • feature.py
        • featurestore.py
        • featurestore_online_service.py
        • featurestore_service.py
        • index_endpoint.py
        • model.py
        • model_service.py
        • pipeline_job.py
        • tensorboard_experiment.py
        • tensorboard_service.py
  • noxfile.py
  • samples/generated_samples
    • aiplatform_v1_generated_endpoint_service_mutate_deployed_model_async.py
    • aiplatform_v1_generated_endpoint_service_mutate_deployed_model_sync.py
    • aiplatform_v1beta1_generated_endpoint_service_mutate_deployed_model_async.py
    • aiplatform_v1beta1_generated_endpoint_service_mutate_deployed_model_sync.py
    • aiplatform_v1beta1_generated_model_garden_service_get_publisher_model_async.py
    • aiplatform_v1beta1_generated_model_garden_service_get_publisher_model_sync.py
    • snippet_metadata_google.cloud.aiplatform.v1.json
    • snippet_metadata_google.cloud.aiplatform.v1beta1.json
  • tests/unit/gapic
    • aiplatform_v1beta1
      • test_endpoint_service.py
      • test_job_service.py
      • test_model_garden_service.py
      • test_schedule_service.py
    • aiplatform_v1
      • test_endpoint_service.py
      • test_featurestore_service.py
      • test_job_service.py
      • test_migration_service.py

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎docs/aiplatform_v1beta1/model_garden_service.rst‎

Copy file name to clipboard
+6Lines changed: 6 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ModelGardenService
2+
------------------------------------
3+
4+
.. automodule:: google.cloud.aiplatform_v1beta1.services.model_garden_service
5+
:members:
6+
:inherited-members:
Collapse file

‎docs/aiplatform_v1beta1/services.rst‎

Copy file name to clipboardExpand all lines: docs/aiplatform_v1beta1/services.rst
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Services for Google Cloud Aiplatform v1beta1 API
1414
match_service
1515
metadata_service
1616
migration_service
17+
model_garden_service
1718
model_service
1819
pipeline_service
1920
prediction_service
Collapse file

‎google/cloud/aiplatform_v1/__init__.py‎

Copy file name to clipboardExpand all lines: google/cloud/aiplatform_v1/__init__.py
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@
114114
from .types.endpoint_service import GetEndpointRequest
115115
from .types.endpoint_service import ListEndpointsRequest
116116
from .types.endpoint_service import ListEndpointsResponse
117+
from .types.endpoint_service import MutateDeployedModelOperationMetadata
118+
from .types.endpoint_service import MutateDeployedModelRequest
119+
from .types.endpoint_service import MutateDeployedModelResponse
117120
from .types.endpoint_service import UndeployModelOperationMetadata
118121
from .types.endpoint_service import UndeployModelRequest
119122
from .types.endpoint_service import UndeployModelResponse
@@ -925,6 +928,9 @@
925928
"MutateDeployedIndexOperationMetadata",
926929
"MutateDeployedIndexRequest",
927930
"MutateDeployedIndexResponse",
931+
"MutateDeployedModelOperationMetadata",
932+
"MutateDeployedModelRequest",
933+
"MutateDeployedModelResponse",
928934
"NasJob",
929935
"NasJobOutput",
930936
"NasJobSpec",
Collapse file

‎google/cloud/aiplatform_v1/gapic_metadata.json‎

Copy file name to clipboardExpand all lines: google/cloud/aiplatform_v1/gapic_metadata.json
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@
169169
"list_endpoints"
170170
]
171171
},
172+
"MutateDeployedModel": {
173+
"methods": [
174+
"mutate_deployed_model"
175+
]
176+
},
172177
"UndeployModel": {
173178
"methods": [
174179
"undeploy_model"
@@ -209,6 +214,11 @@
209214
"list_endpoints"
210215
]
211216
},
217+
"MutateDeployedModel": {
218+
"methods": [
219+
"mutate_deployed_model"
220+
]
221+
},
212222
"UndeployModel": {
213223
"methods": [
214224
"undeploy_model"
Collapse file

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

Copy file name to clipboardExpand all lines: google/cloud/aiplatform_v1/services/endpoint_service/async_client.py
+159Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,165 @@ async def sample_undeploy_model():
11621162
# Done; return the response.
11631163
return response
11641164

1165+
async def mutate_deployed_model(
1166+
self,
1167+
request: Optional[
1168+
Union[endpoint_service.MutateDeployedModelRequest, dict]
1169+
] = None,
1170+
*,
1171+
endpoint: Optional[str] = None,
1172+
deployed_model: Optional[gca_endpoint.DeployedModel] = None,
1173+
update_mask: Optional[field_mask_pb2.FieldMask] = None,
1174+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1175+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1176+
metadata: Sequence[Tuple[str, str]] = (),
1177+
) -> operation_async.AsyncOperation:
1178+
r"""Updates an existing deployed model. Updatable fields include
1179+
``min_replica_count``, ``max_replica_count``,
1180+
``autoscaling_metric_specs``, ``disable_container_logging`` (v1
1181+
only), and ``enable_container_logging`` (v1beta1 only).
1182+
1183+
.. code-block:: python
1184+
1185+
# This snippet has been automatically generated and should be regarded as a
1186+
# code template only.
1187+
# It will require modifications to work:
1188+
# - It may require correct/in-range values for request initialization.
1189+
# - It may require specifying regional endpoints when creating the service
1190+
# client as shown in:
1191+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
1192+
from google.cloud import aiplatform_v1
1193+
1194+
async def sample_mutate_deployed_model():
1195+
# Create a client
1196+
client = aiplatform_v1.EndpointServiceAsyncClient()
1197+
1198+
# Initialize request argument(s)
1199+
deployed_model = aiplatform_v1.DeployedModel()
1200+
deployed_model.dedicated_resources.min_replica_count = 1803
1201+
deployed_model.model = "model_value"
1202+
1203+
request = aiplatform_v1.MutateDeployedModelRequest(
1204+
endpoint="endpoint_value",
1205+
deployed_model=deployed_model,
1206+
)
1207+
1208+
# Make the request
1209+
operation = client.mutate_deployed_model(request=request)
1210+
1211+
print("Waiting for operation to complete...")
1212+
1213+
response = (await operation).result()
1214+
1215+
# Handle the response
1216+
print(response)
1217+
1218+
Args:
1219+
request (Optional[Union[google.cloud.aiplatform_v1.types.MutateDeployedModelRequest, dict]]):
1220+
The request object. Request message for
1221+
[EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1.EndpointService.MutateDeployedModel].
1222+
endpoint (:class:`str`):
1223+
Required. The name of the Endpoint resource into which
1224+
to mutate a DeployedModel. Format:
1225+
``projects/{project}/locations/{location}/endpoints/{endpoint}``
1226+
1227+
This corresponds to the ``endpoint`` field
1228+
on the ``request`` instance; if ``request`` is provided, this
1229+
should not be set.
1230+
deployed_model (:class:`google.cloud.aiplatform_v1.types.DeployedModel`):
1231+
Required. The DeployedModel to be mutated within the
1232+
Endpoint. Only the following fields can be mutated:
1233+
1234+
- ``min_replica_count`` in either
1235+
[DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources]
1236+
or
1237+
[AutomaticResources][google.cloud.aiplatform.v1.AutomaticResources]
1238+
- ``max_replica_count`` in either
1239+
[DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources]
1240+
or
1241+
[AutomaticResources][google.cloud.aiplatform.v1.AutomaticResources]
1242+
- [autoscaling_metric_specs][google.cloud.aiplatform.v1.DedicatedResources.autoscaling_metric_specs]
1243+
- ``disable_container_logging`` (v1 only)
1244+
- ``enable_container_logging`` (v1beta1 only)
1245+
1246+
This corresponds to the ``deployed_model`` field
1247+
on the ``request`` instance; if ``request`` is provided, this
1248+
should not be set.
1249+
update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
1250+
Required. The update mask applies to the resource. See
1251+
[google.protobuf.FieldMask][google.protobuf.FieldMask].
1252+
1253+
This corresponds to the ``update_mask`` field
1254+
on the ``request`` instance; if ``request`` is provided, this
1255+
should not be set.
1256+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1257+
should be retried.
1258+
timeout (float): The timeout for this request.
1259+
metadata (Sequence[Tuple[str, str]]): Strings which should be
1260+
sent along with the request as metadata.
1261+
1262+
Returns:
1263+
google.api_core.operation_async.AsyncOperation:
1264+
An object representing a long-running operation.
1265+
1266+
The result type for the operation will be :class:`google.cloud.aiplatform_v1.types.MutateDeployedModelResponse` Response message for
1267+
[EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1.EndpointService.MutateDeployedModel].
1268+
1269+
"""
1270+
# Create or coerce a protobuf request object.
1271+
# Quick check: If we got a request object, we should *not* have
1272+
# gotten any keyword arguments that map to the request.
1273+
has_flattened_params = any([endpoint, deployed_model, update_mask])
1274+
if request is not None and has_flattened_params:
1275+
raise ValueError(
1276+
"If the `request` argument is set, then none of "
1277+
"the individual field arguments should be set."
1278+
)
1279+
1280+
request = endpoint_service.MutateDeployedModelRequest(request)
1281+
1282+
# If we have keyword arguments corresponding to fields on the
1283+
# request, apply these.
1284+
if endpoint is not None:
1285+
request.endpoint = endpoint
1286+
if deployed_model is not None:
1287+
request.deployed_model = deployed_model
1288+
if update_mask is not None:
1289+
request.update_mask = update_mask
1290+
1291+
# Wrap the RPC method; this adds retry and timeout information,
1292+
# and friendly error handling.
1293+
rpc = gapic_v1.method_async.wrap_method(
1294+
self._client._transport.mutate_deployed_model,
1295+
default_timeout=None,
1296+
client_info=DEFAULT_CLIENT_INFO,
1297+
)
1298+
1299+
# Certain fields should be provided within the metadata header;
1300+
# add these here.
1301+
metadata = tuple(metadata) + (
1302+
gapic_v1.routing_header.to_grpc_metadata((("endpoint", request.endpoint),)),
1303+
)
1304+
1305+
# Send the request.
1306+
response = await rpc(
1307+
request,
1308+
retry=retry,
1309+
timeout=timeout,
1310+
metadata=metadata,
1311+
)
1312+
1313+
# Wrap the response in an operation future.
1314+
response = operation_async.from_gapic(
1315+
response,
1316+
self._client._transport.operations_client,
1317+
endpoint_service.MutateDeployedModelResponse,
1318+
metadata_type=endpoint_service.MutateDeployedModelOperationMetadata,
1319+
)
1320+
1321+
# Done; return the response.
1322+
return response
1323+
11651324
async def list_operations(
11661325
self,
11671326
request: Optional[operations_pb2.ListOperationsRequest] = None,
Collapse file

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

Copy file name to clipboardExpand all lines: google/cloud/aiplatform_v1/services/endpoint_service/client.py
+159Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,6 +1440,165 @@ def sample_undeploy_model():
14401440
# Done; return the response.
14411441
return response
14421442

1443+
def mutate_deployed_model(
1444+
self,
1445+
request: Optional[
1446+
Union[endpoint_service.MutateDeployedModelRequest, dict]
1447+
] = None,
1448+
*,
1449+
endpoint: Optional[str] = None,
1450+
deployed_model: Optional[gca_endpoint.DeployedModel] = None,
1451+
update_mask: Optional[field_mask_pb2.FieldMask] = None,
1452+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1453+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1454+
metadata: Sequence[Tuple[str, str]] = (),
1455+
) -> gac_operation.Operation:
1456+
r"""Updates an existing deployed model. Updatable fields include
1457+
``min_replica_count``, ``max_replica_count``,
1458+
``autoscaling_metric_specs``, ``disable_container_logging`` (v1
1459+
only), and ``enable_container_logging`` (v1beta1 only).
1460+
1461+
.. code-block:: python
1462+
1463+
# This snippet has been automatically generated and should be regarded as a
1464+
# code template only.
1465+
# It will require modifications to work:
1466+
# - It may require correct/in-range values for request initialization.
1467+
# - It may require specifying regional endpoints when creating the service
1468+
# client as shown in:
1469+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
1470+
from google.cloud import aiplatform_v1
1471+
1472+
def sample_mutate_deployed_model():
1473+
# Create a client
1474+
client = aiplatform_v1.EndpointServiceClient()
1475+
1476+
# Initialize request argument(s)
1477+
deployed_model = aiplatform_v1.DeployedModel()
1478+
deployed_model.dedicated_resources.min_replica_count = 1803
1479+
deployed_model.model = "model_value"
1480+
1481+
request = aiplatform_v1.MutateDeployedModelRequest(
1482+
endpoint="endpoint_value",
1483+
deployed_model=deployed_model,
1484+
)
1485+
1486+
# Make the request
1487+
operation = client.mutate_deployed_model(request=request)
1488+
1489+
print("Waiting for operation to complete...")
1490+
1491+
response = operation.result()
1492+
1493+
# Handle the response
1494+
print(response)
1495+
1496+
Args:
1497+
request (Union[google.cloud.aiplatform_v1.types.MutateDeployedModelRequest, dict]):
1498+
The request object. Request message for
1499+
[EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1.EndpointService.MutateDeployedModel].
1500+
endpoint (str):
1501+
Required. The name of the Endpoint resource into which
1502+
to mutate a DeployedModel. Format:
1503+
``projects/{project}/locations/{location}/endpoints/{endpoint}``
1504+
1505+
This corresponds to the ``endpoint`` field
1506+
on the ``request`` instance; if ``request`` is provided, this
1507+
should not be set.
1508+
deployed_model (google.cloud.aiplatform_v1.types.DeployedModel):
1509+
Required. The DeployedModel to be mutated within the
1510+
Endpoint. Only the following fields can be mutated:
1511+
1512+
- ``min_replica_count`` in either
1513+
[DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources]
1514+
or
1515+
[AutomaticResources][google.cloud.aiplatform.v1.AutomaticResources]
1516+
- ``max_replica_count`` in either
1517+
[DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources]
1518+
or
1519+
[AutomaticResources][google.cloud.aiplatform.v1.AutomaticResources]
1520+
- [autoscaling_metric_specs][google.cloud.aiplatform.v1.DedicatedResources.autoscaling_metric_specs]
1521+
- ``disable_container_logging`` (v1 only)
1522+
- ``enable_container_logging`` (v1beta1 only)
1523+
1524+
This corresponds to the ``deployed_model`` field
1525+
on the ``request`` instance; if ``request`` is provided, this
1526+
should not be set.
1527+
update_mask (google.protobuf.field_mask_pb2.FieldMask):
1528+
Required. The update mask applies to the resource. See
1529+
[google.protobuf.FieldMask][google.protobuf.FieldMask].
1530+
1531+
This corresponds to the ``update_mask`` field
1532+
on the ``request`` instance; if ``request`` is provided, this
1533+
should not be set.
1534+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1535+
should be retried.
1536+
timeout (float): The timeout for this request.
1537+
metadata (Sequence[Tuple[str, str]]): Strings which should be
1538+
sent along with the request as metadata.
1539+
1540+
Returns:
1541+
google.api_core.operation.Operation:
1542+
An object representing a long-running operation.
1543+
1544+
The result type for the operation will be :class:`google.cloud.aiplatform_v1.types.MutateDeployedModelResponse` Response message for
1545+
[EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1.EndpointService.MutateDeployedModel].
1546+
1547+
"""
1548+
# Create or coerce a protobuf request object.
1549+
# Quick check: If we got a request object, we should *not* have
1550+
# gotten any keyword arguments that map to the request.
1551+
has_flattened_params = any([endpoint, deployed_model, update_mask])
1552+
if request is not None and has_flattened_params:
1553+
raise ValueError(
1554+
"If the `request` argument is set, then none of "
1555+
"the individual field arguments should be set."
1556+
)
1557+
1558+
# Minor optimization to avoid making a copy if the user passes
1559+
# in a endpoint_service.MutateDeployedModelRequest.
1560+
# There's no risk of modifying the input as we've already verified
1561+
# there are no flattened fields.
1562+
if not isinstance(request, endpoint_service.MutateDeployedModelRequest):
1563+
request = endpoint_service.MutateDeployedModelRequest(request)
1564+
# If we have keyword arguments corresponding to fields on the
1565+
# request, apply these.
1566+
if endpoint is not None:
1567+
request.endpoint = endpoint
1568+
if deployed_model is not None:
1569+
request.deployed_model = deployed_model
1570+
if update_mask is not None:
1571+
request.update_mask = update_mask
1572+
1573+
# Wrap the RPC method; this adds retry and timeout information,
1574+
# and friendly error handling.
1575+
rpc = self._transport._wrapped_methods[self._transport.mutate_deployed_model]
1576+
1577+
# Certain fields should be provided within the metadata header;
1578+
# add these here.
1579+
metadata = tuple(metadata) + (
1580+
gapic_v1.routing_header.to_grpc_metadata((("endpoint", request.endpoint),)),
1581+
)
1582+
1583+
# Send the request.
1584+
response = rpc(
1585+
request,
1586+
retry=retry,
1587+
timeout=timeout,
1588+
metadata=metadata,
1589+
)
1590+
1591+
# Wrap the response in an operation future.
1592+
response = gac_operation.from_gapic(
1593+
response,
1594+
self._transport.operations_client,
1595+
endpoint_service.MutateDeployedModelResponse,
1596+
metadata_type=endpoint_service.MutateDeployedModelOperationMetadata,
1597+
)
1598+
1599+
# Done; return the response.
1600+
return response
1601+
14431602
def __enter__(self) -> "EndpointServiceClient":
14441603
return self
14451604

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.