16
16
from collections import OrderedDict
17
17
import functools
18
18
import re
19
- from typing import Dict , Optional , Sequence , Tuple , Type , Union
19
+ from typing import Dict , Mapping , Optional , Sequence , Tuple , Type , Union
20
20
import pkg_resources
21
21
22
22
from google .api_core .client_options import ClientOptions
@@ -804,17 +804,14 @@ async def deploy_model(
804
804
* ,
805
805
endpoint : str = None ,
806
806
deployed_model : gca_endpoint .DeployedModel = None ,
807
- traffic_split : Sequence [
808
- endpoint_service .DeployModelRequest .TrafficSplitEntry
809
- ] = None ,
807
+ traffic_split : Mapping [str , int ] = None ,
810
808
retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
811
809
timeout : float = None ,
812
810
metadata : Sequence [Tuple [str , str ]] = (),
813
811
) -> operation_async .AsyncOperation :
814
812
r"""Deploys a Model into this Endpoint, creating a
815
813
DeployedModel within it.
816
814
817
-
818
815
.. code-block:: python
819
816
820
817
from google.cloud import aiplatform_v1
@@ -866,7 +863,7 @@ def sample_deploy_model():
866
863
This corresponds to the ``deployed_model`` field
867
864
on the ``request`` instance; if ``request`` is provided, this
868
865
should not be set.
869
- traffic_split (:class:`Sequence[google.cloud.aiplatform_v1.types.DeployModelRequest.TrafficSplitEntry ]`):
866
+ traffic_split (:class:`Mapping[str, int ]`):
870
867
A map from a DeployedModel's ID to the percentage of
871
868
this Endpoint's traffic that should be forwarded to that
872
869
DeployedModel.
@@ -963,9 +960,7 @@ async def undeploy_model(
963
960
* ,
964
961
endpoint : str = None ,
965
962
deployed_model_id : str = None ,
966
- traffic_split : Sequence [
967
- endpoint_service .UndeployModelRequest .TrafficSplitEntry
968
- ] = None ,
963
+ traffic_split : Mapping [str , int ] = None ,
969
964
retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
970
965
timeout : float = None ,
971
966
metadata : Sequence [Tuple [str , str ]] = (),
@@ -974,7 +969,6 @@ async def undeploy_model(
974
969
DeployedModel from it, and freeing all resources it's
975
970
using.
976
971
977
-
978
972
.. code-block:: python
979
973
980
974
from google.cloud import aiplatform_v1
@@ -1018,7 +1012,7 @@ def sample_undeploy_model():
1018
1012
This corresponds to the ``deployed_model_id`` field
1019
1013
on the ``request`` instance; if ``request`` is provided, this
1020
1014
should not be set.
1021
- traffic_split (:class:`Sequence[google.cloud.aiplatform_v1.types.UndeployModelRequest.TrafficSplitEntry ]`):
1015
+ traffic_split (:class:`Mapping[str, int ]`):
1022
1016
If this field is provided, then the Endpoint's
1023
1017
[traffic_split][google.cloud.aiplatform.v1.Endpoint.traffic_split]
1024
1018
will be overwritten with it. If last DeployedModel is
0 commit comments