Metric¶
- class oci.autoscaling.models.Metric(**kwargs)¶
Bases:
MetricBaseMetric and threshold details for triggering an autoscaling action based on CPU or memory utilization.
Attributes:
A constant which can be used with the metric_source property of a MetricBase.
A constant which can be used with the metric_source property of a MetricBase.
A constant which can be used with the metric_type property of a Metric.
A constant which can be used with the metric_type property of a Metric.
Gets the metric_source of this MetricBase.
[Required] Gets the metric_type of this Metric.
Gets the pending_duration of this MetricBase.
[Required] Gets the threshold of this Metric.
Methods:
__init__(**kwargs)Initializes a new Metric object with values from keyword arguments.
get_subtype(object_dictionary)Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.
- METRIC_SOURCE_COMPUTE_AGENT = 'COMPUTE_AGENT'¶
A constant which can be used with the metric_source property of a MetricBase. This constant has a value of “COMPUTE_AGENT”
- METRIC_SOURCE_CUSTOM_QUERY = 'CUSTOM_QUERY'¶
A constant which can be used with the metric_source property of a MetricBase. This constant has a value of “CUSTOM_QUERY”
- METRIC_TYPE_CPU_UTILIZATION = 'CPU_UTILIZATION'¶
A constant which can be used with the metric_type property of a Metric. This constant has a value of “CPU_UTILIZATION”
- METRIC_TYPE_MEMORY_UTILIZATION = 'MEMORY_UTILIZATION'¶
A constant which can be used with the metric_type property of a Metric. This constant has a value of “MEMORY_UTILIZATION”
- __init__(**kwargs)¶
Initializes a new Metric object with values from keyword arguments. The default value of the
metric_sourceattribute of this class isCOMPUTE_AGENTand it should not be changed. The following keyword arguments are supported (corresponding to the getters/setters of this class):- Parameters
pending_duration (str) – The value to assign to the pending_duration property of this Metric.
metric_source (str) – The value to assign to the metric_source property of this Metric. Allowed values for this property are: “COMPUTE_AGENT”, “CUSTOM_QUERY”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
metric_type (str) – The value to assign to the metric_type property of this Metric. Allowed values for this property are: “CPU_UTILIZATION”, “MEMORY_UTILIZATION”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
threshold (oci.autoscaling.models.Threshold) – The value to assign to the threshold property of this Metric.
- static get_subtype(object_dictionary)¶
Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.
- property metric_source¶
Gets the metric_source of this MetricBase. Source of the metric data for creating the alarm used to trigger autoscaling actions.
The following values are supported:
COMPUTE_AGENT: CPU or memory metrics emitted by the Compute Instance Monitoring plugin.
CUSTOM_QUERY: A custom Monitoring Query Language (MQL) expression.
Allowed values for this property are: “COMPUTE_AGENT”, “CUSTOM_QUERY”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
- Returns
The metric_source of this MetricBase.
- Return type
str
- property metric_type¶
[Required] Gets the metric_type of this Metric. Allowed values for this property are: “CPU_UTILIZATION”, “MEMORY_UTILIZATION”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
- Returns
The metric_type of this Metric.
- Return type
str
- property pending_duration¶
Gets the pending_duration of this MetricBase. The period of time that the condition defined in the alarm must persist before the alarm state changes from “OK” to “FIRING” or vice versa. For example, a value of 5 minutes means that the alarm must persist in breaching the condition for five minutes before the alarm updates its state to “FIRING”; likewise, the alarm must persist in not breaching the condition for five minutes before the alarm updates its state to “OK.”
The duration is specified as a string in ISO 8601 format (PT10M for ten minutes or PT1H for one hour). Minimum: PT3M. Maximum: PT1H. Default: PT3M.
- Returns
The pending_duration of this MetricBase.
- Return type
str
- property threshold¶
[Required] Gets the threshold of this Metric.
- Returns
The threshold of this Metric.
- Return type