I have created a job with job-document as follow:
(我创建了一个带有作业文档的作业,如下所示:)
{
"operation": "install",
"packageName": "copy-server.js",
"workingDirectory": "./examples",
"files": [
{
"fileName": "server.js",
"fileVersion": "1.0.0",
"fileSource": {
"url": "${aws:iot:code-sign-signature:s3://us-east-1.<bucket_name>/server.js@version_id}"
}
}
]
}
I am using a profile created using platformId of "AWSIoTDeviceManagement-SHA256-ECDSA" for code signing.
(我正在使用使用“ AWSIoTDeviceManagement-SHA256-ECDSA”的platformId创建的配置文件进行代码签名。)
the output is the below job document recieved by the job agent: (输出是作业代理收到的以下作业文档:)
{
"operation": "install",
"packageName": "copy-job.js",
"workingDirectory": "./examples/",
"files": [
{
"fileName": "server.js",
"fileVersion": "1.0.0",
"fileSource": {
"url": {
"rawPayloadSize": 137,
"signature": "xxxxxxxxXXXXXXxxxxxxxx==",
"signatureAlgorithm": "SHA256withECDSA",
"payloadLocation": {
"s3": {
"bucketName": "bucket_name",
"key": "server.js",
"version": "version_id"
}
}
}
}
}
]
Now as per the aws-iot-device-sdk-js document example for install the format shown there is:
(现在,按照aws-iot-device-sdk-js文档示例中所示的安装格式,有:)
{
"operation": "install",
"packageName": "uniquePackageName",
"workingDirectory": "../jobs-example-directory",
"launchCommand": "node jobs-example.js -f ~/certs -H <PREFIX>.iot.<REGION>.amazonaws.com -T thingName",
"autoStart": "true",
"files": [
{
"fileName": "jobs-example.js",
"fileVersion": "1.0.2.10",
"fileSource": {
"url": "https://some-bucket.s3.amazonaws.com/jobs-example.js"
},
"checksum": {
"inline": {
"value": "9569257356cfc5c7b2b849e5f58b5d287f183e08627743498d9bd52801a2fbe4"
},
"hashAlgorithm": "SHA256"
}
},
{
"fileName": "config.json",
"fileSource": {
"url": "https://some-bucket.s3.amazonaws.com/config.json"
}
}
]
}
- So my question here is am I doing something wrong to generate different outputs?
(所以我的问题是我在做错事情以生成不同的输出吗?)
- Or the example in the SDK and the generated document by AWS coding signing are handled in two different ways?
(还是以两种不同的方式来处理SDK中的示例以及通过AWS编码签名生成的文档?)
- I am stuck here so I am looking for any suggestions on how to tackle it and what's being done wrong from my side?
(我被困在这里,所以我正在寻找有关如何解决它的建议,以及我这边做错了什么?)
ask by Shailendra Yadav translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…