diff --git a/plugins/modules/gcp_compute_autoscaler.py b/plugins/modules/gcp_compute_autoscaler.py index cf05846..5454456 100644 --- a/plugins/modules/gcp_compute_autoscaler.py +++ b/plugins/modules/gcp_compute_autoscaler.py @@ -165,6 +165,18 @@ options: type: str aliases: - target + predictive_method: + description: + - 'Indicates whether predictive autoscaling based on CPU metric is enabled. + Valid values are: - NONE (default). No predictive method is used. The + autoscaler scales the group to meet current demand based on real-time + metrics.' + - "- OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability + by monitoring daily and weekly load patterns and scaling out ahead of + anticipated demand." + required: false + default: NONE + type: str custom_metric_utilizations: description: - Configuration parameters of autoscaling based on a custom metric. @@ -476,6 +488,17 @@ autoscalingPolicy: the average utilization reaches the target utilization. returned: success type: str + predictiveMethod: + description: + - 'Indicates whether predictive autoscaling based on CPU metric is enabled. + Valid values are: - NONE (default). No predictive method is used. The + autoscaler scales the group to meet current demand based on real-time + metrics.' + - "- OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability + by monitoring daily and weekly load patterns and scaling out ahead of + anticipated demand." + returned: success + type: str customMetricUtilizations: description: - Configuration parameters of autoscaling based on a custom metric. @@ -572,7 +595,9 @@ def main(): time_window_sec=dict(type='int'), ), ), - cpu_utilization=dict(type='dict', options=dict(utilization_target=dict(type='str', aliases=['target']))), + cpu_utilization=dict( + type='dict', options=dict(utilization_target=dict(type='str', aliases=['target']), predictive_method=dict(default='NONE', type='str')) + ), custom_metric_utilizations=dict( type='list', elements='dict', @@ -844,10 +869,14 @@ class AutoscalerCpuutilization(object): self.request = {} def to_request(self): - return remove_nones_from_dict({u'utilizationTarget': self.request.get('utilization_target')}) + return remove_nones_from_dict( + {u'utilizationTarget': self.request.get('utilization_target'), u'predictiveMethod': self.request.get('predictive_method')} + ) def from_response(self): - return remove_nones_from_dict({u'utilizationTarget': self.request.get(u'utilizationTarget')}) + return remove_nones_from_dict( + {u'utilizationTarget': self.request.get(u'utilizationTarget'), u'predictiveMethod': self.request.get(u'predictiveMethod')} + ) class AutoscalerCustommetricutilizationsArray(object): diff --git a/plugins/modules/gcp_compute_autoscaler_info.py b/plugins/modules/gcp_compute_autoscaler_info.py index bb48492..0f347af 100644 --- a/plugins/modules/gcp_compute_autoscaler_info.py +++ b/plugins/modules/gcp_compute_autoscaler_info.py @@ -235,6 +235,17 @@ resources: or until the average utilization reaches the target utilization. returned: success type: str + predictiveMethod: + description: + - 'Indicates whether predictive autoscaling based on CPU metric is enabled. + Valid values are: - NONE (default). No predictive method is used. + The autoscaler scales the group to meet current demand based on real-time + metrics.' + - "- OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability + by monitoring daily and weekly load patterns and scaling out ahead + of anticipated demand." + returned: success + type: str customMetricUtilizations: description: - Configuration parameters of autoscaling based on a custom metric. diff --git a/plugins/modules/gcp_compute_region_autoscaler.py b/plugins/modules/gcp_compute_region_autoscaler.py index 7a72963..b2cf02e 100644 --- a/plugins/modules/gcp_compute_region_autoscaler.py +++ b/plugins/modules/gcp_compute_region_autoscaler.py @@ -157,6 +157,18 @@ options: until the average utilization reaches the target utilization. required: false type: str + predictive_method: + description: + - 'Indicates whether predictive autoscaling based on CPU metric is enabled. + Valid values are: - NONE (default). No predictive method is used. The + autoscaler scales the group to meet current demand based on real-time + metrics.' + - "- OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability + by monitoring daily and weekly load patterns and scaling out ahead of + anticipated demand." + required: false + default: NONE + type: str custom_metric_utilizations: description: - Configuration parameters of autoscaling based on a custom metric. @@ -453,6 +465,17 @@ autoscalingPolicy: the average utilization reaches the target utilization. returned: success type: str + predictiveMethod: + description: + - 'Indicates whether predictive autoscaling based on CPU metric is enabled. + Valid values are: - NONE (default). No predictive method is used. The + autoscaler scales the group to meet current demand based on real-time + metrics.' + - "- OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability + by monitoring daily and weekly load patterns and scaling out ahead of + anticipated demand." + returned: success + type: str customMetricUtilizations: description: - Configuration parameters of autoscaling based on a custom metric. @@ -549,7 +572,7 @@ def main(): time_window_sec=dict(type='int'), ), ), - cpu_utilization=dict(type='dict', options=dict(utilization_target=dict(type='str'))), + cpu_utilization=dict(type='dict', options=dict(utilization_target=dict(type='str'), predictive_method=dict(default='NONE', type='str'))), custom_metric_utilizations=dict( type='list', elements='dict', @@ -820,10 +843,14 @@ class RegionAutoscalerCpuutilization(object): self.request = {} def to_request(self): - return remove_nones_from_dict({u'utilizationTarget': self.request.get('utilization_target')}) + return remove_nones_from_dict( + {u'utilizationTarget': self.request.get('utilization_target'), u'predictiveMethod': self.request.get('predictive_method')} + ) def from_response(self): - return remove_nones_from_dict({u'utilizationTarget': self.request.get(u'utilizationTarget')}) + return remove_nones_from_dict( + {u'utilizationTarget': self.request.get(u'utilizationTarget'), u'predictiveMethod': self.request.get(u'predictiveMethod')} + ) class RegionAutoscalerCustommetricutilizationsArray(object): diff --git a/plugins/modules/gcp_compute_region_autoscaler_info.py b/plugins/modules/gcp_compute_region_autoscaler_info.py index ac697de..6860a6b 100644 --- a/plugins/modules/gcp_compute_region_autoscaler_info.py +++ b/plugins/modules/gcp_compute_region_autoscaler_info.py @@ -235,6 +235,17 @@ resources: or until the average utilization reaches the target utilization. returned: success type: str + predictiveMethod: + description: + - 'Indicates whether predictive autoscaling based on CPU metric is enabled. + Valid values are: - NONE (default). No predictive method is used. + The autoscaler scales the group to meet current demand based on real-time + metrics.' + - "- OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability + by monitoring daily and weekly load patterns and scaling out ahead + of anticipated demand." + returned: success + type: str customMetricUtilizations: description: - Configuration parameters of autoscaling based on a custom metric.