scheduled_actions
Creates, updates, deletes, gets or lists a scheduled_actions resource.
Overview
| Name | scheduled_actions |
| Type | Resource |
| Id | azure.cost_management.scheduled_actions |
Fields
The following fields are returned by SELECT queries:
- get_by_scope
- get
- list_by_scope
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
displayName | string | Scheduled action name. Required. |
eTag | string | Resource Etag. For update calls, eTag is optional and can be specified to achieve optimistic concurrency. Fetch the resource's eTag by doing a 'GET' call first and then including the latest eTag as part of the request body or 'If-Match' header while performing the update. For create calls, eTag is not required. |
fileDestination | object | Destination format of the view data. This is optional. |
kind | string | Kind of the scheduled action. Known values are: "Email" and "InsightAlert". (Email, InsightAlert) |
notification | object | Notification properties based on scheduled action kind. Required. |
notificationEmail | string | Email address of the point of contact that should get the unsubscribe requests and notification emails. |
schedule | object | Schedule of the scheduled action. Required. |
scope | string | For private scheduled action(Create or Update), scope will be empty. For shared scheduled action(Create or Update By Scope), Cost Management scope can be 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope. |
status | string | Status of the scheduled action. Required. Known values are: "Enabled", "Expired", and "Disabled". (Enabled, Expired, Disabled) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
viewId | string | Cost analysis viewId used for scheduled action. For example, '/providers/Microsoft.CostManagement/views/swaggerExample'. Required. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
displayName | string | Scheduled action name. Required. |
eTag | string | Resource Etag. For update calls, eTag is optional and can be specified to achieve optimistic concurrency. Fetch the resource's eTag by doing a 'GET' call first and then including the latest eTag as part of the request body or 'If-Match' header while performing the update. For create calls, eTag is not required. |
fileDestination | object | Destination format of the view data. This is optional. |
kind | string | Kind of the scheduled action. Known values are: "Email" and "InsightAlert". (Email, InsightAlert) |
notification | object | Notification properties based on scheduled action kind. Required. |
notificationEmail | string | Email address of the point of contact that should get the unsubscribe requests and notification emails. |
schedule | object | Schedule of the scheduled action. Required. |
scope | string | For private scheduled action(Create or Update), scope will be empty. For shared scheduled action(Create or Update By Scope), Cost Management scope can be 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope. |
status | string | Status of the scheduled action. Required. Known values are: "Enabled", "Expired", and "Disabled". (Enabled, Expired, Disabled) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
viewId | string | Cost analysis viewId used for scheduled action. For example, '/providers/Microsoft.CostManagement/views/swaggerExample'. Required. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
displayName | string | Scheduled action name. Required. |
eTag | string | Resource Etag. For update calls, eTag is optional and can be specified to achieve optimistic concurrency. Fetch the resource's eTag by doing a 'GET' call first and then including the latest eTag as part of the request body or 'If-Match' header while performing the update. For create calls, eTag is not required. |
fileDestination | object | Destination format of the view data. This is optional. |
kind | string | Kind of the scheduled action. Known values are: "Email" and "InsightAlert". (Email, InsightAlert) |
notification | object | Notification properties based on scheduled action kind. Required. |
notificationEmail | string | Email address of the point of contact that should get the unsubscribe requests and notification emails. |
schedule | object | Schedule of the scheduled action. Required. |
scope | string | For private scheduled action(Create or Update), scope will be empty. For shared scheduled action(Create or Update By Scope), Cost Management scope can be 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope. |
status | string | Status of the scheduled action. Required. Known values are: "Enabled", "Expired", and "Disabled". (Enabled, Expired, Disabled) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
viewId | string | Cost analysis viewId used for scheduled action. For example, '/providers/Microsoft.CostManagement/views/swaggerExample'. Required. |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
displayName | string | Scheduled action name. Required. |
eTag | string | Resource Etag. For update calls, eTag is optional and can be specified to achieve optimistic concurrency. Fetch the resource's eTag by doing a 'GET' call first and then including the latest eTag as part of the request body or 'If-Match' header while performing the update. For create calls, eTag is not required. |
fileDestination | object | Destination format of the view data. This is optional. |
kind | string | Kind of the scheduled action. Known values are: "Email" and "InsightAlert". (Email, InsightAlert) |
notification | object | Notification properties based on scheduled action kind. Required. |
notificationEmail | string | Email address of the point of contact that should get the unsubscribe requests and notification emails. |
schedule | object | Schedule of the scheduled action. Required. |
scope | string | For private scheduled action(Create or Update), scope will be empty. For shared scheduled action(Create or Update By Scope), Cost Management scope can be 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope. |
status | string | Status of the scheduled action. Required. Known values are: "Enabled", "Expired", and "Disabled". (Enabled, Expired, Disabled) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
viewId | string | Cost analysis viewId used for scheduled action. For example, '/providers/Microsoft.CostManagement/views/swaggerExample'. Required. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_by_scope | select | scope, name | Get the shared scheduled action from the given scope by name. | |
get | select | name | Get the private scheduled action by name. | |
list_by_scope | select | scope | $filter | List all shared scheduled actions within the given scope. |
list | select | $filter | List all private scheduled actions. | |
create_or_update_by_scope | insert | scope, name | Create or update a shared scheduled action within the given scope. | |
create_or_update | insert | name | Create or update a private scheduled action. | |
create_or_update_by_scope | replace | scope, name | Create or update a shared scheduled action within the given scope. | |
create_or_update | replace | name | Create or update a private scheduled action. | |
delete_by_scope | delete | scope, name | Delete a scheduled action within the given scope. | |
delete | delete | name | Delete a private scheduled action. | |
run | exec | name | Processes a private scheduled action. | |
run_by_scope | exec | scope, name | Runs a shared scheduled action within the given scope. | |
check_name_availability | exec | Checks availability and correctness of the name for a scheduled action. | ||
check_name_availability_by_scope | exec | scope | Checks availability and correctness of the name for a scheduled action within the given scope. |
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 |
|---|---|---|
name | string | Scheduled action name. Required. |
scope | string | The scope associated with scheduled action operations. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for External Billing Account scope and 'providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for External Subscription scope. Note: Insight Alerts are only available on subscription scope. Required. |
$filter | string | May be used to filter scheduled actions by properties/viewId. Supported operator is 'eq'. Default value is None. |
SELECT examples
- get_by_scope
- get
- list_by_scope
- list
Get the shared scheduled action from the given scope by name.
SELECT
id,
name,
displayName,
eTag,
fileDestination,
kind,
notification,
notificationEmail,
schedule,
scope,
status,
systemData,
type,
viewId
FROM azure.cost_management.scheduled_actions
WHERE scope = '{{ scope }}' -- required
AND name = '{{ name }}' -- required
;
Get the private scheduled action by name.
SELECT
id,
name,
displayName,
eTag,
fileDestination,
kind,
notification,
notificationEmail,
schedule,
scope,
status,
systemData,
type,
viewId
FROM azure.cost_management.scheduled_actions
WHERE name = '{{ name }}' -- required
;
List all shared scheduled actions within the given scope.
SELECT
id,
name,
displayName,
eTag,
fileDestination,
kind,
notification,
notificationEmail,
schedule,
scope,
status,
systemData,
type,
viewId
FROM azure.cost_management.scheduled_actions
WHERE scope = '{{ scope }}' -- required
AND $filter = '{{ $filter }}'
;
List all private scheduled actions.
SELECT
id,
name,
displayName,
eTag,
fileDestination,
kind,
notification,
notificationEmail,
schedule,
scope,
status,
systemData,
type,
viewId
FROM azure.cost_management.scheduled_actions
WHERE $filter = '{{ $filter }}'
;
INSERT examples
- create_or_update_by_scope
- create_or_update
- Manifest
Create or update a shared scheduled action within the given scope.
INSERT INTO azure.cost_management.scheduled_actions (
properties,
eTag,
kind,
scope,
name
)
SELECT
'{{ properties }}',
'{{ eTag }}',
'{{ kind }}',
'{{ scope }}',
'{{ name }}'
RETURNING
id,
name,
eTag,
kind,
properties,
systemData,
type
;
Create or update a private scheduled action.
INSERT INTO azure.cost_management.scheduled_actions (
properties,
eTag,
kind,
name
)
SELECT
'{{ properties }}',
'{{ eTag }}',
'{{ kind }}',
'{{ name }}'
RETURNING
id,
name,
eTag,
kind,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: scheduled_actions
props:
- name: scope
value: "{{ scope }}"
description: Required parameter for the scheduled_actions resource.
- name: name
value: "{{ name }}"
description: Required parameter for the scheduled_actions resource.
- name: properties
description: |
The properties of the scheduled action.
value:
displayName: "{{ displayName }}"
fileDestination:
fileFormats:
- "{{ fileFormats }}"
notification:
to:
- "{{ to }}"
language: "{{ language }}"
message: "{{ message }}"
regionalFormat: "{{ regionalFormat }}"
subject: "{{ subject }}"
notificationEmail: "{{ notificationEmail }}"
schedule:
frequency: "{{ frequency }}"
hourOfDay: {{ hourOfDay }}
daysOfWeek:
- "{{ daysOfWeek }}"
weeksOfMonth:
- "{{ weeksOfMonth }}"
dayOfMonth: {{ dayOfMonth }}
startDate: "{{ startDate }}"
endDate: "{{ endDate }}"
scope: "{{ scope }}"
status: "{{ status }}"
viewId: "{{ viewId }}"
- name: eTag
value: "{{ eTag }}"
description: |
Resource Etag. For update calls, eTag is optional and can be specified to achieve optimistic concurrency. Fetch the resource's eTag by doing a 'GET' call first and then including the latest eTag as part of the request body or 'If-Match' header while performing the update. For create calls, eTag is not required.
- name: kind
value: "{{ kind }}"
description: |
Kind of the scheduled action. Known values are: "Email" and "InsightAlert".
valid_values: ['Email', 'InsightAlert']
REPLACE examples
- create_or_update_by_scope
- create_or_update
Create or update a shared scheduled action within the given scope.
REPLACE azure.cost_management.scheduled_actions
SET
properties = '{{ properties }}',
eTag = '{{ eTag }}',
kind = '{{ kind }}'
WHERE
scope = '{{ scope }}' --required
AND name = '{{ name }}' --required
RETURNING
id,
name,
eTag,
kind,
properties,
systemData,
type;
Create or update a private scheduled action.
REPLACE azure.cost_management.scheduled_actions
SET
properties = '{{ properties }}',
eTag = '{{ eTag }}',
kind = '{{ kind }}'
WHERE
name = '{{ name }}' --required
RETURNING
id,
name,
eTag,
kind,
properties,
systemData,
type;
DELETE examples
- delete_by_scope
- delete
Delete a scheduled action within the given scope.
DELETE FROM azure.cost_management.scheduled_actions
WHERE scope = '{{ scope }}' --required
AND name = '{{ name }}' --required
;
Delete a private scheduled action.
DELETE FROM azure.cost_management.scheduled_actions
WHERE name = '{{ name }}' --required
;
Lifecycle Methods
- run
- run_by_scope
- check_name_availability
- check_name_availability_by_scope
Processes a private scheduled action.
EXEC azure.cost_management.scheduled_actions.run
@name='{{ name }}' --required
;
Runs a shared scheduled action within the given scope.
EXEC azure.cost_management.scheduled_actions.run_by_scope
@scope='{{ scope }}' --required,
@name='{{ name }}' --required
;
Checks availability and correctness of the name for a scheduled action.
EXEC azure.cost_management.scheduled_actions.check_name_availability
@@json=
'{
"name": "{{ name }}",
"type": "{{ type }}"
}'
;
Checks availability and correctness of the name for a scheduled action within the given scope.
EXEC azure.cost_management.scheduled_actions.check_name_availability_by_scope
@scope='{{ scope }}' --required
@@json=
'{
"name": "{{ name }}",
"type": "{{ type }}"
}'
;