Skip to content

Commit 46c183b

Browse files
Google APIscopybara-github
authored andcommitted
feat: add new ReportVmInventory endpoint along with new request and response messages
docs: A comment for message `Inventory` is changed docs: A comment for field `enforce` in message `.google.cloud.osconfig.agentendpoint.v1.OSPolicy` is changed docs: A comment for service `AgentEndpointService` is changed docs: A comment for message `OSPolicyResourceConfigStep` is changed docs: A comment for message `OSPolicy` is changed docs: A comment for message `PatchConfig` is changed docs: A comment for enum `TaskDirective` is changed docs: A comment for message `ExecResource` in message `.google.cloud.osconfig.agentendpoint.v1.OSPolicy` is changed docs: A comment for field `DEFINITION` in enum `Classification` is changed docs: A comment for field `DESIRED_STATE_ENFORCEMENT` in enum `Type` is changed docs: A comment for field `DESIRED_STATE_CHECK_POST_ENFORCEMENT` in enum `Type` is changed PiperOrigin-RevId: 862617642
1 parent fe6c208 commit 46c183b

File tree

12 files changed

+244
-30
lines changed

12 files changed

+244
-30
lines changed

google/cloud/osconfig/agentendpoint/v1/BUILD.bazel

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@
99
# * extra_protoc_file_parameters
1010
# The complete list of preserved parameters can be found in the source code.
1111

12+
# buildifier: disable=load-on-top
13+
1214
# This is an API workspace, having public visibility by default makes perfect sense.
1315
package(default_visibility = ["//visibility:public"])
1416

1517
##############################################################################
1618
# Common
1719
##############################################################################
18-
load("@rules_proto//proto:defs.bzl", "proto_library")
20+
# buildifier: disable=same-origin-load
1921
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
22+
load("@rules_proto//proto:defs.bzl", "proto_library")
2023

2124
proto_library(
2225
name = "agentendpoint_proto",
@@ -27,13 +30,16 @@ proto_library(
2730
"os_policy.proto",
2831
"patch_jobs.proto",
2932
"tasks.proto",
33+
"vm_inventory.proto",
3034
],
3135
deps = [
3236
"//google/api:annotations_proto",
3337
"//google/api:client_proto",
3438
"//google/api:field_behavior_proto",
3539
"//google/api:resource_proto",
40+
"//google/longrunning:operations_proto",
3641
"//google/type:date_proto",
42+
"@com_google_protobuf//:struct_proto",
3743
"@com_google_protobuf//:timestamp_proto",
3844
],
3945
)
@@ -49,6 +55,7 @@ proto_library_with_info(
4955
##############################################################################
5056
# Java
5157
##############################################################################
58+
# buildifier: disable=same-origin-load
5259
load(
5360
"@com_google_googleapis_imports//:imports.bzl",
5461
"java_gapic_assembly_gradle_pkg",
@@ -72,6 +79,7 @@ java_grpc_library(
7279
java_gapic_library(
7380
name = "agentendpoint_java_gapic",
7481
srcs = [":agentendpoint_proto_with_info"],
82+
gapic_yaml = None,
7583
grpc_service_config = "agentendpoint_grpc_service_config.json",
7684
rest_numeric_enums = True,
7785
service_yaml = "osconfig_v1.yaml",
@@ -109,6 +117,7 @@ java_gapic_assembly_gradle_pkg(
109117
##############################################################################
110118
# Go
111119
##############################################################################
120+
# buildifier: disable=same-origin-load
112121
load(
113122
"@com_google_googleapis_imports//:imports.bzl",
114123
"go_gapic_assembly_pkg",
@@ -122,6 +131,7 @@ go_grpc_library(
122131
protos = [":agentendpoint_proto"],
123132
deps = [
124133
"//google/api:annotations_go_proto",
134+
"//google/longrunning:longrunning_go_proto",
125135
"//google/type:date_go_proto",
126136
],
127137
)
@@ -138,6 +148,10 @@ go_gapic_library(
138148
transport = "grpc+rest",
139149
deps = [
140150
":agentendpoint_go_proto",
151+
"//google/longrunning:longrunning_go_proto",
152+
"@com_google_cloud_go_longrunning//:go_default_library",
153+
"@com_google_cloud_go_longrunning//autogen:go_default_library",
154+
"@io_bazel_rules_go//proto/wkt:struct_go_proto",
141155
],
142156
)
143157

@@ -156,6 +170,7 @@ go_gapic_assembly_pkg(
156170
##############################################################################
157171
# Python
158172
##############################################################################
173+
# buildifier: disable=same-origin-load
159174
load(
160175
"@com_google_googleapis_imports//:imports.bzl",
161176
"py_gapic_assembly_pkg",
@@ -170,6 +185,8 @@ py_gapic_library(
170185
rest_numeric_enums = True,
171186
service_yaml = "osconfig_v1.yaml",
172187
transport = "grpc",
188+
deps = [
189+
],
173190
)
174191

175192
py_test(
@@ -193,6 +210,7 @@ py_gapic_assembly_pkg(
193210
##############################################################################
194211
# PHP
195212
##############################################################################
213+
# buildifier: disable=same-origin-load
196214
load(
197215
"@com_google_googleapis_imports//:imports.bzl",
198216
"php_gapic_assembly_pkg",
@@ -209,10 +227,13 @@ php_gapic_library(
209227
name = "agentendpoint_php_gapic",
210228
srcs = [":agentendpoint_proto_with_info"],
211229
grpc_service_config = "agentendpoint_grpc_service_config.json",
230+
migration_mode = "PRE_MIGRATION_SURFACE_ONLY",
212231
rest_numeric_enums = True,
213232
service_yaml = "osconfig_v1.yaml",
214233
transport = "grpc+rest",
215-
deps = [":agentendpoint_php_proto"],
234+
deps = [
235+
":agentendpoint_php_proto",
236+
],
216237
)
217238

218239
# Open Source Packages
@@ -227,6 +248,7 @@ php_gapic_assembly_pkg(
227248
##############################################################################
228249
# Node.js
229250
##############################################################################
251+
# buildifier: disable=same-origin-load
230252
load(
231253
"@com_google_googleapis_imports//:imports.bzl",
232254
"nodejs_gapic_assembly_pkg",
@@ -257,6 +279,7 @@ nodejs_gapic_assembly_pkg(
257279
##############################################################################
258280
# Ruby
259281
##############################################################################
282+
# buildifier: disable=same-origin-load
260283
load(
261284
"@com_google_googleapis_imports//:imports.bzl",
262285
"ruby_cloud_gapic_library",
@@ -303,6 +326,7 @@ ruby_gapic_assembly_pkg(
303326
##############################################################################
304327
# C#
305328
##############################################################################
329+
# buildifier: disable=same-origin-load
306330
load(
307331
"@com_google_googleapis_imports//:imports.bzl",
308332
"csharp_gapic_assembly_pkg",
@@ -313,6 +337,7 @@ load(
313337

314338
csharp_proto_library(
315339
name = "agentendpoint_csharp_proto",
340+
extra_opts = [],
316341
deps = [":agentendpoint_proto"],
317342
)
318343

@@ -349,6 +374,7 @@ csharp_gapic_assembly_pkg(
349374
##############################################################################
350375
# C++
351376
##############################################################################
377+
# buildifier: disable=same-origin-load
352378
load(
353379
"@com_google_googleapis_imports//:imports.bzl",
354380
"cc_grpc_library",

google/cloud/osconfig/agentendpoint/v1/agentendpoint.proto

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@ import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
2222
import "google/cloud/osconfig/agentendpoint/v1/inventory.proto";
2323
import "google/cloud/osconfig/agentendpoint/v1/tasks.proto";
24+
import "google/cloud/osconfig/agentendpoint/v1/vm_inventory.proto";
2425

2526
option go_package = "cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb;agentendpointpb";
2627
option java_multiple_files = true;
@@ -69,6 +70,13 @@ service AgentEndpointService {
6970
option (google.api.method_signature) =
7071
"instance_id_token,inventory_checksum,inventory";
7172
}
73+
74+
// Reports the VMs current inventory.
75+
rpc ReportVmInventory(ReportVmInventoryRequest)
76+
returns (ReportVmInventoryResponse) {
77+
option (google.api.method_signature) =
78+
"instance_id_token,inventory_checksum,vm_inventory";
79+
}
7280
}
7381

7482
// A request message to receive task notifications.
@@ -236,3 +244,27 @@ message ReportInventoryResponse {
236244
// If true, the full inventory should be reported back to the server.
237245
bool report_full_inventory = 1;
238246
}
247+
248+
// The request message for reporting the agent's VM inventory.
249+
message ReportVmInventoryRequest {
250+
// Required. This is the Compute Engine instance identity token described in
251+
// https://cloud.google.com/compute/docs/instances/verifying-instance-identity
252+
// where the audience is 'osconfig.googleapis.com' and the format is 'full'.
253+
string instance_id_token = 1 [(google.api.field_behavior) = REQUIRED];
254+
255+
// Required. This is a client created checksum that should be generated based
256+
// on the contents of the reported inventory. This will be used by the service
257+
// to determine if it has the latest version of inventory.
258+
string inventory_checksum = 2 [(google.api.field_behavior) = REQUIRED];
259+
260+
// Optional. This is the details of the VM inventory. Should only be provided
261+
// if the inventory has changed since the last report, or if instructed by the
262+
// service to provide full inventory.
263+
VmInventory vm_inventory = 3 [(google.api.field_behavior) = OPTIONAL];
264+
}
265+
266+
// The response message after the agent has reported VM inventory.
267+
message ReportVmInventoryResponse {
268+
// If true, the full inventory should be reported back to the server.
269+
bool report_full_inventory = 1;
270+
}

google/cloud/osconfig/agentendpoint/v1/config_common.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -35,10 +35,10 @@ message OSPolicyResourceConfigStep {
3535
// Check the current desired state status of the resource.
3636
DESIRED_STATE_CHECK = 2;
3737

38-
// Enforce the desired state for a resource that is not in desired state.
38+
// Apply the desired state for a resource that is not in desired state.
3939
DESIRED_STATE_ENFORCEMENT = 3;
4040

41-
// Re-check desired state status for a resource after enforcement of all
41+
// Re-check desired state status for a resource after applying all
4242
// resources in the current configuration run.
4343
//
4444
// This step is used to determine the final desired state status for the

google/cloud/osconfig/agentendpoint/v1/inventory.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -111,7 +111,7 @@ message Inventory {
111111
// Information related to the a standard versioned package. This includes
112112
// package info for APT, Yum, Zypper, and Googet package managers.
113113
message VersionedPackage {
114-
// Information related to the actuall source of the versioned package. This
114+
// Information related to the actual source of the versioned package. This
115115
// includes source package name and version if available.
116116
message Source {
117117
// Required. The name of the source package.

google/cloud/osconfig/agentendpoint/v1/os_policy.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -307,7 +307,7 @@ message OSPolicy {
307307
}
308308
}
309309

310-
// A resource that contains custom validation and enforcement steps.
310+
// A resource that contains custom validation and execution steps.
311311
message ExecResource {
312312
// A file or script to execute.
313313
message Exec {
@@ -362,7 +362,7 @@ message OSPolicy {
362362
Exec validate = 1 [(google.api.field_behavior) = REQUIRED];
363363

364364
// What to run to bring this resource into the desired state.
365-
// A exit code of 100 indicates "success", any other exit code idicates a
365+
// A exit code of 100 indicates "success", any other exit code indicates a
366366
// failure running enforce.
367367
Exec enforce = 2;
368368
}

google/cloud/osconfig/agentendpoint/v1/patch_jobs.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -176,7 +176,7 @@ message WindowsUpdateSettings {
176176

177177
// "A widely released and frequent software update that contains additions
178178
// to a product’s definition database. Definition databases are often used
179-
// to detect objects that have specific attributes, such as malicious code,
179+
// to detect objects that have specific attributes, such as harmful code,
180180
// phishing websites, or junk mail." [1]
181181
DEFINITION = 3;
182182

google/cloud/osconfig/agentendpoint/v1/tasks.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// Copyright 2026 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+
// http://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+
syntax = "proto3";
16+
17+
package google.cloud.osconfig.agentendpoint.v1;
18+
19+
import "google/api/field_behavior.proto";
20+
import "google/protobuf/struct.proto";
21+
22+
option go_package = "cloud.google.com/go/osconfig/agentendpoint/apiv1/agentendpointpb;agentendpointpb";
23+
option java_multiple_files = true;
24+
option java_outer_classname = "VmInventoryProto";
25+
option java_package = "com.google.cloud.osconfig.agentendpoint.v1";
26+
27+
// OS Config VM Inventory is a service for collecting and reporting operating
28+
// system and package information on VM instances.
29+
30+
// The inventory details of a VM.
31+
message VmInventory {
32+
// Operating system information for the VM.
33+
message OsInfo {
34+
// Required. The VM hostname.
35+
string host_name = 1 [(google.api.field_behavior) = REQUIRED];
36+
37+
// Optional. The operating system long name.
38+
// For example 'Debian GNU/Linux 9' or 'Microsoft Window Server 2019
39+
// Datacenter'.
40+
string long_name = 2 [(google.api.field_behavior) = OPTIONAL];
41+
42+
// Required. The operating system short name.
43+
// For example, 'windows' or 'debian'.
44+
string short_name = 3 [(google.api.field_behavior) = REQUIRED];
45+
46+
// Optional. The version of the operating system.
47+
string version = 4 [(google.api.field_behavior) = OPTIONAL];
48+
49+
// Required. The system architecture of the operating system.
50+
string architecture = 5 [(google.api.field_behavior) = REQUIRED];
51+
52+
// Optional. The kernel version of the operating system.
53+
string kernel_version = 6 [(google.api.field_behavior) = OPTIONAL];
54+
55+
// Optional. The kernel release of the operating system.
56+
string kernel_release = 7 [(google.api.field_behavior) = OPTIONAL];
57+
58+
// Required. The current version of the OS Config agent running on the VM.
59+
string osconfig_agent_version = 8 [(google.api.field_behavior) = REQUIRED];
60+
}
61+
62+
// A VM package representation.
63+
message InventoryItem {
64+
// Required. Human-readable name of the software, to show to the user.
65+
string name = 1 [(google.api.field_behavior) = REQUIRED];
66+
67+
// Required. Package type, e.g. "java/maven", "javascript/npm", "os/dpkg"
68+
string type = 2 [(google.api.field_behavior) = REQUIRED];
69+
70+
// Required. Version of the package.
71+
string version = 3 [(google.api.field_behavior) = REQUIRED];
72+
73+
// Required. Purl is a package identifier.
74+
string purl = 4 [(google.api.field_behavior) = REQUIRED];
75+
76+
// Required. Path or source of files related to the package.
77+
repeated string location = 5 [(google.api.field_behavior) = REQUIRED];
78+
79+
// Optional. Metadata of the package extracted by extractor.
80+
google.protobuf.Struct metadata = 6
81+
[(google.api.field_behavior) = OPTIONAL];
82+
}
83+
84+
// Required. Base level operating system information for the VM.
85+
OsInfo os_info = 1 [(google.api.field_behavior) = REQUIRED];
86+
87+
// Required. A list of installed packages currently on the VM.
88+
repeated InventoryItem installed_packages = 2
89+
[(google.api.field_behavior) = REQUIRED];
90+
91+
// Required. A list of software updates available for the VM as reported by
92+
// the update managers.
93+
repeated InventoryItem available_packages = 3
94+
[(google.api.field_behavior) = REQUIRED];
95+
}

0 commit comments

Comments
 (0)