def lambda_handler(event, context):
    # return event
    status = LOADER.personalize_cli.describe_dataset_group(
        datasetGroupArn=event['datasetGroupArn'])['datasetGroup']

    actions.take_action_delete(status['status'])
    return status['status']
コード例 #2
0
def lambda_handler(event, context):
    # return event
    status = LOADER.personalize_cli.describe_campaign(
        campaignArn=event['campaignArn'])['campaign']

    actions.take_action_delete(status['status'])
    return status['status']
コード例 #3
0
def lambda_handler(event, context):
    forecasts = event['params']['Forecast']
    # Delete forecast export job
    try:
        for forecast in forecasts:
            LOADER.forecast_cli.delete_forecast_export_job(
                ForecastExportJobArn=forecast['ForecastExportJobArn'])
        for forecast in forecasts:
            actions.take_action_delete(
                status=LOADER.forecast_cli.describe_forecast_export_job(
                    ForecastExportJobArn=forecast['ForecastExportJobArn'])
                ['Status'])
    except (LOADER.forecast_cli.exceptions.ResourceNotFoundException,
            KeyError):
        LOADER.logger.info('Forecast export job not found. Passing.')

    # Delete forecast
    try:
        for forecast in forecasts:
            LOADER.forecast_cli.delete_forecast(
                ForecastArn=forecast['ForecastArn'])
        for forecast in forecasts:
            actions.take_action_delete(
                LOADER.forecast_cli.describe_forecast(
                    ForecastArn=forecast['ForecastArn'])['Status'])
    except (LOADER.forecast_cli.exceptions.ResourceNotFoundException,
            KeyError):
        LOADER.logger.info('Forecast not found. Passing.')

    return event
コード例 #4
0
def lambda_handler(event, context):
    # return event
    status = LOADER.personalize_cli.describe_event_tracker(
        eventTrackerArn=event['eventTrackerArn'])['eventTracker']

    actions.take_action_delete(status['status'])
    return status['status']
コード例 #5
0
def lambda_handler(event, context):
    try:
        LOADER.forecast_cli.delete_predictor(
            PredictorArn=event['PredictorArn'])
        actions.take_action_delete(
            LOADER.forecast_cli.describe_predictor(
                PredictorArn=event['PredictorArn'])['Status'])

    except (LOADER.forecast_cli.exceptions.ResourceNotFoundException,
            KeyError):
        LOADER.logger.info('Predictor not found! Passing.')

    return event
コード例 #6
0
ファイル: deletedataset.py プロジェクト: DarryHu/AWS_test
def lambda_handler(event, context):
    try:
        LOADER.forecast_cli.delete_dataset_import_job(
            DatasetImportJobArn=event['DatasetImportJobArn']
        )
        actions.take_action_delete(
            LOADER.forecast_cli.describe_dataset_import_job(
                DatasetImportJobArn=event['DatasetImportJobArn']
            )['Status']
        )

    except (LOADER.forecast_cli.exceptions.ResourceNotFoundException, KeyError):
        LOADER.logger.info('Import job not found! Passing.')

    return event
コード例 #7
0
def lambda_handler(event, context):
    datasets = event['params']['Datasets']
    try:
        for dataset in datasets:
            LOADER.forecast_cli.delete_dataset_import_job(
                DatasetImportJobArn=dataset['DatasetImportJobArn'])
        for dataset in datasets:
            actions.take_action_delete(
                LOADER.forecast_cli.describe_dataset_import_job(
                    DatasetImportJobArn=dataset['DatasetImportJobArn'])
                ['Status'])

    except (LOADER.forecast_cli.exceptions.ResourceNotFoundException,
            KeyError):
        LOADER.logger.info('Import job not found! Passing.')

    try:
        for dataset in datasets:
            LOADER.forecast_cli.delete_dataset(
                DatasetArn=dataset['DatasetArn'])
        for dataset in datasets:
            actions.take_action_delete(
                LOADER.forecast_cli.describe_dataset(
                    DatasetArn=dataset['DatasetArn'])['Status'])

    except (LOADER.forecast_cli.exceptions.ResourceNotFoundException,
            KeyError):
        LOADER.logger.info('Import job not found! Passing.')

    datasetgroup = event['params']['DatasetGroup']
    try:
        LOADER.forecast_cli.delete_dataset_group(
            DatasetGroupArn=datasetgroup['DatasetGroupArn'])
        actions.take_action_delete(
            LOADER.forecast_cli.describe_dataset_group(
                DatasetGroupArn=datasetgroup['DatasetGroupArn'])['Status'])
    except (LOADER.forecast_cli.exceptions.ResourceNotFoundException,
            KeyError):
        LOADER.logger.info('Import job not found! Passing.')

    return event