cost_alert_subscriptions
Creates, updates, deletes, gets or lists a cost_alert_subscriptions resource.
Overview​
| Name | cost_alert_subscriptions |
| Type | Resource |
| Id | oci.budgets.cost_alert_subscriptions |
Fields​
The following fields are returned by SELECT queries:
- get
- list
Retrieves the CostAlertSubscription with the given OCID.
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID of the Cost Alert Subscription. |
name | string | The name of the cost alert subscription. Avoid entering confidential information. |
channels | string | The notification channels string. |
compartmentId | string | The OCID of the compartment which hold the cost alert subscription resource. |
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"}} |
description | string | The description of the cost alert subscription. |
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 alert subscription. (ACTIVE, INACTIVE) |
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"}} |
timeCreated | string (date-time) | The time that the cost alert subscription was created. |
timeUpdated | string (date-time) | The time that the cost alert subscription was updated. |
type | string | Type of alert subscription (DEFAULT, CUSTOM) (x-obmcs-top-level-enum: #/definitions/MonitorType) |
A page of CostAlertSubscriptionSummary objects.
| Name | Datatype | Description |
|---|---|---|
id | string | The OCID of the Cost Alert Subscription. |
name | string | The name of the cost alert subscription. Avoid entering confidential information. |
compartmentId | string | The OCID of the compartment which hold the cost alert subscription resource. |
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 alert subscription. (x-obmcs-enumref: #/definitions/CostAlertSubscription/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"}} |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | costAlertSubscriptionId, region | opc-request-id | Gets a CostAlertSubscription by the identifier. |
list | select | compartmentId, region | limit, page, sortOrder, sortBy, name, lifecycleState, opc-request-id | Gets a list of Cost Alert Subscription in a compartment.<br /> |
create | insert | region, compartmentId, name, type, channels | opc-retry-token, opc-request-id | Creates a new CostAlert Subscription.<br /> |
update | update | costAlertSubscriptionId, region | if-match, opc-request-id | Update a CostAlertSubscription identified by the OCID. |
delete | delete | costAlertSubscriptionId, region | if-match, opc-request-id | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
compartmentId | string | The ID of the compartment in which to list resources. |
costAlertSubscriptionId | string | The unique costAlertSubscription OCID. |
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) |
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. |
lifecycleState | string | The current state of the cost alert subscription. |
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. |
opc-retry-token | string | A 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. |
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'. |
SELECT examples​
- get
- list
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 }}'
;
Gets a list of Cost Alert Subscription in a compartment.<br />
SELECT
id,
name,
compartmentId,
definedTags,
freeformTags,
lifecycleState,
systemTags
FROM oci.budgets.cost_alert_subscriptions
WHERE compartmentId = '{{ compartmentId }}' -- required
AND region = '{{ region }}' -- required
AND limit = '{{ limit }}'
AND page = '{{ page }}'
AND sortOrder = '{{ sortOrder }}'
AND sortBy = '{{ sortBy }}'
AND name = '{{ name }}'
AND lifecycleState = '{{ lifecycleState }}'
AND opc-request-id = '{{ opc-request-id }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: cost_alert_subscriptions
props:
- name: region
value: "{{ region }}"
description: Required parameter for the cost_alert_subscriptions resource.
- name: channels
value: "{{ channels }}"
description: |
The notification channels string.
- name: compartmentId
value: "{{ compartmentId }}"
description: |
The OCID of the compartment.
- name: definedTags
value: "{{ definedTags }}"
description: |
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"}}`
- name: description
value: "{{ description }}"
description: |
The description of the cost alert subscription.
- name: freeformTags
value: "{{ freeformTags }}"
description: |
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"}`
- name: id
value: "{{ id }}"
description: |
The OCID of the Cost Anomaly Subscription.
- name: name
value: "{{ name }}"
description: |
The name of the cost alert subscription. Avoid entering confidential information.
- name: type
value: "{{ type }}"
description: |
Type of alert subscription
valid_values: ['DEFAULT', 'CUSTOM']
- name: opc-retry-token
value: "{{ opc-retry-token }}"
description: A 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.
description: A 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.
- name: opc-request-id
value: "{{ opc-request-id }}"
description: The client request ID for tracing.
description: The client request ID for tracing.
UPDATE examples​
- update
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​
- delete
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 }}'
;