inventory.proto 13 KB

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