Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅
中国的 Amazon Web Services 服务入门
(PDF)。
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
ListSolutions
搭配使用 Amazon SDK
以下代码示例演示如何使用 ListSolutions
。
- Java
-
- SDK适用于 Java 2.x
-
public static void listAllSolutions(PersonalizeClient personalizeClient, String datasetGroupArn) {
try {
ListSolutionsRequest solutionsRequest = ListSolutionsRequest.builder()
.maxResults(10)
.datasetGroupArn(datasetGroupArn)
.build();
ListSolutionsResponse response = personalizeClient.listSolutions(solutionsRequest);
List<SolutionSummary> solutions = response.solutions();
for (SolutionSummary solution : solutions) {
System.out.println("The solution ARN is: " + solution.solutionArn());
System.out.println("The solution name is: " + solution.name());
}
} catch (PersonalizeException e) {
System.err.println(e.awsErrorDetails().errorMessage());
System.exit(1);
}
}
有关 Amazon SDK开发者指南和代码示例的完整列表,请参阅将 Amazon Personalize 与 Amazon SDK。本主题还包括有关入门的信息以及有关先前SDK版本的详细信息。