huawei-cloud-api-definitions-FunctionGraph 0.1.20250124

Huawei Cloud API definitions, generated from OpenAPI spec
Documentation
1
{"base_path":null,"components":null,"consumes":"[\"application/json\"]","definitions":{"CreateFunctionVersionRequestBody":{"properties":{"description":{"description":"发布版本描述","type":"string"},"digest":{"description":"md5键值","type":"string"},"version":{"description":"发布版本名称","type":"string"}}},"CreateFunctionVersionResponseBody":{"properties":{"app_xrole":{"description":"函数执行委托。可为函数执行单独配置执行委托,这将减小不必要的性能损耗;不单独配置执行委托时,函数执行和函数配置将使用同一委托。","type":"string"},"code_filename":{"description":"函数的文件名,当CodeType为jar/zip时必须提供该字段,inline和obs不需要提供。","type":"string"},"code_size":{"description":"函数大小,单位:字节。","format":"int64","type":"integer"},"code_type":{"description":"函数代码类型,取值有5种。\ninline: UI在线编辑代码。\nzip: 函数代码为zip包。\nobs: 函数代码来源于obs存储。\njar: 函数代码为jar包,主要针对Java函数。\nCustom-Image-Swr: 函数代码来源与SWR自定义镜像。","enum":["inline","zip","obs","jar","Custom-Image-Swr"],"type":"string"},"code_url":{"description":"当CodeType为obs时,该值为函数代码包在OBS上的地址,CodeType为其他值时,该字段为空。","type":"string"},"cpu":{"description":"函数占用的cpu资源。\n单位为millicore(1 core=1000 millicores)。\n取值与MemorySize成比例,默认是128M内存占0.1个核(100 millicores)。","format":"int32","type":"integer"},"dependencies":{"description":"函数依赖代码包列表。","items":{"$ref":"#/definitions/Dependency"},"type":"array"},"description":{"description":"函数描述。","type":"string"},"digest":{"description":"函数代码SHA512 hash值,用于判断函数是否变化。","type":"string"},"domain_id":{"description":"域名id。","type":"string"},"enable_dynamic_memory":{"description":"是否允许动态内存配置","type":"boolean"},"encrypted_user_data":{"description":"用户自定义的name/value信息,用于需要加密的配置。","type":"string"},"enterprise_project_id":{"description":"企业项目ID,在企业用户创建函数时必填。","type":"string"},"func_name":{"description":"函数名称。","type":"string"},"func_urn":{"description":"函数的URN(Uniform Resource Name),唯一标识函数。","type":"string"},"func_vpc":{"$ref":"#/definitions/FuncVpc"},"function_async_config":{"$ref":"#/definitions/FunctionAsyncConfig"},"handler":{"description":"函数执行入口\n规则:xx.xx,必须包含“. ”\n举例:对于node.js函数:myfunction.handler,则表示函数的文件名为myfunction.js,执行的入口函数名为handler。","type":"string"},"image_name":{"description":"函数版本的内部标识。","type":"string"},"initializer_handler":{"description":"函数初始化入口,规则:xx.xx,必须包含“. ”。当配置初始化函数时,此参数必填。\n举例:对于node.js函数:myfunction.initializer,则表示函数的文件名为myfunction.js,初始化的入口函数名为initializer。","type":"string"},"initializer_timeout":{"description":"初始化超时时间,超时函数将被强行停止,范围1~300秒。当配置初始化函数时,此参数必填。","format":"int32","type":"integer"},"last_modified":{"description":"函数最后一次更新时间。","format":"date-time","type":"string"},"log_group_id":{"description":"自定义日志查询组id","type":"string"},"log_stream_id":{"description":"自定义日志查询流id","type":"string"},"long_time":{"description":"是否允许进行长时间超时设置。","type":"boolean"},"memory_size":{"description":"函数消耗的内存。\n单位M。\n取值范围为:128、256、512、768、1024、1280、1536、1792、2048、2560、3072、3584、4096。\n最小值为128,最大值为4096。","format":"int32","type":"integer"},"mount_config":{"$ref":"#/definitions/MountConfig"},"namespace":{"description":"租户的project id。","type":"string"},"package":{"description":"函数所属的分组Package,用于用户针对函数的自定义分组。","type":"string"},"pre_stop_handler":{"description":"函数预停止函数的入口,规则:xx.xx,必须包含“. ”。\n举例:对于node.js函数:myfunction.pre_stop_handler,则表示函数的文件名为myfunction.js,初始化的入口函数名为pre_stop_handler。","type":"string"},"pre_stop_timeout":{"description":"初始化超时时间,超时函数将被强行停止,范围1~90秒。","format":"int32","type":"integer"},"project_name":{"description":"租户的project name。","type":"string"},"runtime":{"description":"FunctionGraph函数的执行环境\nJava8: Java语言8版本。\nJava11: Java语言11版本。\nJava17: Java语言17版本(当前仅支持华北-乌兰察布二零二)\nPython2.7: Python语言2.7版本。\nPython3.6: Pyton语言3.6版本。\nPython3.9: Python语言3.9版本。\nPython3.10: Python语言3.10版本。\nGo1.8: Go语言1.8版本。\nGo1.x: Go语言1.x版本。\nNode.js6.10: Nodejs语言6.10版本。\nNode.js8.10: Nodejs语言8.10版本。\nNode.js10.16: Nodejs语言10.16版本。\nNode.js12.13: Nodejs语言12.13版本。\nNode.js14.18: Nodejs语言14.18版本。\nNode.js16.17: Nodejs语言16.17版本。\nNode.js18.15: Nodejs语言18.15版本。\nC#(.NET Core 2.0): C#语言2.0版本。\nC#(.NET Core 2.1): C#语言2.1版本。\nC#(.NET Core 3.1): C#语言3.1版本。\nC#(.NET Core 6.0): C#语言6.0版本(当前仅支持华北-乌兰察布二零二)。\nCustom: 自定义运行时。\nPHP7.3: Php语言7.3版本。\nCangjie1.0:仓颉语言1.0版本。\nhttp: HTTP函数。\nCustom Image: 自定义镜像函数。","enum":["Java8","Java11","Java17","Python2.7","Python3.6","Python3.9","Python3.10","Go1.8","Go1.x","Node.js6.10","Node.js8.10","Node.js10.16","Node.js12.13","Node.js14.18","Node.js16.17","Node.js18.15","C#(.NET Core 2.0)","C#(.NET Core 2.1)","C#(.NET Core 3.1)","C#(.NET Core 6.0)","Custom","PHP7.3","Cangjie1.0","http","Custom Image"],"type":"string"},"strategy_config":{"$ref":"#/definitions/StrategyConfig"},"timeout":{"description":"函数执行超时时间,超时函数将被强行停止,范围3~259200秒。","format":"int32","type":"integer"},"type":{"description":"v2表示为正式版本,v1为废弃版本。","enum":["v1","v2"],"type":"string"},"user_data":{"description":"用户自定义的name/value信息。 在函数中使用的参数。 举例:如函数要访问某个主机,可以设置自定义参数:Host={host_ip},最多定义20个,总长度不超过4KB。","example":"{\"host\":\"192.168.0.1\"}","type":"string"},"version":{"description":"函数版本号,由系统自动生成,规则:vYYYYMMDD-HHMMSS(v+年月日-时分秒)。","type":"string"},"version_description":{"description":"函数版本描述。","type":"string"},"xrole":{"description":"函数配置委托。需要IAM支持,并在IAM界面创建委托,当函数需要访问其他服务时,必须提供该字段。配置后用户可以通过函数执行入口方法中的context参数获取具有委托中权限的token、ak、sk,用于访问其他云服务。如果用户函数不访问任何云服务,则不用提供委托名称。","type":"string"}},"required":["code_size","code_type","cpu","digest","domain_id","func_name","func_urn","handler","image_name","last_modified","memory_size","namespace","package","project_name","runtime","timeout","version"]},"Dependency":{"description":"函数依赖包结构。","properties":{"dep_id":{"description":"依赖包ID","example":"3cf4xxxx-xxxx-xxxx-xxxx-823f0dxxxxxx","type":"string"},"description":{"description":"依赖包描述。","type":"string"},"etag":{"description":"依赖包的md5值","type":"string"},"file_name":{"description":"依赖包文件名,如果创建方式为zip时。","type":"string"},"id":{"description":"依赖包版本ID。","example":"6578de50-9a18-48fa-b84e-b2d36636e433","type":"string"},"last_modified":{"description":"依赖包最后一次更新时间。","format":"int64","type":"integer"},"link":{"description":"依赖包在OBS上的链接。","type":"string"},"name":{"description":"依赖包名称。","type":"string"},"owner":{"description":"依赖包属主的domainId。","type":"string"},"runtime":{"description":"FunctionGraph函数的执行环境\nJava8: Java语言8版本。\nJava11: Java语言11版本。\nJava17: Java语言17版本(当前仅支持华北-乌兰察布二零二)\nPython2.7: Python语言2.7版本。\nPython3.6: Pyton语言3.6版本。\nPython3.9: Python语言3.9版本。\nPython3.10: Python语言3.10版本。\nGo1.8: Go语言1.8版本。\nGo1.x: Go语言1.x版本。\nNode.js6.10: Nodejs语言6.10版本。\nNode.js8.10: Nodejs语言8.10版本。\nNode.js10.16: Nodejs语言10.16版本。\nNode.js12.13: Nodejs语言12.13版本。\nNode.js14.18: Nodejs语言14.18版本。\nNode.js16.17: Nodejs语言16.17版本。\nNode.js18.15: Nodejs语言18.15版本。\nC#(.NET Core 2.0): C#语言2.0版本。\nC#(.NET Core 2.1): C#语言2.1版本。\nC#(.NET Core 3.1): C#语言3.1版本。\nC#(.NET Core 6.0): C#语言6.0版本(当前仅支持华北-乌兰察布二零二)。\nCustom: 自定义运行时。\nPHP7.3: Php语言7.3版本。\nCangjie1.0:仓颉语言1.0版本。\nhttp: HTTP函数。\nCustom Image: 自定义镜像函数。","enum":["Java8","Java11","Java17","Python2.7","Python3.6","Python3.9","Python3.10","Go1.8","Go1.x","Node.js6.10","Node.js8.10","Node.js10.16","Node.js12.13","Node.js14.18","Node.js16.17","Node.js18.15","C#(.NET Core 2.0)","C#(.NET Core 2.1)","C#(.NET Core 3.1)","C#(.NET Core 6.0)","Custom","PHP7.3","Cangjie1.0","http","Custom Image"],"type":"string"},"size":{"description":"依赖包大小。","format":"int64","type":"integer"},"version":{"description":"依赖包版本编号。","format":"int64","type":"integer"}},"required":["description","etag","link","name","owner","runtime","size"]},"ErrorResp":{"properties":{"error_code":{"description":"错误码","type":"string"},"error_msg":{"description":"错误信息","type":"string"}}},"FuncAsyncDestinationConfig":{"description":"函数异步调用目标参数配置。","properties":{"on_failure":{"$ref":"#/definitions/FuncDestinationConfig","description":"当函数执行失败(系统错误或函数内部错误)时,函数计算将调用该配置对应的目标。"},"on_success":{"$ref":"#/definitions/FuncDestinationConfig","description":"当函数执行成功时,函数计算将调用该配置对应的目标。"}}},"FuncDestinationConfig":{"description":"函数通知目标参数配置。","properties":{"destination":{"description":"目标类型。\n\n- OBS:通知到OBS服务。\n- SMN:通知到SMN服务。\n- DIS:通知到DIS服务。\n- FunctionGraph: 通知到函数服务。","enum":["OBS","SMN","DIS","FunctionGraph"],"example":"OBS","type":"string"},"param":{"description":"通知目标服务对应参数,json字符串。\n\n- OBS:包含bucket桶,对象目录前缀prefix,对象默认expires过期时间[0~365]天,0默认不过期。\n- SMN:包含smn 主题topic_urn。\n- DIS:包含DIS 通道名stream_name。\n- FunctionGraph:包含func_urn,函数urn","example":"{\"bucket\":\"fgs-invoke\",\"prefix\":\"/function1/\",\"expires\":1}","type":"string"}}},"FuncMount":{"description":"函数挂载结构体。","properties":{"local_mount_path":{"description":"函数访问路径,func_mounts非空时必选。","type":"string"},"mount_resource":{"description":"挂载资源ID(对应云服务ID),func_mounts非空时必选。","type":"string"},"mount_share_path":{"description":"远端挂载路径(例如192.168.0.12:/data),如果mount_type为ecs,必选。","type":"string"},"mount_type":{"description":"挂载类型(sfs/sfsTurbo/ecs),func_mounts非空时必选。","type":"string"}},"required":["local_mount_path","mount_resource","mount_type"]},"FuncVpc":{"description":"函数vpc配置。需同时为函数配置具有vpc权限的委托。","properties":{"cidr":{"description":"子网掩码。","type":"string"},"domain_id":{"description":"域名id。","type":"string"},"gateway":{"description":"网关。","type":"string"},"namespace":{"description":"租户的project id。","type":"string"},"security_groups":{"description":"安全组","items":{"type":"string"},"type":"array"},"subnet_id":{"description":"子网编号。","type":"string"},"subnet_name":{"description":"子网名称。","type":"string"},"vpc_id":{"description":"虚拟私有云唯一标识。","type":"string"},"vpc_name":{"description":"虚拟私有云名称。","type":"string"}},"required":["subnet_id","vpc_id"]},"FunctionAsyncConfig":{"description":"函数异步配置返回结构体。","properties":{"created_time":{"description":"异步调用配置的创建时间。","example":"2021-03-04T14:50:02+08:00","type":"string"},"destination_config":{"$ref":"#/definitions/FuncAsyncDestinationConfig","description":"异步调用目标。"},"last_modified":{"description":"异步调用配置的最后更改时间。","example":"2021-03-04T14:50:02+08:00","type":"string"},"max_async_event_age_in_seconds":{"description":"消息最大存活时长,取值范围[60,86400]。单位:秒。","example":60,"type":"integer"},"max_async_retry_attempts":{"description":"异步调用失败后的最大重试次数,默认值为3。取值范围[0,8]。","example":3,"type":"integer"}},"required":["destination_config","max_async_event_age_in_seconds","max_async_retry_attempts"]},"MountConfig":{"description":"函数挂载配置。","properties":{"func_mounts":{"description":"函数挂载列表。","items":{"$ref":"#/definitions/FuncMount"},"type":"array"},"mount_user":{"$ref":"#/definitions/MountUser"}},"required":["func_mounts","mount_user"]},"MountUser":{"description":"挂载用户信息。","properties":{"user_group_id":{"description":"用户组ID(-1~65534的非0整数)","type":"string"},"user_id":{"description":"用户ID(-1~65534的非0整数)","type":"string"}},"required":["user_group_id","user_id"]},"StrategyConfig":{"description":"函数策略配置。","properties":{"concurrency":{"description":"单函数最大实例数,v1取值0和-1,v2取值-1到1000\n-1代表该函数实例数无限制\n0代表该函数被禁用","format":"int32","type":"integer"},"concurrent_num":{"description":"单实例并发数,v2版本才支持,取值1到1000","format":"int32","type":"integer"}},"required":["concurrency","concurrent_num"]}},"description":null,"group_id":"cb46b925a4eb40a192520da4fc33b990","host":"functiongraph.cn-north-4.myhuaweicloud.com","id":"4f9191d337e444f598faf0155133f9b2","info_version":"v2","method":"post","name":"CreateFunctionVersion","parameters":{"Content-Type":{"default":"application/json","description":"消息体的类型(格式)","in":"header","name":"Content-Type","required":true,"type":"string","x-example":"application/json"},"X-Auth-Token":{"description":"用户Token。\n\n通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。","in":"header","name":"X-Auth-Token","required":true,"type":"string","x-example":"MIIDkgYJKoZIhvcNAQcCoIIDgzCCXXXXX..."},"function_urn":{"description":"函数的URN,详细解释见FunctionGraph函数模型的描述。","in":"path","name":"function_urn","required":true,"type":"string","x-example":"urn:fss:{region}:46b6f338fc3445b8846c71dfb1fbxxxx:function:csharp:test2-0:latest"},"project_id":{"description":"租户项目 ID,获取方式请参见[获取项目ID](functiongraph_06_0260.xml)。","in":"path","name":"project_id","required":true,"type":"string","x-example":"46b6f338fc3445b8846c71dfb1fbd9e8"}},"paths":{"/v2/{project_id}/fgs/functions/{function_urn}/versions":{"post":{"description":"发布函数版本。","operationId":"CreateFunctionVersion","parameters":[{"$ref":"#/parameters/project_id"},{"$ref":"#/parameters/function_urn"},{"$ref":"#/parameters/X-Auth-Token"},{"$ref":"#/parameters/Content-Type"},{"description":"发布函数版本请求体","in":"body","name":"CreateFunctionVersionRequestBody","required":true,"schema":{"$ref":"#/definitions/CreateFunctionVersionRequestBody"}}],"responses":{"200":{"description":"OK","examples":{"application/json":{"code_filename":"inline.js","code_size":272,"code_type":"inline","cpu":300,"digest":"faa825575c45437cddd4e369bea69893bcbe195d478178462ad90984fe72993f3f59d15f41c5373f807f3e05fb9af322c55dabeb16565c386e402413458e6068","domain_id":"14ee2e3501124efcbca7998baa24xxxx","func_code":{},"func_name":"test","func_urn":"urn:fss:xxxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test","handler":"test.handler","image_name":"latest-191025153727@zehht","last_modified":"2019-10-25T15:37:27+08:00","last_modified_utc":1571989047,"memory_size":128,"namespace":"46b6f338fc3445b8846c71dfb1fbxxxx","package":"default","project_name":"xxxxx","runtime":"Node.js6.10","strategy_config":{"concurrency":0},"timeout":3,"version":"latest"}},"schema":{"$ref":"#/definitions/CreateFunctionVersionResponseBody"}},"400":{"description":"Bad Request 请求错误。","schema":{"$ref":"#/definitions/ErrorResp"}},"401":{"description":"Unauthorized 鉴权失败。","schema":{"$ref":"#/definitions/ErrorResp"}},"403":{"description":"Forbidden 没有操作权限。","schema":{"$ref":"#/definitions/ErrorResp"}},"404":{"description":"Not Found 找不到资源。","examples":{"application/json":{"error_code":"FSS.1051","error_msg":"Not found the function"}},"schema":{"$ref":"#/definitions/ErrorResp"}},"500":{"description":"Internal Server Error 服务内部错误。","schema":{"$ref":"#/definitions/ErrorResp"}}},"summary":"发布函数版本","tags":["函数版本别名"],"x-produc-type":"functiongraph","x-request-examples-description-1":"发布函数版本。","x-request-examples-url-1":"POST https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/versions","x-support-sdk":"Y"}}},"product_short":"FunctionGraph","region_id":"cn-north-4","schemes":["HTTPS"],"security_definitions":null,"summary":"发布函数版本","tags":"函数版本别名","uri":null,"version":"2.0"}