如何在Lambda中访问AWS CodeBuild报表? [英] How to access AWS CodeBuild reports in a Lambda?

查看:67
本文介绍了如何在Lambda中访问AWS CodeBuild报表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我有一个EventBridge发送CodeBuild构建阶段更新,状态更新为"FAILED".到Lambda.具体来说-运行单元测试,然后创建一个报告,其中包含有关所有已运行测试的信息.我的Lambda从CodeBuild接收到的事件包含报告的ARN,我希望Lambda读取该ARN,访问报告并输出出了问题.

At the moment I have an EventBridge sending CodeBuild build phase updates that have status "FAILED" to a Lambda. Specifically - unit tests are run and then a report is created that contains information about all the tests that were run. The event that is received by my Lambda from CodeBuild contains ARN for the reports and I would like the Lambda to read that ARN, access the report and output what's gone wrong.

我似乎找不到在Lambda中访问CodeBuild报表的方法-AWS CDK API参考似乎在CodeBuild部分中没有针对该内容的任何内容.我具有生成的报告的ARN,但我不知道如何让我的Lambda读取它.

I can't seem to find a way to access the CodeBuild report within a Lambda - AWS CDK API reference doesn't seem to have anything for that within the CodeBuild sections. I have the ARN for the generated report, I just don't know how to make my Lambda read it.

推荐答案

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/codebuild.html#CodeBuild.Client.batch_get_reports was exactly what I was looking for. Searched around and couldn't see it, and here it is! describe_test_cases() is exactly what I needed for this.

感谢链接@jingx

Thanks for the link @jingx

这篇关于如何在Lambda中访问AWS CodeBuild报表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆