database_recommended_actions
Creates, updates, deletes, gets or lists a database_recommended_actions resource.
Overview
| Name | database_recommended_actions |
| Type | Resource |
| Id | azure.sql.database_recommended_actions |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_database_advisor
| 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. |
details | object | Gets additional details specific to this recommended action. |
errorDetails | object | Gets the error details if and why this recommended action is put to error state. |
estimatedImpact | array | Gets the estimated impact info for this recommended action e.g., Estimated CPU gain, Estimated Disk Space change. |
executeActionDuration | string | Gets the time taken for applying this recommended action on user resource. e.g., time taken for index creation. |
executeActionInitiatedBy | string | Gets if approval for applying this recommended action was given by user/system. Known values are: "User" and "System". (User, System) |
executeActionInitiatedTime | string (date-time) | Gets the time when this recommended action was approved for execution. |
executeActionStartTime | string (date-time) | Gets the time when system started applying this recommended action on the user resource. e.g., index creation start time. |
implementationDetails | object | Gets the implementation details of this recommended action for user to apply it manually. |
isArchivedAction | boolean | Gets if this recommended action was suggested some time ago but user chose to ignore this and system added a new recommended action again. |
isExecutableAction | boolean | Gets if this recommended action is actionable by user. |
isRevertableAction | boolean | Gets if changes applied by this recommended action can be reverted by user. |
kind | string | Resource kind. |
lastRefresh | string (date-time) | Gets time when this recommended action was last refreshed. |
linkedObjects | array | Gets the linked objects, if any. |
location | string | Resource location. |
observedImpact | array | Gets the observed/actual impact info for this recommended action e.g., Actual CPU gain, Actual Disk Space change. |
recommendationReason | string | Gets the reason for recommending this action. e.g., DuplicateIndex. |
revertActionDuration | string | Gets the time taken for reverting changes of this recommended action on user resource. e.g., time taken for dropping the created index. |
revertActionInitiatedBy | string | Gets if approval for reverting this recommended action was given by user/system. Known values are: "User" and "System". (User, System) |
revertActionInitiatedTime | string (date-time) | Gets the time when this recommended action was approved for revert. |
revertActionStartTime | string (date-time) | Gets the time when system started reverting changes of this recommended action on user resource. e.g., time when index drop is executed. |
score | integer | Gets the impact of this recommended action. Possible values are 1 - Low impact, 2 - Medium Impact and 3 - High Impact. |
state | object | Gets the info of the current state the recommended action is in. Required. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
timeSeries | array | Gets the time series info of metrics for this recommended action e.g., CPU consumption time series. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
validSince | string (date-time) | Gets the time since when this recommended action is valid. |
| 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. |
details | object | Gets additional details specific to this recommended action. |
errorDetails | object | Gets the error details if and why this recommended action is put to error state. |
estimatedImpact | array | Gets the estimated impact info for this recommended action e.g., Estimated CPU gain, Estimated Disk Space change. |
executeActionDuration | string | Gets the time taken for applying this recommended action on user resource. e.g., time taken for index creation. |
executeActionInitiatedBy | string | Gets if approval for applying this recommended action was given by user/system. Known values are: "User" and "System". (User, System) |
executeActionInitiatedTime | string (date-time) | Gets the time when this recommended action was approved for execution. |
executeActionStartTime | string (date-time) | Gets the time when system started applying this recommended action on the user resource. e.g., index creation start time. |
implementationDetails | object | Gets the implementation details of this recommended action for user to apply it manually. |
isArchivedAction | boolean | Gets if this recommended action was suggested some time ago but user chose to ignore this and system added a new recommended action again. |
isExecutableAction | boolean | Gets if this recommended action is actionable by user. |
isRevertableAction | boolean | Gets if changes applied by this recommended action can be reverted by user. |
kind | string | Resource kind. |
lastRefresh | string (date-time) | Gets time when this recommended action was last refreshed. |
linkedObjects | array | Gets the linked objects, if any. |
location | string | Resource location. |
observedImpact | array | Gets the observed/actual impact info for this recommended action e.g., Actual CPU gain, Actual Disk Space change. |
recommendationReason | string | Gets the reason for recommending this action. e.g., DuplicateIndex. |
revertActionDuration | string | Gets the time taken for reverting changes of this recommended action on user resource. e.g., time taken for dropping the created index. |
revertActionInitiatedBy | string | Gets if approval for reverting this recommended action was given by user/system. Known values are: "User" and "System". (User, System) |
revertActionInitiatedTime | string (date-time) | Gets the time when this recommended action was approved for revert. |
revertActionStartTime | string (date-time) | Gets the time when system started reverting changes of this recommended action on user resource. e.g., time when index drop is executed. |
score | integer | Gets the impact of this recommended action. Possible values are 1 - Low impact, 2 - Medium Impact and 3 - High Impact. |
state | object | Gets the info of the current state the recommended action is in. Required. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
timeSeries | array | Gets the time series info of metrics for this recommended action e.g., CPU consumption time series. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
validSince | string (date-time) | Gets the time since when this recommended action is valid. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, server_name, database_name, advisor_name, recommended_action_name, subscription_id | Gets a database recommended action. | |
list_by_database_advisor | select | resource_group_name, server_name, database_name, advisor_name, subscription_id | Gets list of Database Recommended Actions. | |
update | update | resource_group_name, server_name, database_name, advisor_name, recommended_action_name, subscription_id | Updates a database recommended action. |
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 |
|---|---|---|
advisor_name | string | The name of the Database Advisor. Required. |
database_name | string | The name of the database. Required. |
recommended_action_name | string | The name of Database Recommended Action. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
server_name | string | The name of the server. Required. |
subscription_id | string |
SELECT examples
- get
- list_by_database_advisor
Gets a database recommended action.
SELECT
id,
name,
details,
errorDetails,
estimatedImpact,
executeActionDuration,
executeActionInitiatedBy,
executeActionInitiatedTime,
executeActionStartTime,
implementationDetails,
isArchivedAction,
isExecutableAction,
isRevertableAction,
kind,
lastRefresh,
linkedObjects,
location,
observedImpact,
recommendationReason,
revertActionDuration,
revertActionInitiatedBy,
revertActionInitiatedTime,
revertActionStartTime,
score,
state,
systemData,
timeSeries,
type,
validSince
FROM azure.sql.database_recommended_actions
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND database_name = '{{ database_name }}' -- required
AND advisor_name = '{{ advisor_name }}' -- required
AND recommended_action_name = '{{ recommended_action_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Gets list of Database Recommended Actions.
SELECT
id,
name,
details,
errorDetails,
estimatedImpact,
executeActionDuration,
executeActionInitiatedBy,
executeActionInitiatedTime,
executeActionStartTime,
implementationDetails,
isArchivedAction,
isExecutableAction,
isRevertableAction,
kind,
lastRefresh,
linkedObjects,
location,
observedImpact,
recommendationReason,
revertActionDuration,
revertActionInitiatedBy,
revertActionInitiatedTime,
revertActionStartTime,
score,
state,
systemData,
timeSeries,
type,
validSince
FROM azure.sql.database_recommended_actions
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND database_name = '{{ database_name }}' -- required
AND advisor_name = '{{ advisor_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
UPDATE examples
- update
Updates a database recommended action.
UPDATE azure.sql.database_recommended_actions
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND server_name = '{{ server_name }}' --required
AND database_name = '{{ database_name }}' --required
AND advisor_name = '{{ advisor_name }}' --required
AND recommended_action_name = '{{ recommended_action_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
kind,
location,
properties,
systemData,
type;