@@ -753,6 +753,7 @@ def deploy(
753
753
deploy_request_timeout : Optional [float ] = None ,
754
754
autoscaling_target_cpu_utilization : Optional [int ] = None ,
755
755
autoscaling_target_accelerator_duty_cycle : Optional [int ] = None ,
756
+ enable_access_logging = False ,
756
757
) -> None :
757
758
"""Deploys a Model to the Endpoint.
758
759
@@ -833,6 +834,8 @@ def deploy(
833
834
Target Accelerator Duty Cycle.
834
835
Must also set accelerator_type and accelerator_count if specified.
835
836
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.
836
839
"""
837
840
self ._sync_gca_resource_if_skipped ()
838
841
@@ -867,6 +870,7 @@ def deploy(
867
870
deploy_request_timeout = deploy_request_timeout ,
868
871
autoscaling_target_cpu_utilization = autoscaling_target_cpu_utilization ,
869
872
autoscaling_target_accelerator_duty_cycle = autoscaling_target_accelerator_duty_cycle ,
873
+ enable_access_logging = enable_access_logging ,
870
874
)
871
875
872
876
@base .optional_sync ()
@@ -888,6 +892,7 @@ def _deploy(
888
892
deploy_request_timeout : Optional [float ] = None ,
889
893
autoscaling_target_cpu_utilization : Optional [int ] = None ,
890
894
autoscaling_target_accelerator_duty_cycle : Optional [int ] = None ,
895
+ enable_access_logging = False ,
891
896
) -> None :
892
897
"""Deploys a Model to the Endpoint.
893
898
@@ -962,6 +967,8 @@ def _deploy(
962
967
Target Accelerator Duty Cycle.
963
968
Must also set accelerator_type and accelerator_count if specified.
964
969
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.
965
972
"""
966
973
_LOGGER .log_action_start_against_resource (
967
974
f"Deploying Model { model .resource_name } to" , "" , self
@@ -987,6 +994,7 @@ def _deploy(
987
994
deploy_request_timeout = deploy_request_timeout ,
988
995
autoscaling_target_cpu_utilization = autoscaling_target_cpu_utilization ,
989
996
autoscaling_target_accelerator_duty_cycle = autoscaling_target_accelerator_duty_cycle ,
997
+ enable_access_logging = enable_access_logging ,
990
998
)
991
999
992
1000
_LOGGER .log_action_completed_against_resource ("model" , "deployed" , self )
@@ -1015,6 +1023,7 @@ def _deploy_call(
1015
1023
deploy_request_timeout : Optional [float ] = None ,
1016
1024
autoscaling_target_cpu_utilization : Optional [int ] = None ,
1017
1025
autoscaling_target_accelerator_duty_cycle : Optional [int ] = None ,
1026
+ enable_access_logging = False ,
1018
1027
) -> None :
1019
1028
"""Helper method to deploy model to endpoint.
1020
1029
@@ -1095,6 +1104,8 @@ def _deploy_call(
1095
1104
Optional. Target Accelerator Duty Cycle.
1096
1105
Must also set accelerator_type and accelerator_count if specified.
1097
1106
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.
1098
1109
1099
1110
Raises:
1100
1111
ValueError: If only `accelerator_type` or `accelerator_count` is specified.
@@ -1122,6 +1133,7 @@ def _deploy_call(
1122
1133
model = model .versioned_resource_name ,
1123
1134
display_name = deployed_model_display_name ,
1124
1135
service_account = service_account ,
1136
+ enable_access_logging = enable_access_logging ,
1125
1137
)
1126
1138
1127
1139
supports_automatic_resources = (
@@ -3192,6 +3204,7 @@ def deploy(
3192
3204
deploy_request_timeout : Optional [float ] = None ,
3193
3205
autoscaling_target_cpu_utilization : Optional [int ] = None ,
3194
3206
autoscaling_target_accelerator_duty_cycle : Optional [int ] = None ,
3207
+ enable_access_logging = False ,
3195
3208
) -> Union [Endpoint , PrivateEndpoint ]:
3196
3209
"""Deploys model to endpoint. Endpoint will be created if unspecified.
3197
3210
@@ -3290,6 +3303,8 @@ def deploy(
3290
3303
Optional. Target Accelerator Duty Cycle.
3291
3304
Must also set accelerator_type and accelerator_count if specified.
3292
3305
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.
3293
3308
3294
3309
Returns:
3295
3310
endpoint (Union[Endpoint, PrivateEndpoint]):
@@ -3342,6 +3357,7 @@ def deploy(
3342
3357
deploy_request_timeout = deploy_request_timeout ,
3343
3358
autoscaling_target_cpu_utilization = autoscaling_target_cpu_utilization ,
3344
3359
autoscaling_target_accelerator_duty_cycle = autoscaling_target_accelerator_duty_cycle ,
3360
+ enable_access_logging = enable_access_logging ,
3345
3361
)
3346
3362
3347
3363
@base .optional_sync (return_input_arg = "endpoint" , bind_future_to_self = False )
@@ -3365,6 +3381,7 @@ def _deploy(
3365
3381
deploy_request_timeout : Optional [float ] = None ,
3366
3382
autoscaling_target_cpu_utilization : Optional [int ] = None ,
3367
3383
autoscaling_target_accelerator_duty_cycle : Optional [int ] = None ,
3384
+ enable_access_logging = False ,
3368
3385
) -> Union [Endpoint , PrivateEndpoint ]:
3369
3386
"""Deploys model to endpoint. Endpoint will be created if unspecified.
3370
3387
@@ -3456,6 +3473,8 @@ def _deploy(
3456
3473
Optional. Target Accelerator Duty Cycle.
3457
3474
Must also set accelerator_type and accelerator_count if specified.
3458
3475
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.
3459
3478
3460
3479
Returns:
3461
3480
endpoint (Union[Endpoint, PrivateEndpoint]):
@@ -3505,6 +3524,7 @@ def _deploy(
3505
3524
deploy_request_timeout = deploy_request_timeout ,
3506
3525
autoscaling_target_cpu_utilization = autoscaling_target_cpu_utilization ,
3507
3526
autoscaling_target_accelerator_duty_cycle = autoscaling_target_accelerator_duty_cycle ,
3527
+ enable_access_logging = enable_access_logging ,
3508
3528
)
3509
3529
3510
3530
_LOGGER .log_action_completed_against_resource ("model" , "deployed" , endpoint )
@@ -3597,8 +3617,7 @@ def batch_predict(
3597
3617
When only the project is specified, the Dataset and Table is created.
3598
3618
When the full table reference is specified, the Dataset must exist and
3599
3619
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,
3602
3621
a new one is created with the name
3603
3622
``prediction_<model-display-name>_<job-create-time>``
3604
3623
where the table name is made BigQuery-dataset-name compatible
0 commit comments