Skip to main content

cost_alert_subscriptions

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

Overview​

Namecost_alert_subscriptions
TypeResource
Idoci.budgets.cost_alert_subscriptions

Fields​

The following fields are returned by SELECT queries:

Retrieves the CostAlertSubscription with the given OCID.

NameDatatypeDescription
idstringThe OCID of the Cost Alert Subscription.
namestringThe name of the cost alert subscription. Avoid entering confidential information.
channelsstringThe notification channels string.
compartmentIdstringThe OCID of the compartment which hold the cost alert subscription resource.
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"}}
descriptionstringThe description of the cost alert subscription.
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 alert subscription. (ACTIVE, INACTIVE)
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"}}
timeCreatedstring (date-time)The time that the cost alert subscription was created.
timeUpdatedstring (date-time)The time that the cost alert subscription was updated.
typestringType of alert subscription (DEFAULT, CUSTOM) (x-obmcs-top-level-enum: #/definitions/MonitorType)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcostAlertSubscriptionId, regionopc-request-idGets a CostAlertSubscription by the identifier.
listselectcompartmentId, regionlimit, page, sortOrder, sortBy, name, lifecycleState, opc-request-idGets a list of Cost Alert Subscription in a compartment.<br />
createinsertregion, compartmentId, name, type, channelsopc-retry-token, opc-request-idCreates a new CostAlert Subscription.<br />
updateupdatecostAlertSubscriptionId, regionif-match, opc-request-idUpdate a CostAlertSubscription identified by the OCID.
deletedeletecostAlertSubscriptionId, regionif-match, opc-request-idDeletes a specified CostAlertSubscription resource.

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.
costAlertSubscriptionIdstringThe unique costAlertSubscription OCID.
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)
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.
lifecycleStatestringThe current state of the cost alert subscription.
limitintegerThe maximum number of items to return.
namestringUnique, non-changeable resource name.
opc-request-idstringThe client request ID for tracing.
opc-retry-tokenstringA token that uniquely identifies a request so it can be retried, in case of a timeout or server error, without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
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'.

SELECT examples​

Gets a CostAlertSubscription by the identifier.

SELECT
id,
name,
channels,
compartmentId,
definedTags,
description,
freeformTags,
lifecycleState,
systemTags,
timeCreated,
timeUpdated,
type
FROM oci.budgets.cost_alert_subscriptions
WHERE costAlertSubscriptionId = '{{ costAlertSubscriptionId }}' -- required
AND region = '{{ region }}' -- required
AND opc-request-id = '{{ opc-request-id }}'
;

INSERT examples​

Creates a new CostAlert Subscription.<br />

INSERT INTO oci.budgets.cost_alert_subscriptions (
channels,
compartmentId,
definedTags,
description,
freeformTags,
id,
name,
type,
region,
opc-retry-token,
opc-request-id
)
SELECT
'{{ channels }}' /* required */,
'{{ compartmentId }}' /* required */,
'{{ definedTags }}',
'{{ description }}',
'{{ freeformTags }}',
'{{ id }}',
'{{ name }}' /* required */,
'{{ type }}' /* required */,
'{{ region }}',
'{{ opc-retry-token }}',
'{{ opc-request-id }}'
RETURNING
id,
name,
channels,
compartmentId,
definedTags,
description,
freeformTags,
lifecycleState,
systemTags,
timeCreated,
timeUpdated,
type
;

UPDATE examples​

Update a CostAlertSubscription identified by the OCID.

UPDATE oci.budgets.cost_alert_subscriptions
SET
channels = '{{ channels }}',
definedTags = '{{ definedTags }}',
description = '{{ description }}',
freeformTags = '{{ freeformTags }}'
WHERE
costAlertSubscriptionId = '{{ costAlertSubscriptionId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match}}'
AND opc-request-id = '{{ opc-request-id}}'
RETURNING
id,
name,
channels,
compartmentId,
definedTags,
description,
freeformTags,
lifecycleState,
systemTags,
timeCreated,
timeUpdated,
type;

DELETE examples​

Deletes a specified CostAlertSubscription resource.

DELETE FROM oci.budgets.cost_alert_subscriptions
WHERE costAlertSubscriptionId = '{{ costAlertSubscriptionId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
AND opc-request-id = '{{ opc-request-id }}'
;