Skip to main content

oci_rust_sdk/core/models/
instance_agent_config.rs

1use serde::{Deserialize, Serialize};
2
3#[allow(unused_imports)]
4use super::*;
5/// Configuration options for the Oracle Cloud Agent software running on the instance.
6#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct InstanceAgentConfig {
9    /// Whether Oracle Cloud Agent can gather performance metrics and monitor the instance using the monitoring plugins. <p> These are the monitoring plugins: Compute Instance Monitoring and Custom Logs Monitoring. <p> The monitoring plugins are controlled by this parameter and by the per-plugin configuration in the {@code pluginsConfig} object. <p> - If {@code isMonitoringDisabled} is true, all of the monitoring plugins are disabled, regardless of the per-plugin configuration. - If {@code isMonitoringDisabled} is false, all of the monitoring plugins are enabled. You can optionally disable individual monitoring plugins by providing a value in the {@code pluginsConfig} object.
10    #[serde(skip_serializing_if = "Option::is_none")]
11    pub is_monitoring_disabled: Option<bool>,
12
13    /// Whether Oracle Cloud Agent can run all the available management plugins. <p> These are the management plugins: OS Management Service Agent and Compute Instance Run Command. <p> The management plugins are controlled by this parameter and by the per-plugin configuration in the {@code pluginsConfig} object. <p> - If {@code isManagementDisabled} is true, all of the management plugins are disabled, regardless of the per-plugin configuration. - If {@code isManagementDisabled} is false, all of the management plugins are enabled. You can optionally disable individual management plugins by providing a value in the {@code pluginsConfig} object.
14    #[serde(skip_serializing_if = "Option::is_none")]
15    pub is_management_disabled: Option<bool>,
16
17    /// Whether Oracle Cloud Agent can run all of the available plugins. This includes the management and monitoring plugins. <p> For more information about the available plugins, see [Managing Plugins with Oracle Cloud Agent](https://docs.oracle.com/iaas/Content/Compute/Tasks/manage-plugins.htm).
18    #[serde(skip_serializing_if = "Option::is_none")]
19    pub are_all_plugins_disabled: Option<bool>,
20
21    /// The configuration of plugins associated with this instance.
22    #[serde(skip_serializing_if = "Option::is_none")]
23    pub plugins_config: Option<Vec<InstanceAgentPluginConfigDetails>>,
24}
25
26impl InstanceAgentConfig {
27    /// Create a new InstanceAgentConfig
28    pub fn new() -> Self {
29        Self {
30            is_monitoring_disabled: None,
31
32            is_management_disabled: None,
33
34            are_all_plugins_disabled: None,
35
36            plugins_config: None,
37        }
38    }
39
40    /// Set is_monitoring_disabled
41    pub fn set_is_monitoring_disabled(mut self, value: Option<bool>) -> Self {
42        self.is_monitoring_disabled = value;
43        self
44    }
45
46    /// Set is_management_disabled
47    pub fn set_is_management_disabled(mut self, value: Option<bool>) -> Self {
48        self.is_management_disabled = value;
49        self
50    }
51
52    /// Set are_all_plugins_disabled
53    pub fn set_are_all_plugins_disabled(mut self, value: Option<bool>) -> Self {
54        self.are_all_plugins_disabled = value;
55        self
56    }
57
58    /// Set plugins_config
59    pub fn set_plugins_config(
60        mut self,
61        value: Option<Vec<InstanceAgentPluginConfigDetails>>,
62    ) -> Self {
63        self.plugins_config = value;
64        self
65    }
66
67    /// Set is_monitoring_disabled (unwraps Option)
68    pub fn with_is_monitoring_disabled(mut self, value: bool) -> Self {
69        self.is_monitoring_disabled = Some(value);
70        self
71    }
72
73    /// Set is_management_disabled (unwraps Option)
74    pub fn with_is_management_disabled(mut self, value: bool) -> Self {
75        self.is_management_disabled = Some(value);
76        self
77    }
78
79    /// Set are_all_plugins_disabled (unwraps Option)
80    pub fn with_are_all_plugins_disabled(mut self, value: bool) -> Self {
81        self.are_all_plugins_disabled = Some(value);
82        self
83    }
84
85    /// Set plugins_config (unwraps Option)
86    pub fn with_plugins_config(mut self, value: Vec<InstanceAgentPluginConfigDetails>) -> Self {
87        self.plugins_config = Some(value);
88        self
89    }
90}
91
92impl Default for InstanceAgentConfig {
93    fn default() -> Self {
94        Self::new()
95    }
96}