| // Copyright 2021 Google LLC |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| // Protobuf definitions for the instance configuration sent by an update manager |
| // to Spiny. Spiny will translate the instance configuration to device policy that |
| // update_engine and other services can understand. |
| syntax = "proto2"; |
| |
| package policymanagerproto; |
| |
| // InstanceUpdateConfig contains all the necessary fields for Spiny to |
| // generate a valid update policy. The config is generated by an update manager |
| // to enforce the update strategy set by the user. |
| // DEPRECATED. |
| message InstanceUpdateConfig { |
| // target_version_prefix is the prefix of the highest version number that the |
| // instance should update to. |
| // Leave empty ("") if there are no restrictions. |
| // For example, "1203." would allow for all updates within major version 1203. |
| // On the other hand, "1203.19.93" would only allow updates to version |
| // 1203.19.93. |
| optional string target_version_prefix = 1; |
| |
| // reboot_after_update is set to true if the instance should reboot |
| // immediately after an update has been downloaded and installed. |
| optional bool reboot_after_update = 2 [default = false]; |
| |
| // scatter_factor_in_seconds is the maximum number of seconds up to which the |
| // instance should randomly delay its download of the update. It's useful for |
| // preventing all instances from trying to download the update simultaneously |
| // and eat up all the bandwidth. |
| optional int64 scatter_factor_in_seconds = 3; |
| |
| // Next number: 4 |
| } |
| |
| // StackdriverConfig contains all the necessary fields for Spiny to store any |
| // information related to the configuration of stackdriver logging/monitoring. |
| // DEPRECATED |
| message StackdriverConfig { |
| // enforced is set to true if Spiny should enfore the stackdriver logging and |
| // monitoring to the instance. |
| optional bool enforced = 1; |
| |
| // logging_enabled is set to true if the instance should export logs |
| // to google cloud logging backend. |
| optional bool logging_enabled = 2; |
| |
| // monitoring_enabled is set to true if the instance should report |
| // monitoring statistics to google cloud monitoring backend. |
| optional bool monitoring_enabled = 3; |
| |
| // Next number: 4 |
| } |
| |
| // HealthMonitorConfig contains all the necessary fields for policy manager to store any |
| // information related to the configuration of HealthMonitor logging/monitoring. |
| message HealthMonitorConfig { |
| // enforced is set to true if policy manager should enforce the HealthMonitoring logging and |
| // monitoring to the instance. |
| optional bool enforced = 1; |
| |
| // logging_enabled is set to true if the instance should report logs |
| // to google cloud logging backend. |
| optional bool logging_enabled = 2; |
| |
| // monitoring_enabled is set to true if the instance should report |
| // monitoring statistics to google cloud monitoring backend. |
| optional bool monitoring_enabled = 3; |
| } |
| |
| // InstanceConfig contains the details necessary for configuring the instance. |
| // This proto is used in following places: |
| // (1) In user specified GCE Metadata - User can specify JSON formatted |
| // InstanceConfig in GCE metadata which is fetched and parsed by Spiny. |
| // (2) From Spiny to API Server - Spiny sends this InstanceConfig as |
| // 'user_config' argument to the GetInstanceConfig() call. |
| // (3) From API Server to Spiny client - in response to GetInstanceConfig() |
| // call, the server sends the actual InstanceConfig to be applied on the |
| // COS instance. |
| message InstanceConfig { |
| // update_config specifies the update policy settings. |
| // DEPRECATED. Fields in InstanceUpdateConfig are now available in this |
| // message itself. Please use those instead. |
| optional InstanceUpdateConfig update_config = 1; |
| |
| // metrics_enabled indicates whether metrics reporting should be enabled. This |
| // corresponds to the metrics_enabled flag of the ChromeDeviceSettingsProto. |
| // Besides metrics this flag also governs crash reporting. |
| optional bool metrics_enabled = 2; |
| |
| // Only one of 'update_strategy' and 'target_version_prefix' should be |
| // specified. |
| // TODO: This should be 'oneof' when client moves to using proto3. |
| |
| // update_strategy is the value of the update strategy to use. |
| // EX.: "update_disabled", "cos-dev-93-16442-0-0", etc. |
| optional string update_strategy = 3; |
| |
| // target_version_prefix is the prefix of the highest version number that the |
| // instance should update to. |
| // Leave empty ("") if there are no restrictions. |
| // For example, "1203." would allow for all updates within major version 1203. |
| // On the other hand, "1203.19.93" would only allow updates to version |
| // 1203.19.93. |
| optional string target_version_prefix = 4; |
| |
| // update_scatter_seconds is the maximum number of seconds up to which the |
| // instance should randomly delay its download of the update. It's useful for |
| // preventing all instances from trying to download the update simultaneously |
| // and eat up all the bandwidth. |
| // This corresponds to 'AutoUpdateSettingsProto.scatter_factor_in_seconds' in |
| // chrome_device_policy.proto |
| optional int64 update_scatter_seconds = 5; |
| |
| // reboot_after_update is set to true if the instance should reboot |
| // immediately after an update has been downloaded and installed. |
| optional bool reboot_after_update = 6; |
| |
| // stackdriver_config specifies configuration about stackdriver logging/monitoring. |
| optional StackdriverConfig stackdriver_config = 9; |
| |
| // health_monitor_config specifies configuration about health logging/monitoring. |
| optional HealthMonitorConfig health_monitor_config = 10; |
| |
| reserved 7, 8; |
| // Next number: 11 |
| } |