From 796ca8455e0bad462eb0d2871e51c2d62e80d8fc Mon Sep 17 00:00:00 2001 From: Juan Carlos Gonzalez Resendiz Date: Thu, 11 Jun 2026 17:44:30 -0600 Subject: [PATCH 1/2] Create documentation for Google Cloud Parameter Manager Added documentation for Google Cloud Parameter Manager integration, including usage examples and prerequisites. --- .../google_cloud_ parameter_manager.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 docs/integrations/google_cloud_ parameter_manager.md diff --git a/docs/integrations/google_cloud_ parameter_manager.md b/docs/integrations/google_cloud_ parameter_manager.md new file mode 100644 index 000000000..07d4c0ea0 --- /dev/null +++ b/docs/integrations/google_cloud_ parameter_manager.md @@ -0,0 +1,82 @@ + +# Catalog Frontmatter + +|element|content| +|-----|-----| +| catalog_title| Google Cloud Parameter Manager| +| catalog_description | A client for interacting with Google Cloud Parameter Manager | +--- + +# Google Cloud Secrets Manager +## Google Cloud Parameter Manager +The Parameter Manager integration is an extension of the Secret Manager class, offering a lightweight client designed to fetch processed parameter data from Google Cloud. This tool is ideal for agents that require configuration settings to be handled independently of the agent’s internal process. If you want to know more about all options, features or capabilities that this integration facilitates, click here. +The following code snippets represent the usage of different credential types as shown below. + +# Integration Name + +**ParameterManagerClient** + +This integration provides a small client for fetching Google Cloud parameter values, which is perfect for agents that need to store their configuration settings externally. + +# Use cases + +#### With different authentication credentials # + +##### Using default credentials +´´´client = ParameterManagerClient()´´´ + +##### Or with a service account json string +´´´client = ParameterManagerClient(service_account_json="...")´´´ + +##### Or with an auth token +´´´client = ParameterManagerClient(auth_token="...")´´´ + +##### To use a regional Parameter Manager endpoint, pass location: + +´´´client = ParameterManagerClient(location="us-central1")´´´ + +# Prerequisites + +### Only the class ParameterManagerClient +- ´´´from google.adk.integrations.parameter_manager.parameter_client import ParameterManagerClient´´´ + +# Explaining how to retrieve a parameter +´´´value =client.get_parameter("projects/my-project/locations/global/parameters/my-param/versions/latest")´´´ +## Resources + +- [Deploy Preview] ](https://deploy-preview-1729--adk-docs-preview.netlify.app/integrations/parameter-manager/#initialize-the-client) +- [GitHub Repository](src/google/adk/integrations/parameter_manager/parameter_client.py) +- [Google Cloud](https://docs.cloud.google.com/secret-manager/parameter-manager/docs/overview) +- [Google AI Studio](https://aistudio-preprod.corp.google.com/prompts/1C4ldgvJkKT6qHtFUeiZKcTiDGOmlP1ze?resourceKey=0-IldDiiPSogAPqBzVfz5jSw) + +## Complete usage of ParameterManagerClient +Here is a complete example of how to initialize the client and use it to fetch a parameter within an ADK application. + +´´´ +import os +from google.adk.integrations.parameter_manager.parameter_client import ParameterManagerClient + +def fetch_external_api_key(): + # 1. Initialize the Client + # client = ParameterManagerClient() + + # 2. Define the resource name + # Format: projects/{project_id}/locations/{location}/parameters/{parameter_id} + project_id = "your-gcp-project" + param_name = f"projects/{project_id}/locations/global/parameters/my-api-key" + + try: + # 3. Fetch the parameter payload + # This automatically resolves linked secrets if configured + parameter_payload = client.get_parameter(param_name) + + print(f"Successfully fetched parameter: {parameter_payload}") + return parameter_payload + + except Exception as e: + print(f"Error retrieving parameter: {e}") + return None + +# Example usage in an agent tool + result = fetch_external_api_key() +´´´ From 23348067943117e8f560c47dab053a27c1c40144 Mon Sep 17 00:00:00 2001 From: Juan Carlos Gonzalez Resendiz Date: Thu, 11 Jun 2026 17:57:55 -0600 Subject: [PATCH 2/2] Improve markdown formatting in Google Cloud parameter manager doc Updated markdown formatting for better readability and consistency. --- .../google_cloud_ parameter_manager.md | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/docs/integrations/google_cloud_ parameter_manager.md b/docs/integrations/google_cloud_ parameter_manager.md index 07d4c0ea0..5af4a13a9 100644 --- a/docs/integrations/google_cloud_ parameter_manager.md +++ b/docs/integrations/google_cloud_ parameter_manager.md @@ -20,31 +20,31 @@ This integration provides a small client for fetching Google Cloud parameter val # Use cases -#### With different authentication credentials # +## With different authentication credentials -##### Using default credentials -´´´client = ParameterManagerClient()´´´ +### Using default credentials +```client = ParameterManagerClient()``` -##### Or with a service account json string -´´´client = ParameterManagerClient(service_account_json="...")´´´ +### Or with a service account json string +```client = ParameterManagerClient(service_account_json="...")``` -##### Or with an auth token -´´´client = ParameterManagerClient(auth_token="...")´´´ +### Or with an auth token +```client = ParameterManagerClient(auth_token="...")``` -##### To use a regional Parameter Manager endpoint, pass location: +### To use a regional Parameter Manager endpoint, pass location: -´´´client = ParameterManagerClient(location="us-central1")´´´ +```client = ParameterManagerClient(location="us-central1")``` # Prerequisites ### Only the class ParameterManagerClient -- ´´´from google.adk.integrations.parameter_manager.parameter_client import ParameterManagerClient´´´ +``` from google.adk.integrations.parameter_manager.parameter_client import ParameterManagerClient``` # Explaining how to retrieve a parameter -´´´value =client.get_parameter("projects/my-project/locations/global/parameters/my-param/versions/latest")´´´ +```value =client.get_parameter("projects/my-project/locations/global/parameters/my-param/versions/latest")``` ## Resources -- [Deploy Preview] ](https://deploy-preview-1729--adk-docs-preview.netlify.app/integrations/parameter-manager/#initialize-the-client) +- [Deploy Preview](https://deploy-preview-1729--adk-docs-preview.netlify.app/integrations/parameter-manager/#initialize-the-client) - [GitHub Repository](src/google/adk/integrations/parameter_manager/parameter_client.py) - [Google Cloud](https://docs.cloud.google.com/secret-manager/parameter-manager/docs/overview) - [Google AI Studio](https://aistudio-preprod.corp.google.com/prompts/1C4ldgvJkKT6qHtFUeiZKcTiDGOmlP1ze?resourceKey=0-IldDiiPSogAPqBzVfz5jSw) @@ -52,22 +52,24 @@ This integration provides a small client for fetching Google Cloud parameter val ## Complete usage of ParameterManagerClient Here is a complete example of how to initialize the client and use it to fetch a parameter within an ADK application. -´´´ +==python== + +```python import os from google.adk.integrations.parameter_manager.parameter_client import ParameterManagerClient def fetch_external_api_key(): - # 1. Initialize the Client - # client = ParameterManagerClient() + -- 1. Initialize the Client + client = ParameterManagerClient() - # 2. Define the resource name + -- 2. Define the resource name # Format: projects/{project_id}/locations/{location}/parameters/{parameter_id} project_id = "your-gcp-project" param_name = f"projects/{project_id}/locations/global/parameters/my-api-key" try: - # 3. Fetch the parameter payload - # This automatically resolves linked secrets if configured + -- 3. Fetch the parameter payload + -- This automatically resolves linked secrets if configured parameter_payload = client.get_parameter(param_name) print(f"Successfully fetched parameter: {parameter_payload}") @@ -77,6 +79,6 @@ def fetch_external_api_key(): print(f"Error retrieving parameter: {e}") return None -# Example usage in an agent tool +-- Example usage in an agent tool result = fetch_external_api_key() -´´´ +```