Skip to main content

cost_anomaly_events

Creates, updates, deletes, gets or lists a cost_anomaly_events resource.

Overview​

Namecost_anomaly_events
TypeResource
Idoci.budgets.cost_anomaly_events

Fields​

The following fields are returned by SELECT queries:

Retrieves the CostAnomalyEvent with the given OCID.

NameDatatypeDescription
idstringThe OCID of the Cost Anomaly Event.
compartmentIdstringThe OCID of the compartment.
costImpactnumber (double)The cost impact of the detected anomaly.
costMonitorIdstringThe OCID of the associated cost monitor.
costMonitorNamestringThe name of the associated cost monitor.
costVariancePercentagenumber (double)The cost variance percentage of the detected anomaly.
definedTagsobjectDefined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: {"Operations": {"CostCenter": "42"}}
feedbackResponsestringThe feedback response for the cost anomaly event. (ACCURATE_ANOMALY, EXPECTED_ANOMALY, NOT_AN_ANOMALY)
freeformTagsobjectFree-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"}
lifecycleStatestringThe current state of the cost anomaly event. (ACTIVE, INACTIVE)
rootCauseDetailobjectThe root cause details of the cost anomaly event.
systemTagsobjectSystem tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud": {"free-tier-retained": "true"}}
targetResourceFilterobjectThe filter object to target resources for cost monitor. Cost generated by one or more resources identified by this filter is monitored for anomalous deviations.
timeAnomalyEventDatestring (date-time)The event date of the anomaly event.
timeCreatedstring (date-time)The created time of the cost anomaly event.
timeUpdatedstring (date-time)The updated time of the cost anomaly event.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcostAnomalyEventId, regionopc-request-idGets a CostAnomalyEvent by the identifier.
listselectcompartmentId, costAnomalyMonitorId, timeAnomalyEventStartDate, timeAnomalyEventEndDate, region, costImpactlimit, page, sortOrder, sortBy, name, targetTenantId, opc-request-idGets a list of Cost Anomaly Event in a compartment.<br />
updateupdatecostAnomalyEventId, regionif-match, opc-request-idUpdate a CostAnomalyEvent identified by the OCID.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
compartmentIdstringThe ID of the compartment in which to list resources.
costAnomalyEventIdstringThe unique costAnomalyEventId OCID.
costAnomalyMonitorIdstringThe cost monitor ocid.
costImpactnumber (double)cost impact of the anomaly event.
regionstringOCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION)
timeAnomalyEventEndDatestring (date-time)endDate for anomaly event date.
timeAnomalyEventStartDatestring (date-time)startDate for anomaly event date.
if-matchstringFor optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.
limitintegerThe maximum number of items to return.
namestringUnique, non-changeable resource name.
opc-request-idstringThe client request ID for tracing.
pagestringThe page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.
sortBystringThe field to sort by. If not specified, the default is timeCreated. The default sort order for timeCreated is DESC. The default sort order for displayName is ASC in alphanumeric order.
sortOrderstringThe sort order to use, either 'asc' or 'desc'.
targetTenantIdstringThe target tenantId ocid filter param.

SELECT examples​

Gets a CostAnomalyEvent by the identifier.

SELECT
id,
compartmentId,
costImpact,
costMonitorId,
costMonitorName,
costVariancePercentage,
definedTags,
feedbackResponse,
freeformTags,
lifecycleState,
rootCauseDetail,
systemTags,
targetResourceFilter,
timeAnomalyEventDate,
timeCreated,
timeUpdated
FROM oci.budgets.cost_anomaly_events
WHERE costAnomalyEventId = '{{ costAnomalyEventId }}' -- required
AND region = '{{ region }}' -- required
AND opc-request-id = '{{ opc-request-id }}'
;

UPDATE examples​

Update a CostAnomalyEvent identified by the OCID.

UPDATE oci.budgets.cost_anomaly_events
SET
definedTags = '{{ definedTags }}',
feedbackResponse = '{{ feedbackResponse }}',
freeformTags = '{{ freeformTags }}'
WHERE
costAnomalyEventId = '{{ costAnomalyEventId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match}}'
AND opc-request-id = '{{ opc-request-id}}'
RETURNING
id,
compartmentId,
costImpact,
costMonitorId,
costMonitorName,
costVariancePercentage,
definedTags,
feedbackResponse,
freeformTags,
lifecycleState,
rootCauseDetail,
systemTags,
targetResourceFilter,
timeAnomalyEventDate,
timeCreated,
timeUpdated;