Ошибка проверки AWS IOT Update Thing в NodeJS

Я попытался обновить свой IOT с помощью aws nodejs sdk, но это дало мне исключение "Ошибка проверки"

Код:

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? Мне нужно обновить кое-что


person Ijas Ahamed N    schedule 14.03.2016    source источник


Ответы (1)


Значения атрибутов вещей IOT не должны содержать пробелов

Пробовал ниже атрибутов

attribs.type = "Type_Value";
attribs.name = "Device_Name";

Это работало нормально. Кроме того, к устройству IOT можно прикрепить только три атрибута.

person Ijas Ahamed N    schedule 14.03.2016