BAETYL 1.0.0 Documentationsupport reading contexts such as context[‘functionName’]. An example is shown below: #!/usr/bin/env python3 #-*- coding:utf-8 -*- """ module to say hi """ def handler(event, context): """ function The operating system used in this test is Ubuntu 18.04 The function runtime used in this test is Python3 The MQTTBox is used as MQTT client in this test NOTE: You can install Baetyl from source. Please directly, and for an none dictionary format message, convert it to string and return. #!/usr/bin/env python3 # -*- coding: utf-8 -*- def handler(event, context): result = {} if isinstance(event, dict):0 码力 | 135 页 | 15.44 MB | 1 年前3
BAETYL 1.0.0 Documentationsupport reading contexts such as context[‘functionName’]. An example is shown below: #!/usr/bin/env python3 #-*- coding:utf-8 -*- """ module to say hi """ def handler(event, context): """ function handler operating system used in this test is Ubuntu 18.04 • The function runtime used in this test is Python3 • The MQTTBox is used as MQTT client in this test NOTE: You can install Baetyl from source. Please directly, and for an none dictionary format message, convert it to string and return. #!/usr/bin/env python3 # -*- coding: utf-8 -*- def handler(event, context): result = {} if isinstance(event, dict): result['msg']0 码力 | 145 页 | 9.31 MB | 1 年前3
BAETYL 0.1.6 Documentationsupport reading contexts such as context[‘functionName’]. An example is shown below: #!/usr/bin/env python3 #-*- coding:utf-8 -*- """ module to say hi """ def handler(event, context): """ function handler directly, and for an none dictionary format message, convert it to string and return. #!/usr/bin/env python3 # -*- coding: utf-8 -*- def handler(event, context): result = {} if isinstance(event, dict): result['msg'] the “A” command from the localhub service. More detailed contents are as follows: #!/usr/bin/env python3 # -*- coding: utf-8 -*- import requests def handler(event, context): """ data: {"action": "A"}0 码力 | 120 页 | 7.27 MB | 1 年前3
BAETYL 0.1.6 Documentationsupport reading contexts such as context[‘functionName’]. An example is shown below: #!/usr/bin/env python3 #-*- coding:utf-8 -*- """ module to say hi """ def handler(event, context): """ function directly, and for an none dictionary format message, convert it to string and return. #!/usr/bin/env python3 # -*- coding: utf-8 -*- def handler(event, context): result = {} if isinstance(event, dict): the “A” command from the localhub service. More detailed contents are as follows: #!/usr/bin/env python3 # -*- coding: utf-8 -*- import requests def handler(event, context): """ data: {"action":0 码力 | 119 页 | 11.46 MB | 1 年前3
共 4 条
- 1













