Google Cloud API Gateway is a fully managed service that allows developers to create, secure, and monitor APIs for their applications. It enables seamless management of APIs at scale, integrates with IAM for authentication, and provides features like quota management, monitoring, and logging.The GCPAPIGatewayHandler helps interact with Google Cloud’s API Gateway service to fetch gateway details programmatically.
To create the GCPAPIGatewayHandler object, initialize it with your Google service account credentials (JSON file path or dictionary).
Copy
from superagentx_handlers.gcp.api_gateway import GCPAPIGatewayHandlergateway_handler = GCPAPIGatewayHandler( creds="service-account.json" # or dict with service account info)
List API Gateways:
Lists all API Gateways available in your GCP project across supported regions.
Copy
gateways = await gateway_handler.list_gateways(page_size=50)for g in gateways: print(g["name"], g["state"], g["default_hostname"])
Convert Gateway to Dictionary (_gateway_to_dict):
Converts a Gateway object into a structured dictionary with useful metadata.