@@ -117,9 +117,9 @@ def thing_type_list(self):
117117 (['--headers' ], dict (help = """(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""" , dest = 'headers' , required = False )),
118118 ],
119119 formatter_class = RawTextHelpFormatter ,
120- help = ''' 查询物类型列表 ''' ,
120+ help = ''' 查询物类型详情 ''' ,
121121 description = '''
122- 查询物类型列表 。
122+ 查询物类型详情 。
123123
124124 示例: jdc iotcore thing-type-describe --instance-id xxx
125125 ''' ,
@@ -156,20 +156,20 @@ def thing_type_describe(self):
156156 description = '''
157157 根据模型ID查看物模型完整信息。
158158
159- 示例: jdc iotcore discribe -thing-model --instance-id xxx --thing-model-id xxx
159+ 示例: jdc iotcore describe -thing-model --instance-id xxx --thing-model-id xxx
160160 ''' ,
161161 )
162- def discribe_thing_model (self ):
162+ def describe_thing_model (self ):
163163 client_factory = ClientFactory ('iotcore' )
164164 client = client_factory .get (self .app )
165165 if client is None :
166166 return
167167
168168 try :
169- from jdcloud_sdk .services .iotcore .apis .DiscribeThingModelRequest import DiscribeThingModelRequest
169+ from jdcloud_sdk .services .iotcore .apis .DescribeThingModelRequest import DescribeThingModelRequest
170170 params_dict = collect_user_args (self .app )
171171 headers = collect_user_headers (self .app )
172- req = DiscribeThingModelRequest (params_dict , headers )
172+ req = DescribeThingModelRequest (params_dict , headers )
173173 resp = client .send (req )
174174 Printer .print_result (resp )
175175 except ImportError :
@@ -611,6 +611,8 @@ def add_device_links(self):
611611 (['--order' ], dict (help = """(string) 排序关键字--name,type,productKey,status--最多支持一个字段 """ , dest = 'order' , required = False )),
612612 (['--direction' ], dict (help = """(string) 顺序,升序降序--asc,desc """ , dest = 'direction' , required = False )),
613613 (['--parent-id' ], dict (help = """(string) 父设备Id """ , dest = 'parentId' , required = False )),
614+ (['--order-id' ], dict (help = """(int) 订单号 """ , dest = 'orderId' , type = int , required = False )),
615+ (['--device-collector-type' ], dict (help = """(string) 设备采集器类型 """ , dest = 'deviceCollectorType' , required = False )),
614616 (['--input-json' ], dict (help = '(json) 以json字符串或文件绝对路径形式作为输入参数。\n 字符串方式举例:--input-json \' {"field":"value"}\' ;\n 文件格式举例:--input-json file:///xxxx.json' , dest = 'input_json' , required = False )),
615617 (['--headers' ], dict (help = """(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""" , dest = 'headers' , required = False )),
616618 ],
@@ -824,8 +826,8 @@ def elevator_operating_status(self):
824826 arguments = [
825827 (['--instance-id' ], dict (help = """(string) Hub实例Id """ , dest = 'instanceId' , required = True )),
826828 (['--region-id' ], dict (help = """(string) 区域Id """ , dest = 'regionId' , required = False )),
827- (['--identifier' ], dict (help = """(string) 当前的链接码 """ , dest = 'identifier' , required = False )),
828- (['--protocol' ], dict (help = """(string) 当前的协议类型 """ , dest = 'protocol' , required = False )),
829+ (['--identifier' ], dict (help = """(string) 当前的链接码 """ , dest = 'identifier' , required = True )),
830+ (['--protocol' ], dict (help = """(string) 当前的协议类型:; 语音播报控制器-输入端子,0X00000~X0007:inputTerminal; 语音播报控制器-播放信息,0X00024~X0027:playInfo; LR001-516-5B边缘数据采集器-传感器管理:sensor; LR001-516-5B边缘数据采集器-采集器属性:collectorProperty; LR001-516-5B边缘数据采集器-电梯属性:elevatorProperty; """ , dest = 'protocol' , required = True )),
829831 (['--input-json' ], dict (help = '(json) 以json字符串或文件绝对路径形式作为输入参数。\n 字符串方式举例:--input-json \' {"field":"value"}\' ;\n 文件格式举例:--input-json file:///xxxx.json' , dest = 'input_json' , required = False )),
830832 (['--headers' ], dict (help = """(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""" , dest = 'headers' , required = False )),
831833 ],
@@ -834,7 +836,7 @@ def elevator_operating_status(self):
834836 description = '''
835837 获取协议信息。
836838
837- 示例: jdc iotcore collector-read-message --instance-id xxx
839+ 示例: jdc iotcore collector-read-message --instance-id xxx --identifier xxx --protocol xxx
838840 ''' ,
839841 )
840842 def collector_read_message (self ):
@@ -859,9 +861,45 @@ def collector_read_message(self):
859861 arguments = [
860862 (['--instance-id' ], dict (help = """(string) Hub实例Id """ , dest = 'instanceId' , required = True )),
861863 (['--region-id' ], dict (help = """(string) 区域Id """ , dest = 'regionId' , required = False )),
862- (['--identifier' ], dict (help = """(string) 当前的链接码 """ , dest = 'identifier' , required = False )),
863- (['--protocol' ], dict (help = """(string) 当前的协议类型 """ , dest = 'protocol' , required = False )),
864- (['--data' ], dict (help = """(object) 当前待写入的数据 """ , dest = 'data' , required = False )),
864+ (['--identifier' ], dict (help = """(string) 连接码 """ , dest = 'identifier' , required = True )),
865+ (['--address-of-first-register' ], dict (help = """(int) 起始地址,如40301 """ , dest = 'addressOfFirstRegister' , type = int , required = True )),
866+ (['--number-of-registers' ], dict (help = """(int) 寄存器数量 """ , dest = 'numberOfRegisters' , type = int , required = True )),
867+ (['--input-json' ], dict (help = '(json) 以json字符串或文件绝对路径形式作为输入参数。\n 字符串方式举例:--input-json \' {"field":"value"}\' ;\n 文件格式举例:--input-json file:///xxxx.json' , dest = 'input_json' , required = False )),
868+ (['--headers' ], dict (help = """(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""" , dest = 'headers' , required = False )),
869+ ],
870+ formatter_class = RawTextHelpFormatter ,
871+ help = ''' (0x03)读保持寄存器 ''' ,
872+ description = '''
873+ (0x03)读保持寄存器。
874+
875+ 示例: jdc iotcore read-holding-registers --instance-id xxx --identifier xxx --address-of-first-register 0 --number-of-registers 0
876+ ''' ,
877+ )
878+ def read_holding_registers (self ):
879+ client_factory = ClientFactory ('iotcore' )
880+ client = client_factory .get (self .app )
881+ if client is None :
882+ return
883+
884+ try :
885+ from jdcloud_sdk .services .iotcore .apis .ReadHoldingRegistersRequest import ReadHoldingRegistersRequest
886+ params_dict = collect_user_args (self .app )
887+ headers = collect_user_headers (self .app )
888+ req = ReadHoldingRegistersRequest (params_dict , headers )
889+ resp = client .send (req )
890+ Printer .print_result (resp )
891+ except ImportError :
892+ print ('{"error":"This api is not supported, please use the newer version"}' )
893+ except Exception as e :
894+ print (e )
895+
896+ @expose (
897+ arguments = [
898+ (['--instance-id' ], dict (help = """(string) Hub实例Id """ , dest = 'instanceId' , required = True )),
899+ (['--region-id' ], dict (help = """(string) 区域Id """ , dest = 'regionId' , required = False )),
900+ (['--identifier' ], dict (help = """(string) 当前的链接码 """ , dest = 'identifier' , required = True )),
901+ (['--protocol' ], dict (help = """(string) 当前的协议类型,非必填项; """ , dest = 'protocol' , required = False )),
902+ (['--data' ], dict (help = """(object) 当前待写入的数据; 如指定播放设备,寄存地址:13对应16进制0x0D,寄存器值:2; {; "13":2; }; 如播放控制,寄存地址:14对应16进制0x0E,寄存器值:1; {; "14": 1; }; 如音量设置,寄存地址:15对应16进制0x0F,寄存器值:10,取值范围0~30; {; "15": 10; }; 如指定文件夹和文件播放,寄存地址:16对应16进制0x10,寄存器值:1; 寄存器值为两字节,第一个字节为文件夹,第二个字节为文件名; 如0x01文件夹,0x03文件名,0x0103换算为10进制为259; {; "16": 259; }; 如组合播放,寄存器地址:17、18和19,寄存器值:257、258和259,寄存器值的算法和指定文件夹和文件播放是一致的,如259可换算为0x01文件夹,0x03文件名; {; "17": 257,; "18": 258,; "19": 259; }; 如播放广告,寄存地址:32对应16进制0x20,寄存器值:259,寄存器值的算法和指定文件夹和文件播放是一致的,如259可换算为0x01文件夹,0x03文件名; {; "32": 259; }; 如指定文件夹循环播放,寄存地址:33对应16进制0x21,寄存器值:256,寄存器值的算法,如256可换算为0x0100文件夹; {; "33": 256; }; 如指定文件夹随机播放,寄存地址:34对应16进制0x22,寄存器值:256,寄存器值的算法,如256可换算为0x0100文件夹; {; "34": 256; }; 如指定曲目播放,寄存地址:35对应16进制0x23,寄存器值:13,歌曲选择范围为0~3000; {; "35": 13; }; """ , dest = 'data' , required = True )),
865903 (['--input-json' ], dict (help = '(json) 以json字符串或文件绝对路径形式作为输入参数。\n 字符串方式举例:--input-json \' {"field":"value"}\' ;\n 文件格式举例:--input-json file:///xxxx.json' , dest = 'input_json' , required = False )),
866904 (['--headers' ], dict (help = """(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""" , dest = 'headers' , required = False )),
867905 ],
@@ -870,7 +908,7 @@ def collector_read_message(self):
870908 description = '''
871909 写入采集器数据。
872910
873- 示例: jdc iotcore collector-write-message --instance-id xxx
911+ 示例: jdc iotcore collector-write-message --instance-id xxx --identifier xxx --data '{"":""}'
874912 ''' ,
875913 )
876914 def collector_write_message (self ):
@@ -987,6 +1025,8 @@ def add_loo_device(self):
9871025 (['--order' ], dict (help = """(string) 排序关键字--name,type,productKey,status--最多支持一个字段 """ , dest = 'order' , required = False )),
9881026 (['--direction' ], dict (help = """(string) 顺序,升序降序--asc,desc """ , dest = 'direction' , required = False )),
9891027 (['--parent-id' ], dict (help = """(string) 父设备Id """ , dest = 'parentId' , required = False )),
1028+ (['--order-id' ], dict (help = """(int) 订单号 """ , dest = 'orderId' , type = int , required = False )),
1029+ (['--device-collector-type' ], dict (help = """(string) 设备采集器类型 """ , dest = 'deviceCollectorType' , required = False )),
9901030 (['--input-json' ], dict (help = '(json) 以json字符串或文件绝对路径形式作为输入参数。\n 字符串方式举例:--input-json \' {"field":"value"}\' ;\n 文件格式举例:--input-json file:///xxxx.json' , dest = 'input_json' , required = False )),
9911031 (['--headers' ], dict (help = """(json) 用户自定义Header,举例:'{"x-jdcloud-security-token":"abc","test":"123"}'""" , dest = 'headers' , required = False )),
9921032 ],
@@ -1626,7 +1666,7 @@ def describe_product_topic(self):
16261666
16271667 @expose (
16281668 arguments = [
1629- (['--api' ], dict (help = """(string) api name """ , choices = ['device-query' ,'thing-type-list' ,'thing-type-describe' ,'discribe-thing-model' ,'device-register' ,'download-certificate' ,'delete-device' ,'device-property-set' ,'invoke-function' ,'event-list' ,'function-list' ,'invoke-thing-topic' ,'describe-thing-shadow' ,'update-thing-shadow' ,'invoke-thing-service' ,'add-device-links' ,'query-device-page' ,'update-device' ,'add-device' ,'query-device-detail' ,'remove-device' ,'elevator-operating-status' ,'collector-read-message' ,'collector-write-message' ,'update-loo-device' ,'add-loo-device' ,'loongray-query-page' ,'remove-loongray-device' ,'describe-product-with-admin' ,'update-product-with-admin' ,'delete-product-with-admin' ,'list-products-with-admin' ,'create-admin-product' ,'list-products' ,'create-product' ,'describe-product' ,'update-product' ,'delete-product' ,'list-product-abilities' ,'import-thing-model' ,'export-thing-model' ,'describe-product-topics' ,'create-product-topic' ,'describe-product-topic' ,], required = True )),
1669+ (['--api' ], dict (help = """(string) api name """ , choices = ['device-query' ,'thing-type-list' ,'thing-type-describe' ,'describe-thing-model' ,'device-register' ,'download-certificate' ,'delete-device' ,'device-property-set' ,'invoke-function' ,'event-list' ,'function-list' ,'invoke-thing-topic' ,'describe-thing-shadow' ,'update-thing-shadow' ,'invoke-thing-service' ,'add-device-links' ,'query-device-page' ,'update-device' ,'add-device' ,'query-device-detail' ,'remove-device' ,'elevator-operating-status' ,'collector-read-message' ,'read-holding-registers' ,'collector-write-message' ,'update-loo-device' ,'add-loo-device' ,'loongray-query-page' ,'remove-loongray-device' ,'describe-product-with-admin' ,'update-product-with-admin' ,'delete-product-with-admin' ,'list-products-with-admin' ,'create-admin-product' ,'list-products' ,'create-product' ,'describe-product' ,'update-product' ,'delete-product' ,'list-product-abilities' ,'import-thing-model' ,'export-thing-model' ,'describe-product-topics' ,'create-product-topic' ,'describe-product-topic' ,], required = True )),
16301670 ],
16311671 formatter_class = RawTextHelpFormatter ,
16321672 help = ''' 生成单个API接口的json骨架空字符串 ''' ,
0 commit comments