AWS SDK 또는 CLI와 함께 ListSteps 사용 - AWS SDK 코드 예제

AWS SDK 예제 GitHub 리포지토리에 더 많은 AWS문서 SDK 예제가 있습니다.

AWS SDK 또는 CLI와 함께 ListSteps 사용

다음 코드 예시는 ListSteps의 사용 방법을 보여 줍니다.

CLI
AWS CLI

다음 명령은 클러스터 ID가 j-3SD91U2E1L2QX인 클러스터의 모든 단계를 나열합니다.

aws emr list-steps --cluster-id j-3SD91U2E1L2QX
  • API 세부 정보는 AWS CLI 명령 참조의 ListSteps를 참조하세요.

Python
SDK for Python (Boto3)
참고

GitHub에 더 많은 내용이 있습니다. AWS 코드 예제 리포지토리에서 전체 예제를 찾고 설정 및 실행하는 방법을 배워보세요.

def list_steps(cluster_id, emr_client): """ Gets a list of steps for the specified cluster. In this example, all steps are returned, including completed and failed steps. :param cluster_id: The ID of the cluster. :param emr_client: The Boto3 EMR client object. :return: The list of steps for the specified cluster. """ try: response = emr_client.list_steps(ClusterId=cluster_id) steps = response["Steps"] logger.info("Got %s steps for cluster %s.", len(steps), cluster_id) except ClientError: logger.exception("Couldn't get steps for cluster %s.", cluster_id) raise else: return steps
  • API 세부 정보는 AWS SDK for Python (Boto3) API 참조ListSteps를 참조하십시오.