Rule¶
-
class
oci.events.models.
Rule
(**kwargs)¶ Bases:
object
The configuration details of an Events rule. For more information, see Managing Rules for Events.
Attributes
LIFECYCLE_STATE_ACTIVE
A constant which can be used with the lifecycle_state property of a Rule. LIFECYCLE_STATE_CREATING
A constant which can be used with the lifecycle_state property of a Rule. LIFECYCLE_STATE_DELETED
A constant which can be used with the lifecycle_state property of a Rule. LIFECYCLE_STATE_DELETING
A constant which can be used with the lifecycle_state property of a Rule. LIFECYCLE_STATE_FAILED
A constant which can be used with the lifecycle_state property of a Rule. LIFECYCLE_STATE_INACTIVE
A constant which can be used with the lifecycle_state property of a Rule. LIFECYCLE_STATE_UPDATING
A constant which can be used with the lifecycle_state property of a Rule. actions
[Required] Gets the actions of this Rule. compartment_id
[Required] Gets the compartment_id of this Rule. condition
[Required] Gets the condition of this Rule. defined_tags
Gets the defined_tags of this Rule. description
Gets the description of this Rule. display_name
[Required] Gets the display_name of this Rule. freeform_tags
Gets the freeform_tags of this Rule. id
[Required] Gets the id of this Rule. is_enabled
[Required] Gets the is_enabled of this Rule. lifecycle_message
Gets the lifecycle_message of this Rule. lifecycle_state
[Required] Gets the lifecycle_state of this Rule. time_created
[Required] Gets the time_created of this Rule. Methods
__init__
(**kwargs)Initializes a new Rule object with values from keyword arguments. -
LIFECYCLE_STATE_ACTIVE
= 'ACTIVE'¶ A constant which can be used with the lifecycle_state property of a Rule. This constant has a value of “ACTIVE”
-
LIFECYCLE_STATE_CREATING
= 'CREATING'¶ A constant which can be used with the lifecycle_state property of a Rule. This constant has a value of “CREATING”
-
LIFECYCLE_STATE_DELETED
= 'DELETED'¶ A constant which can be used with the lifecycle_state property of a Rule. This constant has a value of “DELETED”
-
LIFECYCLE_STATE_DELETING
= 'DELETING'¶ A constant which can be used with the lifecycle_state property of a Rule. This constant has a value of “DELETING”
-
LIFECYCLE_STATE_FAILED
= 'FAILED'¶ A constant which can be used with the lifecycle_state property of a Rule. This constant has a value of “FAILED”
-
LIFECYCLE_STATE_INACTIVE
= 'INACTIVE'¶ A constant which can be used with the lifecycle_state property of a Rule. This constant has a value of “INACTIVE”
-
LIFECYCLE_STATE_UPDATING
= 'UPDATING'¶ A constant which can be used with the lifecycle_state property of a Rule. This constant has a value of “UPDATING”
-
__init__
(**kwargs)¶ Initializes a new Rule object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):
Parameters: - display_name (str) – The value to assign to the display_name property of this Rule.
- description (str) – The value to assign to the description property of this Rule.
- lifecycle_state (str) – The value to assign to the lifecycle_state property of this Rule. Allowed values for this property are: “CREATING”, “ACTIVE”, “INACTIVE”, “UPDATING”, “DELETING”, “DELETED”, “FAILED”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
- condition (str) – The value to assign to the condition property of this Rule.
- compartment_id (str) – The value to assign to the compartment_id property of this Rule.
- is_enabled (bool) – The value to assign to the is_enabled property of this Rule.
- freeform_tags (dict(str, str)) – The value to assign to the freeform_tags property of this Rule.
- defined_tags (dict(str, dict(str, object))) – The value to assign to the defined_tags property of this Rule.
- actions (oci.events.models.ActionList) – The value to assign to the actions property of this Rule.
- id (str) – The value to assign to the id property of this Rule.
- time_created (datetime) – The value to assign to the time_created property of this Rule.
- lifecycle_message (str) – The value to assign to the lifecycle_message property of this Rule.
-
actions
¶ [Required] Gets the actions of this Rule.
Returns: The actions of this Rule. Return type: oci.events.models.ActionList
-
compartment_id
¶ [Required] Gets the compartment_id of this Rule. The OCID of the compartment to which this rule belongs.
Returns: The compartment_id of this Rule. Return type: str
-
condition
¶ [Required] Gets the condition of this Rule. A filter that specifies the event that will trigger actions associated with this rule. A few important things to remember about filters:
- Fields not mentioned in the condition are ignored. You can create a valid filter that matches
all events with two curly brackets: {}
For more examples, seeMatching Events with Filters. * For a condition with fields to match an event, the event must contain all the field names listed in the condition. Field names must appear in the condition with the same nesting structure used in the event.
For a list of reference events, seeServices that Produce Events. * Rules apply to events in the compartment in which you create them and any child compartments. This means that a condition specified by a rule only matches events emitted from resources in the compartment or any of its child compartments. * Wildcard matching is supported with the asterisk (*) character.
For examples of wildcard matching, seeExample: “eventType”: “com.oraclecloud.databaseservice.autonomous.database.backup.end”
Returns: The condition of this Rule. Return type: str
Gets the defined_tags of this Rule. Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
Example: {“Operations”: {“CostCenter”: “42”}}
Returns: The defined_tags of this Rule. Return type: dict(str, dict(str, object))
-
description
¶ Gets the description of this Rule. A string that describes the details of the rule. It does not have to be unique, and you can change it. Avoid entering confidential information.
Returns: The description of this Rule. Return type: str
-
display_name
¶ [Required] Gets the display_name of this Rule. A string that describes the rule. It does not have to be unique, and you can change it. Avoid entering confidential information.
Example: “This rule sends a notification upon completion of DbaaS backup.”
Returns: The display_name of this Rule. Return type: str
Gets the freeform_tags of this Rule. Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. Exists for cross-compatibility only. For more information, see Resource Tags.
Example: {“Department”: “Finance”}
Returns: The freeform_tags of this Rule. Return type: dict(str, str)
-
id
¶ [Required] Gets the id of this Rule. The OCID of this rule.
Returns: The id of this Rule. Return type: str
-
is_enabled
¶ [Required] Gets the is_enabled of this Rule. Whether or not this rule is currently enabled.
Example: true
Returns: The is_enabled of this Rule. Return type: bool
-
lifecycle_message
¶ Gets the lifecycle_message of this Rule. A message generated by the Events service about the current state of this rule.
Returns: The lifecycle_message of this Rule. Return type: str
-
lifecycle_state
¶ [Required] Gets the lifecycle_state of this Rule. The current state of the rule.
Allowed values for this property are: “CREATING”, “ACTIVE”, “INACTIVE”, “UPDATING”, “DELETING”, “DELETED”, “FAILED”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
Returns: The lifecycle_state of this Rule. Return type: str
-