def report_expiring_dbinstance(self, days=7):
        expiring_instances = []
        all_instances = self.get_all_dbinstance_ids()
        for ins in all_instances:
            res = self.get_dbinstance(ins)
            if res.instance_charge_type == 'Prepaid':
                expire_time = datetime.datetime.strptime(res.expired_time, "%Y-%m-%dT%H:%M:%SZ")
                now = datetime.datetime.now()
                if (expire_time - now).days <= days:
                    expiring_instances.append(ins)
        return expiring_instances
Report PrePaid RDS instances that are about to expire in <days>.
dataset/ETHPy150Open quixey/python-aliyun/aliyun/rds/connection.py/RdsConnection.report_expiring_dbinstance