|
@@ -41,7 +41,7 @@ class ChinaIOTClient(IOTObject):
|
|
}
|
|
}
|
|
return res
|
|
return res
|
|
|
|
|
|
- def create_keys_and_certificate(self, uid, device_version):
|
|
|
|
|
|
+ def create_keys_and_certificate(self, uid):
|
|
result = self.client.create_keys_and_certificate(setAsActive=True)
|
|
result = self.client.create_keys_and_certificate(setAsActive=True)
|
|
res = {
|
|
res = {
|
|
'certificateId': result['certificateId'],
|
|
'certificateId': result['certificateId'],
|
|
@@ -71,9 +71,7 @@ class ChinaIOTClient(IOTObject):
|
|
"Type": "AWS::IoT::Thing",
|
|
"Type": "AWS::IoT::Thing",
|
|
"Properties": {
|
|
"Properties": {
|
|
"AttributePayload": {},
|
|
"AttributePayload": {},
|
|
- "ThingGroups": {
|
|
|
|
- "Ref": "ThingGroups"
|
|
|
|
- },
|
|
|
|
|
|
+ "ThingGroups": [],
|
|
"ThingName": {
|
|
"ThingName": {
|
|
"Ref": "ThingName"
|
|
"Ref": "ThingName"
|
|
},
|
|
},
|
|
@@ -102,7 +100,6 @@ class ChinaIOTClient(IOTObject):
|
|
|
|
|
|
templateBody = json.dumps(templateBody)
|
|
templateBody = json.dumps(templateBody)
|
|
parameters = {"ThingName": "Ansjer_Device_" + uid,
|
|
parameters = {"ThingName": "Ansjer_Device_" + uid,
|
|
- "ThingGroups": device_version,
|
|
|
|
"AWS::IoT::Certificate::Id": res['certificateId']}
|
|
"AWS::IoT::Certificate::Id": res['certificateId']}
|
|
self.client.register_thing(
|
|
self.client.register_thing(
|
|
templateBody=templateBody,
|
|
templateBody=templateBody,
|
|
@@ -131,7 +128,7 @@ class AmericaIOTClient(IOTObject):
|
|
}
|
|
}
|
|
return res
|
|
return res
|
|
|
|
|
|
- def create_keys_and_certificate(self, uid, device_version):
|
|
|
|
|
|
+ def create_keys_and_certificate(self, uid):
|
|
result = self.client.create_keys_and_certificate(setAsActive=True)
|
|
result = self.client.create_keys_and_certificate(setAsActive=True)
|
|
res = {
|
|
res = {
|
|
'certificateId': result['certificateId'],
|
|
'certificateId': result['certificateId'],
|
|
@@ -161,9 +158,7 @@ class AmericaIOTClient(IOTObject):
|
|
"Type": "AWS::IoT::Thing",
|
|
"Type": "AWS::IoT::Thing",
|
|
"Properties": {
|
|
"Properties": {
|
|
"AttributePayload": {},
|
|
"AttributePayload": {},
|
|
- "ThingGroups": {
|
|
|
|
- "Ref": "ThingGroups"
|
|
|
|
- },
|
|
|
|
|
|
+ "ThingGroups": [],
|
|
"ThingName": {
|
|
"ThingName": {
|
|
"Ref": "ThingName"
|
|
"Ref": "ThingName"
|
|
},
|
|
},
|
|
@@ -192,7 +187,6 @@ class AmericaIOTClient(IOTObject):
|
|
|
|
|
|
templateBody = json.dumps(templateBody)
|
|
templateBody = json.dumps(templateBody)
|
|
parameters = {"ThingName": "Ansjer_Device_" + uid,
|
|
parameters = {"ThingName": "Ansjer_Device_" + uid,
|
|
- "ThingGroups": device_version,
|
|
|
|
"AWS::IoT::Certificate::Id": res['certificateId']}
|
|
"AWS::IoT::Certificate::Id": res['certificateId']}
|
|
self.client.register_thing(
|
|
self.client.register_thing(
|
|
templateBody=templateBody,
|
|
templateBody=templateBody,
|
|
@@ -220,7 +214,7 @@ class AsiaIOTClient(IOTObject):
|
|
}
|
|
}
|
|
return res
|
|
return res
|
|
|
|
|
|
- def create_keys_and_certificate(self, uid, device_version):
|
|
|
|
|
|
+ def create_keys_and_certificate(self, uid):
|
|
result = self.client.create_keys_and_certificate(setAsActive=True)
|
|
result = self.client.create_keys_and_certificate(setAsActive=True)
|
|
res = {
|
|
res = {
|
|
'certificateId': result['certificateId'],
|
|
'certificateId': result['certificateId'],
|
|
@@ -250,9 +244,7 @@ class AsiaIOTClient(IOTObject):
|
|
"Type": "AWS::IoT::Thing",
|
|
"Type": "AWS::IoT::Thing",
|
|
"Properties": {
|
|
"Properties": {
|
|
"AttributePayload": {},
|
|
"AttributePayload": {},
|
|
- "ThingGroups": {
|
|
|
|
- "Ref": "ThingGroups"
|
|
|
|
- },
|
|
|
|
|
|
+ "ThingGroups": [],
|
|
"ThingName": {
|
|
"ThingName": {
|
|
"Ref": "ThingName"
|
|
"Ref": "ThingName"
|
|
},
|
|
},
|
|
@@ -281,7 +273,6 @@ class AsiaIOTClient(IOTObject):
|
|
|
|
|
|
templateBody = json.dumps(templateBody)
|
|
templateBody = json.dumps(templateBody)
|
|
parameters = {"ThingName": "Ansjer_Device_" + uid,
|
|
parameters = {"ThingName": "Ansjer_Device_" + uid,
|
|
- "ThingGroups": device_version,
|
|
|
|
"AWS::IoT::Certificate::Id": res['certificateId']}
|
|
"AWS::IoT::Certificate::Id": res['certificateId']}
|
|
self.client.register_thing(
|
|
self.client.register_thing(
|
|
templateBody=templateBody,
|
|
templateBody=templateBody,
|
|
@@ -309,7 +300,7 @@ class EuropeIOTClient(IOTObject):
|
|
}
|
|
}
|
|
return res
|
|
return res
|
|
|
|
|
|
- def create_keys_and_certificate(self, uid, device_version):
|
|
|
|
|
|
+ def create_keys_and_certificate(self, uid):
|
|
result = self.client.create_keys_and_certificate(setAsActive=True)
|
|
result = self.client.create_keys_and_certificate(setAsActive=True)
|
|
res = {
|
|
res = {
|
|
'certificateId': result['certificateId'],
|
|
'certificateId': result['certificateId'],
|
|
@@ -339,9 +330,7 @@ class EuropeIOTClient(IOTObject):
|
|
"Type": "AWS::IoT::Thing",
|
|
"Type": "AWS::IoT::Thing",
|
|
"Properties": {
|
|
"Properties": {
|
|
"AttributePayload": {},
|
|
"AttributePayload": {},
|
|
- "ThingGroups": {
|
|
|
|
- "Ref": "ThingGroups"
|
|
|
|
- },
|
|
|
|
|
|
+ "ThingGroups": [],
|
|
"ThingName": {
|
|
"ThingName": {
|
|
"Ref": "ThingName"
|
|
"Ref": "ThingName"
|
|
},
|
|
},
|
|
@@ -370,7 +359,6 @@ class EuropeIOTClient(IOTObject):
|
|
|
|
|
|
templateBody = json.dumps(templateBody)
|
|
templateBody = json.dumps(templateBody)
|
|
parameters = {"ThingName": "Ansjer_Device_" + uid,
|
|
parameters = {"ThingName": "Ansjer_Device_" + uid,
|
|
- "ThingGroups": device_version,
|
|
|
|
"AWS::IoT::Certificate::Id": res['certificateId']}
|
|
"AWS::IoT::Certificate::Id": res['certificateId']}
|
|
self.client.register_thing(
|
|
self.client.register_thing(
|
|
templateBody=templateBody,
|
|
templateBody=templateBody,
|