inventory.proto 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. // Copyright 2021 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. syntax = "proto3";
  15. package google.cloud.osconfig.v1alpha;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/protobuf/timestamp.proto";
  19. option csharp_namespace = "Google.Cloud.OsConfig.V1Alpha";
  20. option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1alpha;osconfig";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "Inventories";
  23. option java_package = "com.google.cloud.osconfig.v1alpha";
  24. option php_namespace = "Google\\Cloud\\OsConfig\\V1alpha";
  25. option ruby_package = "Google::Cloud::OsConfig::V1alpha";
  26. // OS Inventory is a service for collecting and reporting operating
  27. // system and package information on VM instances.
  28. // This API resource represents the available inventory data for a
  29. // Compute Engine virtual machine (VM) instance at a given point in time.
  30. //
  31. // You can use this API resource to determine the inventory data of your VM.
  32. //
  33. // For more information, see [Information provided by OS inventory
  34. // management](https://cloud.google.com/compute/docs/instances/os-inventory-management#data-collected).
  35. message Inventory {
  36. option (google.api.resource) = {
  37. type: "osconfig.googleapis.com/Inventory"
  38. pattern: "projects/{project}/locations/{location}/instances/{instance}/inventory"
  39. };
  40. // Operating system information for the VM.
  41. message OsInfo {
  42. // The VM hostname.
  43. string hostname = 9;
  44. // The operating system long name.
  45. // For example 'Debian GNU/Linux 9' or 'Microsoft Window Server 2019
  46. // Datacenter'.
  47. string long_name = 2;
  48. // The operating system short name.
  49. // For example, 'windows' or 'debian'.
  50. string short_name = 3;
  51. // The version of the operating system.
  52. string version = 4;
  53. // The system architecture of the operating system.
  54. string architecture = 5;
  55. // The kernel version of the operating system.
  56. string kernel_version = 6;
  57. // The kernel release of the operating system.
  58. string kernel_release = 7;
  59. // The current version of the OS Config agent running on the VM.
  60. string osconfig_agent_version = 8;
  61. }
  62. // A single piece of inventory on a VM.
  63. message Item {
  64. // The origin of a specific inventory item.
  65. enum OriginType {
  66. // Invalid. An origin type must be specified.
  67. ORIGIN_TYPE_UNSPECIFIED = 0;
  68. // This inventory item was discovered as the result of the agent
  69. // reporting inventory via the reporting API.
  70. INVENTORY_REPORT = 1;
  71. }
  72. // The different types of inventory that are tracked on a VM.
  73. enum Type {
  74. // Invalid. An type must be specified.
  75. TYPE_UNSPECIFIED = 0;
  76. // This represents a package that is installed on the VM.
  77. INSTALLED_PACKAGE = 1;
  78. // This represents an update that is available for a package.
  79. AVAILABLE_PACKAGE = 2;
  80. }
  81. // Identifier for this item, unique across items for this VM.
  82. string id = 1;
  83. // The origin of this inventory item.
  84. OriginType origin_type = 2;
  85. // When this inventory item was first detected.
  86. google.protobuf.Timestamp create_time = 8;
  87. // When this inventory item was last modified.
  88. google.protobuf.Timestamp update_time = 9;
  89. // The specific type of inventory, correlating to its specific details.
  90. Type type = 5;
  91. // Specific details of this inventory item based on its type.
  92. oneof details {
  93. // Software package present on the VM instance.
  94. SoftwarePackage installed_package = 6;
  95. // Software package available to be installed on the VM instance.
  96. SoftwarePackage available_package = 7;
  97. }
  98. }
  99. // Software package information of the operating system.
  100. message SoftwarePackage {
  101. // Information about the different types of software packages.
  102. oneof details {
  103. // Yum package info.
  104. // For details about the yum package manager, see
  105. // https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/ch-yum.
  106. VersionedPackage yum_package = 1;
  107. // Details of an APT package.
  108. // For details about the apt package manager, see
  109. // https://wiki.debian.org/Apt.
  110. VersionedPackage apt_package = 2;
  111. // Details of a Zypper package.
  112. // For details about the Zypper package manager, see
  113. // https://en.opensuse.org/SDB:Zypper_manual.
  114. VersionedPackage zypper_package = 3;
  115. // Details of a Googet package.
  116. // For details about the googet package manager, see
  117. // https://github.com/google/googet.
  118. VersionedPackage googet_package = 4;
  119. // Details of a Zypper patch.
  120. // For details about the Zypper package manager, see
  121. // https://en.opensuse.org/SDB:Zypper_manual.
  122. ZypperPatch zypper_patch = 5;
  123. // Details of a Windows Update package.
  124. // See https://docs.microsoft.com/en-us/windows/win32/api/_wua/ for
  125. // information about Windows Update.
  126. WindowsUpdatePackage wua_package = 6;
  127. // Details of a Windows Quick Fix engineering package.
  128. // See
  129. // https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-quickfixengineering
  130. // for info in Windows Quick Fix Engineering.
  131. WindowsQuickFixEngineeringPackage qfe_package = 7;
  132. // Details of a COS package.
  133. VersionedPackage cos_package = 8;
  134. }
  135. }
  136. // Information related to the a standard versioned package. This includes
  137. // package info for APT, Yum, Zypper, and Googet package managers.
  138. message VersionedPackage {
  139. // The name of the package.
  140. string package_name = 4;
  141. // The system architecture this package is intended for.
  142. string architecture = 2;
  143. // The version of the package.
  144. string version = 3;
  145. }
  146. // Details related to a Zypper Patch.
  147. message ZypperPatch {
  148. // The name of the patch.
  149. string patch_name = 5;
  150. // The category of the patch.
  151. string category = 2;
  152. // The severity specified for this patch
  153. string severity = 3;
  154. // Any summary information provided about this patch.
  155. string summary = 4;
  156. }
  157. // Details related to a Windows Update package.
  158. // Field data and names are taken from Windows Update API IUpdate Interface:
  159. // https://docs.microsoft.com/en-us/windows/win32/api/_wua/
  160. // Descriptive fields like title, and description are localized based on
  161. // the locale of the VM being updated.
  162. message WindowsUpdatePackage {
  163. // Categories specified by the Windows Update.
  164. message WindowsUpdateCategory {
  165. // The identifier of the windows update category.
  166. string id = 1;
  167. // The name of the windows update category.
  168. string name = 2;
  169. }
  170. // The localized title of the update package.
  171. string title = 1;
  172. // The localized description of the update package.
  173. string description = 2;
  174. // The categories that are associated with this update package.
  175. repeated WindowsUpdateCategory categories = 3;
  176. // A collection of Microsoft Knowledge Base article IDs that are associated
  177. // with the update package.
  178. repeated string kb_article_ids = 4;
  179. // A hyperlink to the language-specific support information for the update.
  180. string support_url = 11;
  181. // A collection of URLs that provide more information about the update
  182. // package.
  183. repeated string more_info_urls = 5;
  184. // Gets the identifier of an update package. Stays the same across
  185. // revisions.
  186. string update_id = 6;
  187. // The revision number of this update package.
  188. int32 revision_number = 7;
  189. // The last published date of the update, in (UTC) date and time.
  190. google.protobuf.Timestamp last_deployment_change_time = 10;
  191. }
  192. // Information related to a Quick Fix Engineering package.
  193. // Fields are taken from Windows QuickFixEngineering Interface and match
  194. // the source names:
  195. // https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-quickfixengineering
  196. message WindowsQuickFixEngineeringPackage {
  197. // A short textual description of the QFE update.
  198. string caption = 1;
  199. // A textual description of the QFE update.
  200. string description = 2;
  201. // Unique identifier associated with a particular QFE update.
  202. string hot_fix_id = 3;
  203. // Date that the QFE update was installed. Mapped from installed_on field.
  204. google.protobuf.Timestamp install_time = 5;
  205. }
  206. // Output only. The `Inventory` API resource name.
  207. //
  208. // Format:
  209. // `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory`
  210. string name = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  211. // Output only. Base level operating system information for the VM.
  212. OsInfo os_info = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  213. // Output only. Inventory items related to the VM keyed by an opaque unique identifier for
  214. // each inventory item. The identifier is unique to each distinct and
  215. // addressable inventory item and will change, when there is a new package
  216. // version.
  217. map<string, Item> items = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  218. // Output only. Timestamp of the last reported inventory for the VM.
  219. google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  220. }
  221. // A request message for getting inventory data for the specified VM.
  222. message GetInventoryRequest {
  223. // Required. API resource name for inventory resource.
  224. //
  225. // Format:
  226. // `projects/{project}/locations/{location}/instances/{instance}/inventory`
  227. //
  228. // For `{project}`, either `project-number` or `project-id` can be provided.
  229. // For `{instance}`, either Compute Engine `instance-id` or `instance-name`
  230. // can be provided.
  231. string name = 1 [
  232. (google.api.field_behavior) = REQUIRED,
  233. (google.api.resource_reference) = {
  234. type: "osconfig.googleapis.com/Inventory"
  235. }
  236. ];
  237. // Inventory view indicating what information should be included in the
  238. // inventory resource. If unspecified, the default view is BASIC.
  239. InventoryView view = 2;
  240. }
  241. // A request message for listing inventory data for all VMs in the specified
  242. // location.
  243. message ListInventoriesRequest {
  244. // Required. The parent resource name.
  245. //
  246. // Format: `projects/{project}/locations/{location}/instances/{instance}`
  247. //
  248. // For `{project}`, either `project-number` or `project-id` can be
  249. // provided. For `{instance}`, only hyphen or dash character is supported to
  250. // list inventories across VMs.
  251. string parent = 1 [
  252. (google.api.field_behavior) = REQUIRED,
  253. (google.api.resource_reference) = {
  254. type: "compute.googleapis.com/Instance"
  255. }
  256. ];
  257. // Inventory view indicating what information should be included in the
  258. // inventory resource. If unspecified, the default view is BASIC.
  259. InventoryView view = 2;
  260. // The maximum number of results to return.
  261. int32 page_size = 3;
  262. // A pagination token returned from a previous call to
  263. // `ListInventories` that indicates where this listing
  264. // should continue from.
  265. string page_token = 4;
  266. // If provided, this field specifies the criteria that must be met by a
  267. // `Inventory` API resource to be included in the response.
  268. string filter = 5;
  269. }
  270. // A response message for listing inventory data for all VMs in a specified
  271. // location.
  272. message ListInventoriesResponse {
  273. // List of inventory objects.
  274. repeated Inventory inventories = 1;
  275. // The pagination token to retrieve the next page of inventory objects.
  276. string next_page_token = 2;
  277. }
  278. // The view for inventory objects.
  279. enum InventoryView {
  280. // The default value.
  281. // The API defaults to the BASIC view.
  282. INVENTORY_VIEW_UNSPECIFIED = 0;
  283. // Returns the basic inventory information that includes `os_info`.
  284. BASIC = 1;
  285. // Returns all fields.
  286. FULL = 2;
  287. }