cost_anomaly_events
Creates, updates, deletes, gets or lists a cost_anomaly_events resource.
Overview​
| Name | cost_anomaly_events |
| Type | Resource |
| Id | oci.budgets.cost_anomaly_events |
Fields​
The following fields are returned by SELECT queries:
- get
- list
Retrieves the CostAnomalyEvent with the given OCID.
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID of the Cost Anomaly Event. |
compartmentId | string | The OCID of the compartment. |
costImpact | number (double) | The cost impact of the detected anomaly. |
costMonitorId | string | The OCID of the associated cost monitor. |
costMonitorName | string | The name of the associated cost monitor. |
costVariancePercentage | number (double) | The cost variance percentage of the detected anomaly. |
definedTags | object | Defined 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"}} |
feedbackResponse | string | The feedback response for the cost anomaly event. (ACCURATE_ANOMALY, EXPECTED_ANOMALY, NOT_AN_ANOMALY) |
freeformTags | object | Free-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"} |
lifecycleState | string | The current state of the cost anomaly event. (ACTIVE, INACTIVE) |
rootCauseDetail | object | The root cause details of the cost anomaly event. |
systemTags | object | System 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"}} |
targetResourceFilter | object | The filter object to target resources for cost monitor. Cost generated by one or more resources identified by this filter is monitored for anomalous deviations. |
timeAnomalyEventDate | string (date-time) | The event date of the anomaly event. |
timeCreated | string (date-time) | The created time of the cost anomaly event. |
timeUpdated | string (date-time) | The updated time of the cost anomaly event. |
A page of CostAnomalyEventSummary objects.
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID of the Cost Anomaly Event. |
compartmentId | string | The OCID of the compartment. |
costImpact | number (double) | The cost impact of the detected anomaly. |
costMonitorId | string | The OCID of the associated cost monitor. |
costMonitorName | string | The name of the associated cost monitor. |
costVariancePercentage | number (double) | The cost variance percentage of the detected anomaly. |
definedTags | object | Defined 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"}} |
freeformTags | object | Free-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"} |
lifecycleState | string | The current state of the cost anomaly event. (x-obmcs-enumref: #/definitions/CostAnomalyEvent/lifecycleState) |
systemTags | object | System 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"}} |
targetResourceFilter | object | The filter object to target resources for cost monitor. Cost generated by one or more resources identified by this filter is monitored for anomalous deviations. |
timeAnomalyEventDate | string (date-time) | The event date of the anomaly event. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | costAnomalyEventId, region | opc-request-id | Gets a CostAnomalyEvent by the identifier. |
list | select | compartmentId, costAnomalyMonitorId, timeAnomalyEventStartDate, timeAnomalyEventEndDate, region, costImpact | limit, page, sortOrder, sortBy, name, targetTenantId, opc-request-id | Gets a list of Cost Anomaly Event in a compartment.<br /> |
update | update | costAnomalyEventId, region | if-match, opc-request-id | Update 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.
| Name | Datatype | Description |
|---|---|---|
compartmentId | string | The ID of the compartment in which to list resources. |
costAnomalyEventId | string | The unique costAnomalyEventId OCID. |
costAnomalyMonitorId | string | The cost monitor ocid. |
costImpact | number (double) | cost impact of the anomaly event. |
region | string | OCI 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) |
timeAnomalyEventEndDate | string (date-time) | endDate for anomaly event date. |
timeAnomalyEventStartDate | string (date-time) | startDate for anomaly event date. |
if-match | string | For 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. |
limit | integer | The maximum number of items to return. |
name | string | Unique, non-changeable resource name. |
opc-request-id | string | The client request ID for tracing. |
page | string | The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. |
sortBy | string | The 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. |
sortOrder | string | The sort order to use, either 'asc' or 'desc'. |
targetTenantId | string | The target tenantId ocid filter param. |
SELECT examples​
- get
- list
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 }}'
;
Gets a list of Cost Anomaly Event in a compartment.<br />
SELECT
id,
compartmentId,
costImpact,
costMonitorId,
costMonitorName,
costVariancePercentage,
definedTags,
freeformTags,
lifecycleState,
systemTags,
targetResourceFilter,
timeAnomalyEventDate
FROM oci.budgets.cost_anomaly_events
WHERE compartmentId = '{{ compartmentId }}' -- required
AND costAnomalyMonitorId = '{{ costAnomalyMonitorId }}' -- required
AND timeAnomalyEventStartDate = '{{ timeAnomalyEventStartDate }}' -- required
AND timeAnomalyEventEndDate = '{{ timeAnomalyEventEndDate }}' -- required
AND region = '{{ region }}' -- required
AND costImpact = '{{ costImpact }}' -- required
AND limit = '{{ limit }}'
AND page = '{{ page }}'
AND sortOrder = '{{ sortOrder }}'
AND sortBy = '{{ sortBy }}'
AND name = '{{ name }}'
AND targetTenantId = '{{ targetTenantId }}'
AND opc-request-id = '{{ opc-request-id }}'
;
UPDATE examples​
- update
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;