@@ -753,6 +753,7 @@ def deploy(
753753 deploy_request_timeout : Optional [float ] = None ,
754754 autoscaling_target_cpu_utilization : Optional [int ] = None ,
755755 autoscaling_target_accelerator_duty_cycle : Optional [int ] = None ,
756+ enable_access_logging = False ,
756757 ) -> None :
757758 """Deploys a Model to the Endpoint.
758759
@@ -833,6 +834,8 @@ def deploy(
833834 Target Accelerator Duty Cycle.
834835 Must also set accelerator_type and accelerator_count if specified.
835836 A default value of 60 will be used if not specified.
837+ enable_access_logging (bool):
838+ Whether to enable endpoint access logging. Defaults to False.
836839 """
837840 self ._sync_gca_resource_if_skipped ()
838841
@@ -867,6 +870,7 @@ def deploy(
867870 deploy_request_timeout = deploy_request_timeout ,
868871 autoscaling_target_cpu_utilization = autoscaling_target_cpu_utilization ,
869872 autoscaling_target_accelerator_duty_cycle = autoscaling_target_accelerator_duty_cycle ,
873+ enable_access_logging = enable_access_logging ,
870874 )
871875
872876 @base .optional_sync ()
@@ -888,6 +892,7 @@ def _deploy(
888892 deploy_request_timeout : Optional [float ] = None ,
889893 autoscaling_target_cpu_utilization : Optional [int ] = None ,
890894 autoscaling_target_accelerator_duty_cycle : Optional [int ] = None ,
895+ enable_access_logging = False ,
891896 ) -> None :
892897 """Deploys a Model to the Endpoint.
893898
@@ -962,6 +967,8 @@ def _deploy(
962967 Target Accelerator Duty Cycle.
963968 Must also set accelerator_type and accelerator_count if specified.
964969 A default value of 60 will be used if not specified.
970+ enable_access_logging (bool):
971+ Whether to enable endpoint access logging. Defaults to False.
965972 """
966973 _LOGGER .log_action_start_against_resource (
967974 f"Deploying Model { model .resource_name } to" , "" , self
@@ -987,6 +994,7 @@ def _deploy(
987994 deploy_request_timeout = deploy_request_timeout ,
988995 autoscaling_target_cpu_utilization = autoscaling_target_cpu_utilization ,
989996 autoscaling_target_accelerator_duty_cycle = autoscaling_target_accelerator_duty_cycle ,
997+ enable_access_logging = enable_access_logging ,
990998 )
991999
9921000 _LOGGER .log_action_completed_against_resource ("model" , "deployed" , self )
@@ -1015,6 +1023,7 @@ def _deploy_call(
10151023 deploy_request_timeout : Optional [float ] = None ,
10161024 autoscaling_target_cpu_utilization : Optional [int ] = None ,
10171025 autoscaling_target_accelerator_duty_cycle : Optional [int ] = None ,
1026+ enable_access_logging = False ,
10181027 ) -> None :
10191028 """Helper method to deploy model to endpoint.
10201029
@@ -1095,6 +1104,8 @@ def _deploy_call(
10951104 Optional. Target Accelerator Duty Cycle.
10961105 Must also set accelerator_type and accelerator_count if specified.
10971106 A default value of 60 will be used if not specified.
1107+ enable_access_logging (bool):
1108+ Whether to enable endpoint access logging. Defaults to False.
10981109
10991110 Raises:
11001111 ValueError: If only `accelerator_type` or `accelerator_count` is specified.
@@ -1122,6 +1133,7 @@ def _deploy_call(
11221133 model = model .versioned_resource_name ,
11231134 display_name = deployed_model_display_name ,
11241135 service_account = service_account ,
1136+ enable_access_logging = enable_access_logging ,
11251137 )
11261138
11271139 supports_automatic_resources = (
@@ -3192,6 +3204,7 @@ def deploy(
31923204 deploy_request_timeout : Optional [float ] = None ,
31933205 autoscaling_target_cpu_utilization : Optional [int ] = None ,
31943206 autoscaling_target_accelerator_duty_cycle : Optional [int ] = None ,
3207+ enable_access_logging = False ,
31953208 ) -> Union [Endpoint , PrivateEndpoint ]:
31963209 """Deploys model to endpoint. Endpoint will be created if unspecified.
31973210
@@ -3290,6 +3303,8 @@ def deploy(
32903303 Optional. Target Accelerator Duty Cycle.
32913304 Must also set accelerator_type and accelerator_count if specified.
32923305 A default value of 60 will be used if not specified.
3306+ enable_access_logging (bool):
3307+ Whether to enable endpoint access logging. Defaults to False.
32933308
32943309 Returns:
32953310 endpoint (Union[Endpoint, PrivateEndpoint]):
@@ -3342,6 +3357,7 @@ def deploy(
33423357 deploy_request_timeout = deploy_request_timeout ,
33433358 autoscaling_target_cpu_utilization = autoscaling_target_cpu_utilization ,
33443359 autoscaling_target_accelerator_duty_cycle = autoscaling_target_accelerator_duty_cycle ,
3360+ enable_access_logging = enable_access_logging ,
33453361 )
33463362
33473363 @base .optional_sync (return_input_arg = "endpoint" , bind_future_to_self = False )
@@ -3365,6 +3381,7 @@ def _deploy(
33653381 deploy_request_timeout : Optional [float ] = None ,
33663382 autoscaling_target_cpu_utilization : Optional [int ] = None ,
33673383 autoscaling_target_accelerator_duty_cycle : Optional [int ] = None ,
3384+ enable_access_logging = False ,
33683385 ) -> Union [Endpoint , PrivateEndpoint ]:
33693386 """Deploys model to endpoint. Endpoint will be created if unspecified.
33703387
@@ -3456,6 +3473,8 @@ def _deploy(
34563473 Optional. Target Accelerator Duty Cycle.
34573474 Must also set accelerator_type and accelerator_count if specified.
34583475 A default value of 60 will be used if not specified.
3476+ enable_access_logging (bool):
3477+ Whether to enable endpoint access logging. Defaults to False.
34593478
34603479 Returns:
34613480 endpoint (Union[Endpoint, PrivateEndpoint]):
@@ -3505,6 +3524,7 @@ def _deploy(
35053524 deploy_request_timeout = deploy_request_timeout ,
35063525 autoscaling_target_cpu_utilization = autoscaling_target_cpu_utilization ,
35073526 autoscaling_target_accelerator_duty_cycle = autoscaling_target_accelerator_duty_cycle ,
3527+ enable_access_logging = enable_access_logging ,
35083528 )
35093529
35103530 _LOGGER .log_action_completed_against_resource ("model" , "deployed" , endpoint )
@@ -3597,8 +3617,7 @@ def batch_predict(
35973617 When only the project is specified, the Dataset and Table is created.
35983618 When the full table reference is specified, the Dataset must exist and
35993619 table must not exist. Accepted forms: ``bq://projectId`` or
3600- ``bq://projectId.bqDatasetId`` or
3601- ``bq://projectId.bqDatasetId.bqTableId``. If no Dataset is specified,
3620+ ``bq://projectId.bqDatasetId``. If no Dataset is specified,
36023621 a new one is created with the name
36033622 ``prediction_<model-display-name>_<job-create-time>``
36043623 where the table name is made BigQuery-dataset-name compatible
0 commit comments