# !/usr/bin/env python
__author__ = "Danelle Cline, Duane Edgington"
__copyright__ = "Copyright 2022, MBARI"
__credits__ = ["MBARI"]
__license__ = "GPL"
__maintainer__ = "Duane Edgington"
__email__ = "duane at mbari.org"
__doc__ = '''

Various commands for monitoring the status of processing or training jobs

@author: __author__
@status: __status__
@license: __license__
'''

import boto3


def print_scaling_activities(resources: dict, num_records: int = 10):
    """
    Print scaling activities for a given resource
    """
    client = boto3.client('autoscaling')
    response = client.describe_scaling_activities(
        ActivityIds=[],
        AutoScalingGroupName=resources['ASG'],
        IncludeDeletedGroups=False,
        MaxRecords=num_records)

    for i in response['Activities']:
        print(f'{i["StartTime"]} {i["Description"]}  {i["Cause"]}')
