Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e87d201

Browse filesBrowse files
cuiy0006devbww
authored andcommitted
feat(chronicle): generate library (googleapis#15083)
* feat(chronicle): generate library * Run generators and format their outputs * Manually update READMEs, quickstart, and top-level stuff * Add API baseline * add endpoint option for quickstart
1 parent 5813de4 commit e87d201
Copy full SHA for e87d201

File tree

Expand file treeCollapse file tree

172 files changed

+22443
-0
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

172 files changed

+22443
-0
lines changed

‎CHANGELOG.md

Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ the APIs in these libraries are stable, and are ready for production use.
1414
- [Financial Services API](/google/cloud/financialservices/README.md)
1515
- [Storage Batch Operations API](/google/cloud/storagebatchoperations/README.md)
1616
- [Device Streaming API](/google/cloud/devicestreaming/README.md)
17+
- [Chronicle API](/google/cloud/chronicle/README.md)
1718

1819
### Updated Libraries
1920

‎README.md

Copy file name to clipboardExpand all lines: README.md
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ See each library's `README.md` file for more information about:
158158
- [Cloud Channel API](google/cloud/channel/README.md)
159159
[[quickstart]](google/cloud/channel/quickstart/README.md)
160160
[[reference]](https://cloud.google.com/cpp/docs/reference/channel/latest)
161+
- [Chronicle API](google/cloud/chronicle/README.md)
162+
[[quickstart]](google/cloud/chronicle/quickstart/README.md)
163+
[[reference]](https://cloud.google.com/cpp/docs/reference/chronicle/latest)
161164
- [Cloud Build API](google/cloud/cloudbuild/README.md)
162165
[[quickstart]](google/cloud/cloudbuild/quickstart/README.md)
163166
[[reference]](https://cloud.google.com/cpp/docs/reference/cloudbuild/latest)
Binary file not shown.

‎ci/etc/expected_install_directories

Copy file name to clipboardExpand all lines: ci/etc/expected_install_directories
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@
182182
./include/google/cloud/channel/v1
183183
./include/google/cloud/channel/v1/internal
184184
./include/google/cloud/channel/v1/mocks
185+
./include/google/cloud/chronicle
186+
./include/google/cloud/chronicle/v1
187+
./include/google/cloud/chronicle/v1/internal
188+
./include/google/cloud/chronicle/v1/mocks
185189
./include/google/cloud/cloudbuild
186190
./include/google/cloud/cloudbuild/mocks
187191
./include/google/cloud/cloudbuild/v1
@@ -1337,6 +1341,8 @@
13371341
./lib64/cmake/google_cloud_cpp_certificatemanager_mocks
13381342
./lib64/cmake/google_cloud_cpp_channel
13391343
./lib64/cmake/google_cloud_cpp_channel_mocks
1344+
./lib64/cmake/google_cloud_cpp_chronicle
1345+
./lib64/cmake/google_cloud_cpp_chronicle_mocks
13401346
./lib64/cmake/google_cloud_cpp_cloudbuild
13411347
./lib64/cmake/google_cloud_cpp_cloudbuild_mocks
13421348
./lib64/cmake/google_cloud_cpp_cloudcontrolspartner

‎cmake/GoogleCloudCppFeatures.cmake

Copy file name to clipboardExpand all lines: cmake/GoogleCloudCppFeatures.cmake
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ set(GOOGLE_CLOUD_CPP_GA_LIBRARIES
6666
"binaryauthorization"
6767
"certificatemanager"
6868
"channel"
69+
"chronicle"
6970
"cloudbuild"
7071
"cloudcontrolspartner"
7172
"cloudquotas"
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@com_google_googleapis//google/api:annotations_proto
2+
@com_google_googleapis//google/api:client_proto
3+
@com_google_googleapis//google/api:field_behavior_proto
4+
@com_google_googleapis//google/api:http_proto
5+
@com_google_googleapis//google/api:launch_stage_proto
6+
@com_google_googleapis//google/api:resource_proto
7+
@com_google_googleapis//google/longrunning:operations_proto
8+
@com_google_googleapis//google/rpc:status_proto
9+
@com_google_googleapis//google/type:interval_proto
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@com_google_googleapis//google/cloud/chronicle/v1:data_access_control.proto
2+
@com_google_googleapis//google/cloud/chronicle/v1:entity.proto
3+
@com_google_googleapis//google/cloud/chronicle/v1:instance.proto
4+
@com_google_googleapis//google/cloud/chronicle/v1:reference_list.proto
5+
@com_google_googleapis//google/cloud/chronicle/v1:rule.proto

‎external/googleapis/update_libraries.sh

Copy file name to clipboardExpand all lines: external/googleapis/update_libraries.sh
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ declare -A -r LIBRARIES=(
9191
"@com_google_googleapis//google/cloud/certificatemanager/v1:certificatemanager_cc_grpc"
9292
)"
9393
["channel"]="@com_google_googleapis//google/cloud/channel/v1:channel_cc_grpc"
94+
["chronicle"]="@com_google_googleapis//google/cloud/chronicle/v1:chronicle_cc_grpc"
9495
["cloudbuild"]="$(
9596
printf ",%s" \
9697
"@com_google_googleapis//google/devtools/cloudbuild/v1:cloudbuild_cc_grpc" \

‎generator/generator_config.textproto

Copy file name to clipboardExpand all lines: generator/generator_config.textproto
+36Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,42 @@ service {
666666
retryable_status_codes: ["kUnavailable"]
667667
}
668668
669+
# Chronicle
670+
service {
671+
service_proto_path: "google/cloud/chronicle/v1/entity.proto"
672+
product_path: "google/cloud/chronicle/v1"
673+
initial_copyright_year: "2025"
674+
retryable_status_codes: ["kUnavailable"]
675+
}
676+
677+
service {
678+
service_proto_path: "google/cloud/chronicle/v1/data_access_control.proto"
679+
product_path: "google/cloud/chronicle/v1"
680+
initial_copyright_year: "2025"
681+
retryable_status_codes: ["kUnavailable"]
682+
}
683+
684+
service {
685+
service_proto_path: "google/cloud/chronicle/v1/instance.proto"
686+
product_path: "google/cloud/chronicle/v1"
687+
initial_copyright_year: "2025"
688+
retryable_status_codes: ["kUnavailable"]
689+
}
690+
691+
service {
692+
service_proto_path: "google/cloud/chronicle/v1/rule.proto"
693+
product_path: "google/cloud/chronicle/v1"
694+
initial_copyright_year: "2025"
695+
retryable_status_codes: ["kUnavailable"]
696+
}
697+
698+
service {
699+
service_proto_path: "google/cloud/chronicle/v1/reference_list.proto"
700+
product_path: "google/cloud/chronicle/v1"
701+
initial_copyright_year: "2025"
702+
retryable_status_codes: ["kUnavailable"]
703+
}
704+
669705
# Cloud Build
670706
service {
671707
service_proto_path: "google/devtools/cloudbuild/v1/cloudbuild.proto"

‎google/cloud/chronicle/BUILD.bazel

Copy file name to clipboard
+31Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
load("//bazel:gapic.bzl", "cc_gapic_library")
16+
17+
package(default_visibility = ["//visibility:private"])
18+
19+
licenses(["notice"]) # Apache 2.0
20+
21+
service_dirs = ["v1/"]
22+
23+
googleapis_deps = [
24+
"@com_google_googleapis//google/cloud/chronicle/v1:chronicle_cc_grpc",
25+
]
26+
27+
cc_gapic_library(
28+
name = "chronicle",
29+
googleapis_deps = googleapis_deps,
30+
service_dirs = service_dirs,
31+
)

‎google/cloud/chronicle/CMakeLists.txt

Copy file name to clipboard
+36Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# ~~~
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
# ~~~
16+
17+
include(GoogleCloudCppLibrary)
18+
19+
google_cloud_cpp_add_gapic_library(chronicle "Chronicle API" SERVICE_DIRS "v1/")
20+
21+
if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS)
22+
add_executable(chronicle_quickstart "quickstart/quickstart.cc")
23+
target_link_libraries(chronicle_quickstart
24+
PRIVATE google-cloud-cpp::chronicle)
25+
google_cloud_cpp_add_common_options(chronicle_quickstart)
26+
add_test(
27+
NAME chronicle_quickstart
28+
COMMAND
29+
cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake"
30+
$<TARGET_FILE:chronicle_quickstart> GOOGLE_CLOUD_PROJECT
31+
GOOGLE_CLOUD_CPP_TEST_REGION "instance-id-x")
32+
set_tests_properties(
33+
chronicle_quickstart
34+
PROPERTIES LABELS "integration-test;quickstart" PASS_REGULAR_EXPRESSION
35+
"Request contains an invalid argument")
36+
endif ()

‎google/cloud/chronicle/README.md

Copy file name to clipboard
+69Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Chronicle API C++ Client Library
2+
3+
This directory contains an idiomatic C++ client library for the
4+
[Chronicle API][cloud-service-docs].
5+
6+
The Chronicle API serves all customer endpoints.
7+
8+
While this library is **GA**, please note that the Google Cloud C++ client
9+
libraries do **not** follow [Semantic Versioning](https://semver.org/).
10+
11+
## Quickstart
12+
13+
The [quickstart/](quickstart/README.md) directory contains a minimal environment
14+
to get started using this client library in a larger project. The following
15+
"Hello World" program is used in this quickstart, and should give you a taste of
16+
this library.
17+
18+
<!-- inject-quickstart-start -->
19+
20+
```cc
21+
#include "google/cloud/chronicle/v1/entity_client.h"
22+
#include "google/cloud/common_options.h"
23+
#include "google/cloud/location.h"
24+
#include <iostream>
25+
26+
int main(int argc, char* argv[]) try {
27+
if (argc != 4) {
28+
std::cerr << "Usage: " << argv[0]
29+
<< " project-id location-id instance-id\n";
30+
return 1;
31+
}
32+
auto const endpoint = "us-chronicle.googleapis.com";
33+
auto const location = google::cloud::Location(argv[1], argv[2]);
34+
auto const instance_id = std::string(argv[3]);
35+
36+
namespace gc = ::google::cloud;
37+
namespace chronicle = ::google::cloud::chronicle_v1;
38+
39+
auto client =
40+
chronicle::EntityServiceClient(chronicle::MakeEntityServiceConnection(
41+
gc::Options{}
42+
.set<gc::EndpointOption>(endpoint)
43+
.set<gc::AuthorityOption>(endpoint)));
44+
45+
for (auto r : client.ListWatchlists(location.FullName() + "/instances/" +
46+
instance_id)) {
47+
if (!r) throw std::move(r).status();
48+
std::cout << r->DebugString() << "\n";
49+
}
50+
51+
return 0;
52+
} catch (google::cloud::Status const& status) {
53+
std::cerr << "google::cloud::Status thrown: " << status << "\n";
54+
return 1;
55+
}
56+
```
57+
58+
<!-- inject-quickstart-end -->
59+
60+
## More Information
61+
62+
- Official documentation about the [Chronicle API][cloud-service-docs] service
63+
- [Reference doxygen documentation][doxygen-link] for each release of this
64+
client library
65+
- Detailed header comments in our [public `.h`][source-link] files
66+
67+
[cloud-service-docs]: https://cloud.google.com/chronicle/docs/secops/secops-overview
68+
[doxygen-link]: https://cloud.google.com/cpp/docs/reference/chronicle/latest/
69+
[source-link]: https://github.com/googleapis/google-cloud-cpp/tree/main/google/cloud/chronicle
+66Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*!
2+
3+
@page chronicle-env Environment Variables
4+
5+
A number of environment variables can be used to configure the behavior of
6+
the library. There are also functions to configure this behavior in code. The
7+
environment variables are convenient when troubleshooting problems.
8+
9+
@section chronicle-env-endpoint Endpoint Overrides
10+
11+
<!-- inject-endpoint-env-vars-start -->
12+
13+
- `GOOGLE_CLOUD_CPP_DATA_ACCESS_CONTROL_SERVICE_ENDPOINT=...` overrides the
14+
`EndpointOption` (which defaults to "chronicle.googleapis.com")
15+
used by `MakeDataAccessControlServiceConnection()`.
16+
17+
- `GOOGLE_CLOUD_CPP_ENTITY_SERVICE_ENDPOINT=...` overrides the
18+
`EndpointOption` (which defaults to "chronicle.googleapis.com")
19+
used by `MakeEntityServiceConnection()`.
20+
21+
- `GOOGLE_CLOUD_CPP_INSTANCE_SERVICE_ENDPOINT=...` overrides the
22+
`EndpointOption` (which defaults to "chronicle.googleapis.com")
23+
used by `MakeInstanceServiceConnection()`.
24+
25+
- `GOOGLE_CLOUD_CPP_REFERENCE_LIST_SERVICE_ENDPOINT=...` overrides the
26+
`EndpointOption` (which defaults to "chronicle.googleapis.com")
27+
used by `MakeReferenceListServiceConnection()`.
28+
29+
- `GOOGLE_CLOUD_CPP_RULE_SERVICE_ENDPOINT=...` overrides the
30+
`EndpointOption` (which defaults to "chronicle.googleapis.com")
31+
used by `MakeRuleServiceConnection()`.
32+
33+
<!-- inject-endpoint-env-vars-end -->
34+
35+
@see google::cloud::EndpointOption
36+
37+
@section chronicle-env-logging Logging
38+
39+
`GOOGLE_CLOUD_CPP_ENABLE_TRACING=rpc`: turns on tracing for most gRPC
40+
calls. The library injects an additional Stub decorator that prints each gRPC
41+
request and response. Unless you have configured your own logging backend,
42+
you should also set `GOOGLE_CLOUD_CPP_ENABLE_CLOG` to produce any output on
43+
the program's console.
44+
45+
@see google::cloud::LoggingComponentsOption
46+
47+
`GOOGLE_CLOUD_CPP_TRACING_OPTIONS=...`: modifies the behavior of gRPC tracing,
48+
including whether messages will be output on multiple lines, or whether
49+
string/bytes fields will be truncated.
50+
51+
@see google::cloud::GrpcTracingOptionsOption
52+
53+
`GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes`: turns on logging in the library, basically
54+
the library always "logs" but the logging infrastructure has no backend to
55+
actually print anything until the application sets a backend or they set this
56+
environment variable.
57+
58+
@see google::cloud::LogBackend
59+
@see google::cloud::LogSink
60+
61+
@section chronicle-env-project Setting the Default Project
62+
63+
`GOOGLE_CLOUD_PROJECT=...`: is used in examples and integration tests to
64+
configure the GCP project. This has no effect in the library.
65+
66+
*/

‎google/cloud/chronicle/doc/main.dox

Copy file name to clipboard
+56Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*!
2+
3+
@mainpage Chronicle API C++ Client Library
4+
5+
An idiomatic C++ client library for the [Chronicle API][cloud-service-docs].
6+
7+
The Chronicle API serves all customer endpoints.
8+
9+
While this library is **GA**, please note that the Google Cloud C++ client libraries do **not** follow
10+
[Semantic Versioning](https://semver.org/).
11+
12+
@tableofcontents{HTML:2}
13+
14+
## Quickstart
15+
16+
The following shows the code that you'll run in the
17+
`google/cloud/chronicle/quickstart/` directory,
18+
which should give you a taste of the Chronicle API C++ client library API.
19+
20+
@snippet quickstart.cc all
21+
22+
## Main classes
23+
24+
<!-- inject-client-list-start -->
25+
This library offers multiple `*Client` classes, which are listed below. Each one
26+
of these classes exposes all the RPCs for a service as member functions of the
27+
class. This library groups multiple services because they are part of the same
28+
product or are often used together. A typical example may be the administrative
29+
and data plane operations for a single product.
30+
31+
The library also has other classes that provide helpers, configuration
32+
parameters, and infrastructure to mock the `*Client` classes when testing your
33+
application.
34+
35+
- [\c chronicle_v1::DataAccessControlServiceClient](@ref google::cloud::chronicle_v1::DataAccessControlServiceClient)
36+
- [\c chronicle_v1::EntityServiceClient](@ref google::cloud::chronicle_v1::EntityServiceClient)
37+
- [\c chronicle_v1::InstanceServiceClient](@ref google::cloud::chronicle_v1::InstanceServiceClient)
38+
- [\c chronicle_v1::ReferenceListServiceClient](@ref google::cloud::chronicle_v1::ReferenceListServiceClient)
39+
- [\c chronicle_v1::RuleServiceClient](@ref google::cloud::chronicle_v1::RuleServiceClient)
40+
<!-- inject-client-list-end -->
41+
42+
## More Information
43+
44+
- @ref common-error-handling - describes how the library reports errors.
45+
- @ref chronicle-override-endpoint - describes how to override the default
46+
endpoint.
47+
- @ref chronicle-override-authentication - describes how to change the
48+
authentication credentials used by the library.
49+
- @ref chronicle-override-retry - describes how to change the default retry
50+
policies.
51+
- @ref chronicle-env - describes environment variables that can configure the
52+
behavior of the library.
53+
54+
[cloud-service-docs]: https://cloud.google.com/chronicle/docs/secops/secops-overview
55+
56+
*/
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*!
2+
@defgroup google-cloud-chronicle-options Chronicle API Configuration Options
3+
4+
This library uses the same mechanism (`google::cloud::Options`) and the common
5+
[options](@ref options) as all other C++ client libraries for its configuration.
6+
Some `*Option` classes, which are only used in this library, are documented in
7+
this page.
8+
9+
@see @ref options - for an overview of client library configuration.
10+
*/

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.