Beispiel #1
0
    def tool_get_instances_expired_models(self):
        self.action_get_instance()
        for page in range(1, 9999):
            self.request.add_query_param('PageNumber', page)
            self.request.add_query_param('PageSize', settings.ALIYUN_PAGESIZE)
            results = self.post()

            for result in results.get('DBInstances').get('DBInstance'):
                yield AnalyzeMongoDBTool.get_expired_models(result)

            if page * settings.ALIYUN_PAGESIZE > results.get('TotalRecordCount'):
                break
Beispiel #2
0
 def tool_get_instance_expired_models(self, instance_id):
     self.action_get_instance()
     self.request.add_query_param('DBInstanceId', instance_id)
     results = self.post()
     yield AnalyzeMongoDBTool.get_expired_models(
         results.get('DBInstances').get('DBInstance')[0])