Step 2: Host Function Code
- On the DevCloud console, choose Code > CodeHub, and click Create Directly.
Create a code repository named functions, and retain the default settings for other parameters.
- Go to the functions repository created in 1. Create the deploy directory for storing the function deployment script deploy.py.
Figure 1 Creating a directory
The deploy.py script will read the function configuration file cam.yaml and construct an hcloud command to update the function code and configuration. For details about the configurations in cam.yaml, see Analyzing cam.yaml. Logs generated when executing this script will be recorded in the /home/function/deploy/function.log file.
- Create another directory named helloworld, with a complete structure.
Figure 2 Complete function directory structure
- helloworld: the helloworld function
- cam.yaml: the configuration file
- code: function code directory, which stores the index.py file
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot