@@ -3363,6 +3363,8 @@ def health_http_uri(self) -> Optional[str]:
3363
3363
return None
3364
3364
return self ._gca_resource .deployed_models [0 ].private_endpoints .health_http_uri
3365
3365
3366
+ # PrivateServiceConnectConfig is deprecated.
3367
+ # Use service_networking.PrivateServiceConnectConfig instead.
3366
3368
class PrivateServiceConnectConfig :
3367
3369
"""Represents a Vertex AI PrivateServiceConnectConfig resource."""
3368
3370
@@ -3399,7 +3401,10 @@ def create(
3399
3401
credentials : Optional [auth_credentials .Credentials ] = None ,
3400
3402
encryption_spec_key_name : Optional [str ] = None ,
3401
3403
sync = True ,
3402
- private_service_connect_config : Optional [PrivateServiceConnectConfig ] = None ,
3404
+ private_service_connect_config : Union [
3405
+ Optional [PrivateServiceConnectConfig ],
3406
+ Optional [gca_service_networking .PrivateServiceConnectConfig ],
3407
+ ] = None ,
3403
3408
enable_request_response_logging = False ,
3404
3409
request_response_logging_sampling_rate : Optional [float ] = None ,
3405
3410
request_response_logging_bq_destination_table : Optional [str ] = None ,
@@ -3428,15 +3433,17 @@ def create(
3428
3433
display_name="my_endpoint_name",
3429
3434
project="my_project_id",
3430
3435
location="us-central1",
3431
- private_service_connect=aiplatform.PrivateEndpoint.PrivateServiceConnectConfig(
3436
+ private_service_connect=aiplatform.compat.types.service_networking.PrivateServiceConnectConfig(
3437
+ enable_private_service_connect=True,
3432
3438
project_allowlist=["test-project"]),
3433
3439
)
3434
3440
3435
3441
or (when project and location are initialized)
3436
3442
3437
3443
my_private_endpoint = aiplatform.PrivateEndpoint.create(
3438
3444
display_name="my_endpoint_name",
3439
- private_service_connect=aiplatform.PrivateEndpoint.PrivateServiceConnectConfig(
3445
+ private_service_connect=aiplatform.compat.types.service_networking.PrivateServiceConnectConfig(
3446
+ enable_private_service_connect=True,
3440
3447
project_allowlist=["test-project"]),
3441
3448
)
3442
3449
Args:
@@ -3475,12 +3482,11 @@ def create(
3475
3482
sync (bool): Whether to execute this method synchronously. If False,
3476
3483
this method will be executed in concurrent Future and any downstream
3477
3484
object will be immediately returned and synced when the Future has
3478
- completed. private_service_connect_config
3479
- (aiplatform.PrivateEndpoint.PrivateServiceConnectConfig): [Private
3480
- Service
3481
- Connect](https://cloud.google.com/vpc/docs/private-service-connect)
3482
- configuration for the endpoint. Cannot be set when network is
3483
- specified.
3485
+ completed.
3486
+ private_service_connect_config
3487
+ (aiplatform.compat.types.service_networking.PrivateServiceConnectConfig): [Private
3488
+ Service Connect Configuration](https://cloud.google.com/vertex-ai/docs/reference/rest/v1/PrivateServiceConnectConfig)
3489
+ for the endpoint. Cannot be set when network is specified.
3484
3490
enable_request_response_logging (bool): Optional. Whether to enable
3485
3491
request & response logging for this endpoint.
3486
3492
request_response_logging_sampling_rate (float): Optional. The request
@@ -3527,9 +3533,15 @@ def create(
3527
3533
3528
3534
config = None
3529
3535
if private_service_connect_config :
3530
- config = (
3531
- private_service_connect_config ._gapic_private_service_connect_config
3532
- )
3536
+ if hasattr (
3537
+ private_service_connect_config ,
3538
+ "_gapic_private_service_connect_config" ,
3539
+ ):
3540
+ config = (
3541
+ private_service_connect_config ._gapic_private_service_connect_config
3542
+ )
3543
+ else :
3544
+ config = private_service_connect_config
3533
3545
3534
3546
predict_request_response_logging_config = None
3535
3547
if enable_request_response_logging :
0 commit comments