下面的代码当前正在Lambda-NodeJS 6.10中运行,并导入了所有正确的模块。
预期输出是JobId
但是,尽管这是AWS提供的语法,但我一直收到验证错误。如果我同时删除了引起错误的两个项目,则它可以成功运行,但是,当对返回的JobId调用后续的Rekognition API时,它将失败,因为从未指定该集合。
var params = {
CollectionId: 'myCollectionName', /* required */
Video: { /* required */
S3Object: {
Bucket: 'myBucketName',
Name: 'myVideoInS3'
}
},
FaceMatchThreshold: 70.0,
JobTag: 'myTag',
NotificationChannel: {
RoleArn: 'myNotificationRole', /* required */
SNSTopicArn: 'myTopicARN' /* required */
}
};
rekognition.startFaceSearch(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
错误
MultipleValidationErrors: There were 2 validation errors:
* UnexpectedParameter: Unexpected key 'CollectionId' found in params
* UnexpectedParameter: Unexpected key 'FaceMatchThreshold' found in params
at ParamValidator.validate (/var/task/node_modules/aws-sdk/lib/param_validator.js:40:28)
当我在Python中复制此代码时,它将无缝运行,因此该错误与集合无关。有人有想法吗?