1- // Copyright 2020 Google LLC
1+ // Copyright 2021 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.
@@ -16,6 +16,8 @@ syntax = "proto3";
1616
1717package google.cloud.osconfig.v1 ;
1818
19+ import "google/api/field_behavior.proto" ;
20+ import "google/api/resource.proto" ;
1921import "google/protobuf/timestamp.proto" ;
2022import "google/type/date.proto" ;
2123
@@ -30,8 +32,19 @@ option ruby_package = "Google::Cloud::OsConfig::V1";
3032// OS Config Inventory is a service for collecting and reporting operating
3133// system and package information on VM instances.
3234
33- // The inventory details of a VM.
35+ // This API resource represents the available inventory data for a
36+ // Compute Engine virtual machine (VM) instance at a given point in time.
37+ //
38+ // You can use this API resource to determine the inventory data of your VM.
39+ //
40+ // For more information, see [Information provided by OS inventory
41+ // management](https://cloud.google.com/compute/docs/instances/os-inventory-management#data-collected).
3442message Inventory {
43+ option (google.api.resource ) = {
44+ type : "osconfig.googleapis.com/Inventory"
45+ pattern : "projects/{project}/locations/{location}/instances/{instance}/inventory"
46+ };
47+
3548 // Operating system information for the VM.
3649 message OsInfo {
3750 // The VM hostname.
@@ -154,7 +167,7 @@ message Inventory {
154167 // Details of a COS package.
155168 VersionedPackage cos_package = 8 ;
156169
157- // Details of a Windows Application
170+ // Details of Windows Application.
158171 WindowsApplication windows_application = 9 ;
159172 }
160173 }
@@ -172,6 +185,21 @@ message Inventory {
172185 string version = 3 ;
173186 }
174187
188+ // Details related to a Zypper Patch.
189+ message ZypperPatch {
190+ // The name of the patch.
191+ string patch_name = 5 ;
192+
193+ // The category of the patch.
194+ string category = 2 ;
195+
196+ // The severity specified for this patch
197+ string severity = 3 ;
198+
199+ // Any summary information provided about this patch.
200+ string summary = 4 ;
201+ }
202+
175203 // Details related to a Windows Update package.
176204 // Field data and names are taken from Windows Update API IUpdate Interface:
177205 // https://docs.microsoft.com/en-us/windows/win32/api/_wua/
@@ -218,21 +246,6 @@ message Inventory {
218246 google.protobuf.Timestamp last_deployment_change_time = 10 ;
219247 }
220248
221- // Details related to a Zypper Patch.
222- message ZypperPatch {
223- // The name of the patch.
224- string patch_name = 5 ;
225-
226- // The category of the patch.
227- string category = 2 ;
228-
229- // The severity specified for this patch
230- string severity = 3 ;
231-
232- // Any summary information provided about this patch.
233- string summary = 4 ;
234- }
235-
236249 // Information related to a Quick Fix Engineering package.
237250 // Fields are taken from Windows QuickFixEngineering Interface and match
238251 // the source names:
@@ -276,6 +289,12 @@ message Inventory {
276289 string help_link = 5 ;
277290 }
278291
292+ // Output only. The `Inventory` API resource name.
293+ //
294+ // Format:
295+ // `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory`
296+ string name = 3 [(google.api.field_behavior ) = OUTPUT_ONLY ];
297+
279298 // Base level operating system information for the VM.
280299 OsInfo os_info = 1 ;
281300
@@ -284,4 +303,84 @@ message Inventory {
284303 // addressable inventory item and will change, when there is a new package
285304 // version.
286305 map <string , Item > items = 2 ;
306+
307+ // Output only. Timestamp of the last reported inventory for the VM.
308+ google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior ) = OUTPUT_ONLY ];
309+ }
310+
311+ // A request message for getting inventory data for the specified VM.
312+ message GetInventoryRequest {
313+ // Required. API resource name for inventory resource.
314+ //
315+ // Format:
316+ // `projects/{project}/locations/{location}/instances/{instance}/inventory`
317+ //
318+ // For `{project}`, either `project-number` or `project-id` can be provided.
319+ // For `{instance}`, either Compute Engine `instance-id` or `instance-name`
320+ // can be provided.
321+ string name = 1 [
322+ (google.api.field_behavior ) = REQUIRED ,
323+ (google.api.resource_reference ) = {
324+ type : "osconfig.googleapis.com/Inventory"
325+ }
326+ ];
327+
328+ // Inventory view indicating what information should be included in the
329+ // inventory resource. If unspecified, the default view is BASIC.
330+ InventoryView view = 2 ;
331+ }
332+
333+ // A request message for listing inventory data for all VMs in the specified
334+ // location.
335+ message ListInventoriesRequest {
336+ // Required. The parent resource name.
337+ //
338+ // Format: `projects/{project}/locations/{location}/instances/-`
339+ //
340+ // For `{project}`, either `project-number` or `project-id` can be provided.
341+ string parent = 1 [
342+ (google.api.field_behavior ) = REQUIRED ,
343+ (google.api.resource_reference ) = {
344+ type : "compute.googleapis.com/Instance"
345+ }
346+ ];
347+
348+ // Inventory view indicating what information should be included in the
349+ // inventory resource. If unspecified, the default view is BASIC.
350+ InventoryView view = 2 ;
351+
352+ // The maximum number of results to return.
353+ int32 page_size = 3 ;
354+
355+ // A pagination token returned from a previous call to
356+ // `ListInventories` that indicates where this listing
357+ // should continue from.
358+ string page_token = 4 ;
359+
360+ // If provided, this field specifies the criteria that must be met by a
361+ // `Inventory` API resource to be included in the response.
362+ string filter = 5 ;
363+ }
364+
365+ // A response message for listing inventory data for all VMs in a specified
366+ // location.
367+ message ListInventoriesResponse {
368+ // List of inventory objects.
369+ repeated Inventory inventories = 1 ;
370+
371+ // The pagination token to retrieve the next page of inventory objects.
372+ string next_page_token = 2 ;
373+ }
374+
375+ // The view for inventory objects.
376+ enum InventoryView {
377+ // The default value.
378+ // The API defaults to the BASIC view.
379+ INVENTORY_VIEW_UNSPECIFIED = 0 ;
380+
381+ // Returns the basic inventory information that includes `os_info`.
382+ BASIC = 1 ;
383+
384+ // Returns all fields.
385+ FULL = 2 ;
287386}
0 commit comments