Google Cloud Vision AI API client library for building and deploying Vertex AI Vision applications
—
Service monitoring and health verification capabilities for Google Cloud Vision AI infrastructure. The HealthCheckService provides essential monitoring functionality to verify the operational status of Vision AI clusters and services.
Performs comprehensive health checks on Vision AI clusters to ensure services are operational and responsive.
def health_check(self, cluster: str) -> HealthCheckResponse:
"""
Performs health check on a Vision AI cluster.
Args:
cluster (str): Required. Cluster resource path
"projects/{project}/locations/{location}/clusters/{cluster}"
Returns:
HealthCheckResponse: Health status information for the cluster
"""class HealthCheckRequest:
"""Request for health check operation."""
cluster: str # Cluster resource path to check
class HealthCheckResponse:
"""Response containing health check results."""
cluster_info: ClusterInfo # Detailed cluster health information
class ClusterInfo:
"""Cluster health and status information."""
# Health status details and metrics
passfrom google.cloud import visionai_v1
# Create health check service client
health_client = visionai_v1.HealthCheckServiceClient()
# Check cluster health
cluster_path = health_client.common_project_path("my-project") + "/locations/us-central1/clusters/my-cluster"
response = health_client.health_check(cluster=cluster_path)
# Process health check results
cluster_info = response.cluster_info
print(f"Cluster health status: {cluster_info}")Async usage:
import asyncio
from google.cloud import visionai_v1
async def check_cluster_health():
async with visionai_v1.HealthCheckServiceAsyncClient() as client:
cluster_path = "projects/my-project/locations/us-central1/clusters/my-cluster"
response = await client.health_check(cluster=cluster_path)
return response.cluster_info
health_info = asyncio.run(check_cluster_health())The HealthCheckService is only available in the stable v1 API and provides essential monitoring capabilities for production deployments.
Install with Tessl CLI
npx tessl i tessl/pypi-google-cloud-visionai