1

aws nodejs sdkを使用して IOT を更新しようとしましたが、「検証エラー」例外が発生しました

コード:

var AWS = require("aws-sdk");
AWS.config.apiVersions = {
  iot: '2015-05-28',
};

var attribs = {};

attribs.type = "Type Value";
attribs.name = "Device Name";

var params = {
   thingName: thing_name,
   attributePayload: {
       attributes: attribs
   }
};

iot.updateThing(params, function(err, data) {
    if (err) {
        console.log(err, err.stack); // an error occurred
    } else {
        console.log(data); // successful response
    }
});

例外 :

message: '1 validation error detected: Value \'{name=Device Value, type=Type Value}\' at \'attributePayload.attributes\' failed to satisfy constraint: Map value must satisfy constraint: [Member must have length less than or equal to 1024, Member must have length greater than or equal to 0, Member must satisfy regular expression pattern: [a-zA-Z0-9_.,@/:#-]+]',
  code: 'InvalidRequestException',
  time: Mon Mar 14 2016 07:00:13 GMT+0000 (UTC),
  requestId: '53474c09-e9b2-11e5-a613-a924097ce6cf',
  statusCode: 400,
  retryable: false,
  retryDelay: 44.59372889250517

私のupdateThingコードの何が問題なのか知っている人はいますか? Iot を更新する必要がある

4

1 に答える 1