rules/customer-fc/aggregate-ram-role-last-login-expired-check-v2.py [198:222]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    client = Sls20201230Client(config)

    x_days = 90

    to_timestamp = int(round(time.time()))
    from_timestamp = to_timestamp - x_days * 24 * 60 * 60
    get_logs_request = sls_20201230_models.GetLogsRequest(
        from_=from_timestamp,
        to=to_timestamp,
        query='event.userIdentity.principalId: ' + resource_id  # event.userIdentity.principalId: 389051450072705987
    )
    try:
        runtime = util_models.RuntimeOptions()
        headers = {}
        try:
            response = client.get_logs_with_options(project, logstore,
                                                    get_logs_request, headers, runtime)
            events_cnt = len(response.body)
            return events_cnt

        except Exception as error:
            UtilClient.assert_as_string(error.message)

    except Exception as e:
        logger.error('GetLogsRequest error: %s' % e)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



