recommendations
Creates, updates, deletes, gets or lists a recommendations
resource.
Overview
Name | recommendations |
Type | Resource |
Id | azure.advisor.recommendations |
Fields
The following fields are returned by SELECT
queries:
- get
- list
OK. Successfully got recommendation detail.
Name | Datatype | Description |
---|---|---|
id | string (arm-id) | Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" |
name | string | The name of the resource |
properties | object | The properties of the recommendation. |
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" |
OK. Successfully obtained cached recommendations.
Name | Datatype | Description |
---|---|---|
id | string (arm-id) | Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" |
name | string | The name of the resource |
properties | object | The properties of the recommendation. |
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" |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | resourceUri , recommendationId | Obtains details of a cached recommendation. | |
list | select | subscriptionId | $filter , $top , $skipToken | Obtains cached recommendations for a subscription. The recommendations are generated or computed by invoking generateRecommendations. |
generate | exec | subscriptionId | Initiates the recommendation generation or computation process for a subscription. This operation is asynchronous. The generated recommendations are stored in a cache in the Advisor service. | |
exec_get_generate_status | exec | subscriptionId , operationId | Retrieves the status of the recommendation computation or generation process. Invoke this API after calling the generation recommendation. The URI of this API is returned in the Location field of the response header. | |
predict | exec | subscriptionId |
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 |
---|---|---|
operationId | string (uuid) | The operation ID, which can be found from the Location field in the generate recommendation response header. |
recommendationId | string | The recommendation ID. |
resourceUri | string | The fully qualified Azure Resource Manager identifier of the resource to which the recommendation applies. |
subscriptionId | string | The Azure subscription ID. |
$filter | string | The filter to apply to the recommendations. Filter can be applied to properties ['ResourceId', 'ResourceGroup', 'RecommendationTypeGuid', 'Category'] with operators ['eq', 'and', 'or']. Example: - $filter=Category eq 'Cost' and ResourceGroup eq 'MyResourceGroup' |
$skipToken | string | The page-continuation token to use with a paged version of this API. |
$top | integer (int32) | The number of recommendations per page if a paged version of this API is being used. |
SELECT
examples
- get
- list
Obtains details of a cached recommendation.
SELECT
id,
name,
properties,
systemData,
type
FROM azure.advisor.recommendations
WHERE resourceUri = '{{ resourceUri }}' -- required
AND recommendationId = '{{ recommendationId }}' -- required
;
Obtains cached recommendations for a subscription. The recommendations are generated or computed by invoking generateRecommendations.
SELECT
id,
name,
properties,
systemData,
type
FROM azure.advisor.recommendations
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
AND $skipToken = '{{ $skipToken }}'
;
Lifecycle Methods
- generate
- exec_get_generate_status
- predict
Initiates the recommendation generation or computation process for a subscription. This operation is asynchronous. The generated recommendations are stored in a cache in the Advisor service.
EXEC azure.advisor.recommendations.generate
@subscriptionId='{{ subscriptionId }}' --required
;
Retrieves the status of the recommendation computation or generation process. Invoke this API after calling the generation recommendation. The URI of this API is returned in the Location field of the response header.
EXEC azure.advisor.recommendations.exec_get_generate_status
@subscriptionId='{{ subscriptionId }}' --required,
@operationId='{{ operationId }}' --required
;
OK. Successfully obtained prediction.
EXEC azure.advisor.recommendations.predict
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"properties": "{{ properties }}"
}'
;