-
Notifications
You must be signed in to change notification settings - Fork 455
feat(agentregistry): generate library #16208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
scotthart
merged 5 commits into
googleapis:main
from
scotthart:feat-agentregistry-generate-library
Jun 26, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7e0730e
feat(agentregistry): generate library
scotthart 7a029cd
Run generators and format their outputs
scotthart efb57ad
Add API baseline
scotthart b5e0dd5
Manually update READMEs, quickstart, and top-level stuff
scotthart b3f0e89
update quickstart .bazelrc
scotthart File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| @googleapis//google/api:annotations_proto | ||
| @googleapis//google/api:client_proto | ||
| @googleapis//google/api:field_behavior_proto | ||
| @googleapis//google/api:field_info_proto | ||
| @googleapis//google/api:http_proto | ||
| @googleapis//google/api:launch_stage_proto | ||
| @googleapis//google/api:resource_proto | ||
| @googleapis//google/longrunning:operations_proto | ||
| @googleapis//google/rpc:status_proto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| @googleapis//google/cloud/agentregistry/v1:agent.proto | ||
| @googleapis//google/cloud/agentregistry/v1:agentregistry_service.proto | ||
| @googleapis//google/cloud/agentregistry/v1:binding.proto | ||
| @googleapis//google/cloud/agentregistry/v1:endpoint.proto | ||
| @googleapis//google/cloud/agentregistry/v1:mcp_server.proto | ||
| @googleapis//google/cloud/agentregistry/v1:properties.proto | ||
| @googleapis//google/cloud/agentregistry/v1:service.proto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Copyright 2026 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| load("//bazel:gapic.bzl", "cc_gapic_library") | ||
|
|
||
| package(default_visibility = ["//visibility:private"]) | ||
|
|
||
| licenses(["notice"]) # Apache 2.0 | ||
|
|
||
| service_dirs = ["v1/"] | ||
|
|
||
| googleapis_deps = [ | ||
| "@googleapis//google/cloud/agentregistry/v1:agentregistry_cc_grpc", | ||
| ] | ||
|
|
||
| cc_gapic_library( | ||
| name = "agentregistry", | ||
| googleapis_deps = googleapis_deps, | ||
| service_dirs = service_dirs, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # ~~~ | ||
| # Copyright 2026 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # ~~~ | ||
|
|
||
| include(GoogleCloudCppLibrary) | ||
|
|
||
| google_cloud_cpp_add_gapic_library(agentregistry "Agent Registry API" | ||
| SERVICE_DIRS "v1/") | ||
|
|
||
| if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) | ||
| add_executable(agentregistry_quickstart "quickstart/quickstart.cc") | ||
| target_link_libraries(agentregistry_quickstart | ||
| PRIVATE google-cloud-cpp::agentregistry) | ||
| google_cloud_cpp_add_common_options(agentregistry_quickstart) | ||
| add_test( | ||
| NAME agentregistry_quickstart | ||
| COMMAND | ||
| cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake" | ||
| $<TARGET_FILE:agentregistry_quickstart> GOOGLE_CLOUD_PROJECT | ||
| GOOGLE_CLOUD_CPP_TEST_REGION) | ||
| set_tests_properties( | ||
| agentregistry_quickstart | ||
| PROPERTIES LABELS "integration-test;quickstart" PASS_REGULAR_EXPRESSION | ||
| "Permanent error.*gcloud-cpp.retry.function=ListAgents") | ||
| endif () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Agent Registry API C++ Client Library | ||
|
|
||
| This directory contains an idiomatic C++ client library for the | ||
| [Agent Registry API][cloud-service-docs]. | ||
|
|
||
| Agent Registry is a centralized, unified catalog that lets you store, discover, | ||
| and govern Model Context Protocol (MCP) servers, tools, and AI agents within | ||
| Google Cloud. | ||
|
|
||
| While this library is **GA**, please note that the Google Cloud C++ client | ||
| libraries do **not** follow [Semantic Versioning](https://semver.org/). | ||
|
|
||
| ## Quickstart | ||
|
|
||
| The [quickstart/](quickstart/README.md) directory contains a minimal environment | ||
| to get started using this client library in a larger project. The following | ||
| "Hello World" program is used in this quickstart, and should give you a taste of | ||
| this library. | ||
|
|
||
| <!-- inject-quickstart-start --> | ||
|
|
||
| ```cc | ||
| #include "google/cloud/agentregistry/v1/agent_registry_client.h" | ||
| #include "google/cloud/location.h" | ||
| #include <iostream> | ||
|
|
||
| int main(int argc, char* argv[]) try { | ||
| if (argc != 3) { | ||
| std::cerr << "Usage: " << argv[0] << " project-id location-id\n"; | ||
| return 1; | ||
| } | ||
|
|
||
| auto const location = google::cloud::Location(argv[1], argv[2]); | ||
|
|
||
| namespace agentregistry = ::google::cloud::agentregistry_v1; | ||
| auto client = agentregistry::AgentRegistryClient( | ||
| agentregistry::MakeAgentRegistryConnection()); | ||
|
|
||
| for (auto r : client.ListAgents(location.FullName())) { | ||
| if (!r) throw std::move(r).status(); | ||
| std::cout << r->DebugString() << "\n"; | ||
| } | ||
|
|
||
| return 0; | ||
| } catch (google::cloud::Status const& status) { | ||
| std::cerr << "google::cloud::Status thrown: " << status << "\n"; | ||
| return 1; | ||
| } | ||
| ``` | ||
| <!-- inject-quickstart-end --> | ||
| ## More Information | ||
| - Official documentation about the [Agent Registry API][cloud-service-docs] | ||
| service | ||
| - [Reference doxygen documentation][doxygen-link] for each release of this | ||
| client library | ||
| - Detailed header comments in our [public `.h`][source-link] files | ||
| [cloud-service-docs]: https://docs.cloud.google.com/agent-registry/overview | ||
| [doxygen-link]: https://cloud.google.com/cpp/docs/reference/agentregistry/latest/ | ||
| [source-link]: https://github.com/googleapis/google-cloud-cpp/tree/main/google/cloud/agentregistry | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /*! | ||
| @page agentregistry-env Environment Variables | ||
|
|
||
| A number of environment variables can be used to configure the behavior of | ||
| the library. There are also functions to configure this behavior in code. The | ||
| environment variables are convenient when troubleshooting problems. | ||
|
|
||
| @section agentregistry-env-endpoint Endpoint Overrides | ||
|
|
||
| <!-- inject-endpoint-env-vars-start --> | ||
|
|
||
| - `GOOGLE_CLOUD_CPP_AGENT_REGISTRY_ENDPOINT=...` overrides the | ||
| `EndpointOption` (which defaults to "agentregistry.googleapis.com") | ||
| used by `MakeAgentRegistryConnection()`. | ||
|
|
||
| <!-- inject-endpoint-env-vars-end --> | ||
|
|
||
| @see google::cloud::EndpointOption | ||
|
|
||
| @section agentregistry-env-logging Logging | ||
|
|
||
| `GOOGLE_CLOUD_CPP_ENABLE_TRACING=rpc`: turns on tracing for most gRPC | ||
| calls. The library injects an additional Stub decorator that prints each gRPC | ||
| request and response. Unless you have configured your own logging backend, | ||
| you should also set `GOOGLE_CLOUD_CPP_ENABLE_CLOG` to produce any output on | ||
| the program's console. | ||
|
|
||
| @see google::cloud::LoggingComponentsOption | ||
|
|
||
| `GOOGLE_CLOUD_CPP_TRACING_OPTIONS=...`: modifies the behavior of gRPC tracing, | ||
| including whether messages will be output on multiple lines, or whether | ||
| string/bytes fields will be truncated. | ||
|
|
||
| @see google::cloud::GrpcTracingOptionsOption | ||
|
|
||
| `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes`: turns on logging in the library, basically | ||
| the library always "logs" but the logging infrastructure has no backend to | ||
| actually print anything until the application sets a backend or they set this | ||
| environment variable. | ||
|
|
||
| @see google::cloud::LogBackend | ||
| @see google::cloud::LogSink | ||
|
|
||
| @section agentregistry-env-project Setting the Default Project | ||
|
|
||
| `GOOGLE_CLOUD_PROJECT=...`: is used in examples and integration tests to | ||
| configure the GCP project. This has no effect in the library. | ||
|
|
||
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| /*! | ||
|
|
||
| @mainpage Agent Registry API C++ Client Library | ||
|
|
||
| An idiomatic C++ client library for the [Agent Registry API][cloud-service-docs]. | ||
|
|
||
| Agent Registry is a centralized, unified catalog that lets you store, | ||
| discover, and govern Model Context Protocol (MCP) servers, tools, and AI | ||
| agents within Google Cloud. | ||
|
|
||
| While this library is **GA**, please note that the Google Cloud C++ client libraries do **not** follow | ||
| [Semantic Versioning](https://semver.org/). | ||
|
|
||
| @tableofcontents{HTML:2} | ||
|
|
||
| ## Quickstart | ||
|
|
||
| The following shows the code that you'll run in the | ||
| `google/cloud/agentregistry/quickstart/` directory, | ||
| which should give you a taste of the Agent Registry API C++ client library API. | ||
|
|
||
| @snippet quickstart.cc all | ||
|
|
||
| ## Main classes | ||
|
|
||
| <!-- inject-client-list-start --> | ||
| The main class in this library is | ||
| [`agentregistry_v1::AgentRegistryClient`](@ref google::cloud::agentregistry_v1::AgentRegistryClient). All RPCs are exposed | ||
| as member functions of this class. Other classes provide helpers, configuration | ||
| parameters, and infrastructure to mock | ||
| [`agentregistry_v1::AgentRegistryClient`](@ref google::cloud::agentregistry_v1::AgentRegistryClient) when testing your | ||
| application. | ||
| <!-- inject-client-list-end --> | ||
|
|
||
| ## More Information | ||
|
|
||
| - @ref common-error-handling - describes how the library reports errors. | ||
| - @ref agentregistry-override-endpoint - describes how to override the default | ||
| endpoint. | ||
| - @ref agentregistry-override-authentication - describes how to change the | ||
| authentication credentials used by the library. | ||
| - @ref agentregistry-override-retry - describes how to change the default retry | ||
| policies. | ||
| - @ref agentregistry-env - describes environment variables that can configure the | ||
| behavior of the library. | ||
| - @ref agentregistry-override-universe-domain - describes how to override the default universe domain. | ||
|
|
||
| [cloud-service-docs]: https://docs.cloud.google.com/agent-registry/overview | ||
|
|
||
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /*! | ||
| @defgroup google-cloud-agentregistry-options Agent Registry API Configuration Options | ||
|
|
||
| This library uses the same mechanism (`google::cloud::Options`) and the common | ||
| [options](@ref options) as all other C++ client libraries for its configuration. | ||
| Some `*Option` classes, which are only used in this library, are documented in | ||
| this page. | ||
|
|
||
| @see @ref options - for an overview of client library configuration. | ||
| */ |
35 changes: 35 additions & 0 deletions
35
google/cloud/agentregistry/doc/override-authentication.dox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| /*! | ||
| @page agentregistry-override-authentication How to Override the Authentication Credentials | ||
|
|
||
| Unless otherwise configured, the client libraries use | ||
| [Application Default Credentials] to authenticate with Google Cloud Services. | ||
| While this works for most applications, in some cases you may need to override | ||
| this default. You can do so by providing the | ||
| [UnifiedCredentialsOption](@ref google::cloud::UnifiedCredentialsOption) | ||
| The following example shows how to explicitly load a service account key file: | ||
|
|
||
| <!-- inject-service-account-snippet-start --> | ||
| @snippet agent_registry_client_samples.cc with-service-account | ||
|
|
||
| <!-- inject-service-account-snippet-end --> | ||
|
|
||
| Keep in mind that we chose this as an example because it is relatively easy to | ||
| understand. Consult the [Best practices for managing service account keys] | ||
| guide for more details. | ||
|
|
||
| @see @ref guac - for more information on the factory functions to create | ||
| `google::cloud::Credentials` objects. | ||
|
|
||
| [Best practices for managing service account keys]: https://cloud.google.com/iam/docs/best-practices-for-managing-service-account-keys | ||
| [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc | ||
|
|
||
| */ | ||
|
|
||
| // <!-- inject-authentication-pages-start --> | ||
|
|
||
| /*! @page agentregistry_v1::AgentRegistryClient-service-account-snippet Override agentregistry_v1::AgentRegistryClient Authentication Defaults | ||
|
|
||
| @snippet google/cloud/agentregistry/v1/samples/agent_registry_client_samples.cc with-service-account | ||
|
|
||
| */ | ||
| // <!-- inject-authentication-pages-end --> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.