TargetCustomExpressionQueryScalingConfiguration

class oci.data_science.models.TargetCustomExpressionQueryScalingConfiguration(**kwargs)

Bases: TargetScalingConfiguration

The scaling configuration for the custom expression query for the workload.

Attributes:

TARGET_SCALING_CONFIGURATION_TYPE_QUERY

A constant which can be used with the target_scaling_configuration_type property of a TargetScalingConfiguration.

TARGET_SCALING_CONFIGURATION_TYPE_THRESHOLD

A constant which can be used with the target_scaling_configuration_type property of a TargetScalingConfiguration.

metric_namespace

Gets the metric_namespace of this TargetCustomExpressionQueryScalingConfiguration.

query

[Required] Gets the query of this TargetCustomExpressionQueryScalingConfiguration. The Monitoring Query Language (MQL) expression to evaluate for the alarm. The Alarms feature of the Monitoring service interprets results for each returned time series as Boolean values, where zero represents false and a non-zero value represents true. A true value means that the trigger rule condition has been met. The query must specify a metric, statistic, interval, and trigger rule (threshold or absence). Supported values for interval: 1m-60m (also 1h). You can optionally specify dimensions and grouping functions. Supported grouping functions: grouping(), groupBy(). Example of threshold alarm: `   CPUUtilization[1m]{resourceId = "Model_Deployment_OCID"}.grouping().mean() < 25   CPUUtilization[1m]{resourceId = "Model_Deployment_OCID"}.grouping().mean() > 75   `.

target_scaling_configuration_type

[Required] Gets the target_scaling_configuration_type of this TargetScalingConfiguration.

threshold

[Required] Gets the threshold of this TargetCustomExpressionQueryScalingConfiguration.

Methods:

__init__(**kwargs)

Initializes a new TargetCustomExpressionQueryScalingConfiguration 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.

TARGET_SCALING_CONFIGURATION_TYPE_QUERY = 'QUERY'

A constant which can be used with the target_scaling_configuration_type property of a TargetScalingConfiguration. This constant has a value of “QUERY”

TARGET_SCALING_CONFIGURATION_TYPE_THRESHOLD = 'THRESHOLD'

A constant which can be used with the target_scaling_configuration_type property of a TargetScalingConfiguration. This constant has a value of “THRESHOLD”

__init__(**kwargs)

Initializes a new TargetCustomExpressionQueryScalingConfiguration object with values from keyword arguments. The default value of the target_scaling_configuration_type attribute of this class is QUERY and it should not be changed. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters
  • target_scaling_configuration_type (str) – The value to assign to the target_scaling_configuration_type property of this TargetCustomExpressionQueryScalingConfiguration. Allowed values for this property are: “THRESHOLD”, “QUERY”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

  • query (str) – The value to assign to the query property of this TargetCustomExpressionQueryScalingConfiguration.

  • threshold (float) – The value to assign to the threshold property of this TargetCustomExpressionQueryScalingConfiguration.

  • metric_namespace (str) – The value to assign to the metric_namespace property of this TargetCustomExpressionQueryScalingConfiguration.

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_namespace

Gets the metric_namespace of this TargetCustomExpressionQueryScalingConfiguration. Namespace to read the metrics from. Default value will be service metric namespace.

Returns

The metric_namespace of this TargetCustomExpressionQueryScalingConfiguration.

Return type

str

property query

[Required] Gets the query of this TargetCustomExpressionQueryScalingConfiguration. The Monitoring Query Language (MQL) expression to evaluate for the alarm. The Alarms feature of the Monitoring service interprets results for each returned time series as Boolean values, where zero represents false and a non-zero value represents true. A true value means that the trigger rule condition has been met. The query must specify a metric, statistic, interval, and trigger rule (threshold or absence). Supported values for interval: 1m-60m (also 1h). You can optionally specify dimensions and grouping functions. Supported grouping functions: grouping(), groupBy(). Example of threshold alarm:

` CPUUtilization[1m]{resourceId = "Model_Deployment_OCID"}.grouping().mean() < 25 CPUUtilization[1m]{resourceId = "Model_Deployment_OCID"}.grouping().mean() > 75 `

Returns

The query of this TargetCustomExpressionQueryScalingConfiguration.

Return type

str

property target_scaling_configuration_type

[Required] Gets the target_scaling_configuration_type of this TargetScalingConfiguration. The metric at which the alarm used to trigger autoscaling actions for workload.

Allowed values for this property are: “THRESHOLD”, “QUERY”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns

The target_scaling_configuration_type of this TargetScalingConfiguration.

Return type

str

property threshold

[Required] Gets the threshold of this TargetCustomExpressionQueryScalingConfiguration. A metric value at which the scaling operation will be triggered.

Returns

The threshold of this TargetCustomExpressionQueryScalingConfiguration.

Return type

float