这个问题是针对AWS开发工具包的,而不是aws cli。似乎很奇怪,我找不到按名称请求EMR群集的方法。我能做的最好的事情是按创建的日期请求群集列表,然后按名称进行过滤,如下所示:
val clusterName = "my_cluster"
val emrClient = AmazonElasticMapReduceClientBuilder(...)
val dateAfter = new Date(MILLI_SEC_BEFORE)
val listClusterReq = new ListClustersRequest().withCreatedAfter(dateAfter)
val lclus = emrClient.listClusters(listClusterReq).getClusters
val filtered = lclus.asScala.filter(c => c.getName == clusterName)
如何直接按群集名称请求群集而不是进行过滤?