- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
ListRecommendationsCommand
Returns a list of a specified insight's recommendations. Each recommendation includes a list of related metrics and a list of related events.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { DevOpsGuruClient, ListRecommendationsCommand } from "@aws-sdk/client-devops-guru"; // ES Modules import
// const { DevOpsGuruClient, ListRecommendationsCommand } = require("@aws-sdk/client-devops-guru"); // CommonJS import
const client = new DevOpsGuruClient(config);
const input = { // ListRecommendationsRequest
InsightId: "STRING_VALUE", // required
NextToken: "STRING_VALUE",
Locale: "DE_DE" || "EN_US" || "EN_GB" || "ES_ES" || "FR_FR" || "IT_IT" || "JA_JP" || "KO_KR" || "PT_BR" || "ZH_CN" || "ZH_TW",
AccountId: "STRING_VALUE",
};
const command = new ListRecommendationsCommand(input);
const response = await client.send(command);
// { // ListRecommendationsResponse
// Recommendations: [ // Recommendations
// { // Recommendation
// Description: "STRING_VALUE",
// Link: "STRING_VALUE",
// Name: "STRING_VALUE",
// Reason: "STRING_VALUE",
// RelatedEvents: [ // RecommendationRelatedEvents
// { // RecommendationRelatedEvent
// Name: "STRING_VALUE",
// Resources: [ // RecommendationRelatedEventResources
// { // RecommendationRelatedEventResource
// Name: "STRING_VALUE",
// Type: "STRING_VALUE",
// },
// ],
// },
// ],
// RelatedAnomalies: [ // RecommendationRelatedAnomalies
// { // RecommendationRelatedAnomaly
// Resources: [ // RecommendationRelatedAnomalyResources
// { // RecommendationRelatedAnomalyResource
// Name: "STRING_VALUE",
// Type: "STRING_VALUE",
// },
// ],
// SourceDetails: [ // RelatedAnomalySourceDetails
// { // RecommendationRelatedAnomalySourceDetail
// CloudWatchMetrics: [ // RecommendationRelatedCloudWatchMetricsSourceDetails
// { // RecommendationRelatedCloudWatchMetricsSourceDetail
// MetricName: "STRING_VALUE",
// Namespace: "STRING_VALUE",
// },
// ],
// },
// ],
// AnomalyId: "STRING_VALUE",
// },
// ],
// Category: "STRING_VALUE",
// },
// ],
// NextToken: "STRING_VALUE",
// };
ListRecommendationsCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
InsightId Required | string | undefined | The ID of the requested insight. |
AccountId | string | undefined | The ID of the Amazon Web Services account. |
Locale | Locale | undefined | A locale that specifies the language to use for recommendations. |
NextToken | string | undefined | The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page. |
ListRecommendationsCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
NextToken | string | undefined | The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null. |
Recommendations | Recommendation[] | undefined | An array of the requested recommendations. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions. For more information, see Access Management in the IAM User Guide. |
InternalServerException | server | An internal failure in an Amazon service occurred. |
ResourceNotFoundException | client | A requested resource could not be found |
ThrottlingException | client | The request was denied due to a request throttling. |
ValidationException | client | Contains information about data passed in to a field during a request that is not valid. |
DevOpsGuruServiceException | Base exception class for all service exceptions from DevOpsGuru service. |