函数工作流 FUNCTIONGRAPH-修改函数的metadata信息:请求示例

时间:2025-05-28 09:46:56

请求示例

  • 修改名为fgsTest的Nodejs函数配置信息,将内存大小改为768MB,超时时间设为40s,添加环境变量host,添加磁盘挂载。
    PUT https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/config
    
    {
      "func_name" : "fgsTest",
      "handler" : "index.handler",
      "memory_size" : 768,
      "user_data" : "{\"host\":\"192.168.0.1\"}",
      "runtime" : "Node.js6.10",
      "mount_config" : {
        "mount_user" : {
          "user_id" : -1,
          "user_group_id" : -1
        },
        "func_mounts" : [ {
          "mount_resource" : "268xxx-d3xx-4cxx-98xx-d1dbxxx",
          "local_mount_path" : "/mnt",
          "mount_type" : "sfsTurbo"
        } ]
      },
      "timeout" : 40
    }
  • 修改自定义运行时函数GPU配置,将GPU显存设置为1GB,内存大小设置为4GB。
    PUT https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/config
    
    {
      "func_name" : "test_GPU",
      "handler" : "bootstrap",
      "memory_size" : 4096,
      "runtime" : "Custom",
      "timeout" : 40,
      "gpu_memory" : 1024
    }
support.huaweicloud.com/api-functiongraph/functiongraph_06_0111.html