函数工作流 FUNCTIONGRAPH-核心概念:服务

时间:2023-11-02 11:37:54

服务

服务是Framework的组织单位。您可以将其视为项目文件,单个应用可以拥有多个服务。可以在服务中定义函数、触发它们的事件以及函数使用的资源,所有这些都在一个名为serverless.yml(或serverless.json)的文件中,例如:

# serverless.yml

service: fgs

functions: # Your "Functions"
  hello_world:
    events: # The "Events" that trigger this function
      - apigw:
          env_id: DEFAULT_ENVIRONMENT_RELEASE_ID
          env_name: RELEASE
          req_method: GET
          path: /test
          name: API_test

通过运行serverless deploy使用Framework进行部署时,serverless.yml中的所有内容都会同时部署。

support.huaweicloud.com/devg-functiongraph/functiongraph_02_0736.html