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":{"CreateFunctionRequestBody":{"description":"函数属性结构体。","properties":{"app_xrole":{"description":"函数执行委托。可为函数执行单独配置执行委托,这将减小不必要的性能损耗;不单独配置执行委托时,函数执行和函数配置将使用同一委托。","type":"string"},"code_filename":{"description":"函数的文件名,当CodeType为jar/zip时必须提供该字段,CodeType为其他值时不需要提供。","type":"string"},"code_type":{"description":"函数代码类型,取值有5种。\ninline: UI在线编辑代码。\nzip: 函数代码为zip包。\nobs: 函数代码来源于obs存储。\njar: 函数代码为jar包,主要针对Java函数。\nCustom-Image-Swr: 函数代码来源与SWR自定义镜像。\n创建自定义镜像函数此参数非必填,其他类型函数此参数必填。","enum":["inline","zip","obs","jar","Custom-Image-Swr"],"type":"string"},"code_url":{"description":"当CodeType为obs时,该值为函数代码包在OBS上的地址,CodeType为其他值时,该字段为空。","type":"string"},"custom_image":{"$ref":"#/definitions/CustomImage","description":"用户容器镜像,当CodeType为Custom-Image-Swr时必须提供该字段,CodeType为其他值时不需要提供。"},"depend_version_list":{"description":"依赖版本id列表","items":{"type":"string"},"type":"array"},"description":{"description":"函数描述。","type":"string"},"enable_dynamic_memory":{"description":"是否启动动态内存配置","type":"boolean"},"encrypted_user_data":{"description":"用户自定义的name/value信息,用于需要加密的配置。举例:如配置加密密码,可以设置自定义参数:password={1234},最多定义20个,总长度不超过4KB。","type":"string"},"enterprise_project_id":{"description":"企业项目ID,在企业用户创建函数时必填。","type":"string"},"func_code":{"$ref":"#/definitions/FuncCode"},"func_name":{"description":"函数名称。","type":"string"},"func_vpc":{"$ref":"#/definitions/FuncVpc"},"gpu_memory":{"description":"函数消耗的显存,只支持自定义运行时与自定义镜像函数配置GPU。\n单位MB。\n取值范围为:1024、2048、3072、4096、5120、6144、7168、8192、9216、10240、11264、12288、13312、14336、15360、16384。\n最小值为1024,最大值为16384。","format":"int32","type":"integer","x-open-region-cloud":"hws,hws_hk"},"gpu_type":{"description":"显卡类型。","example":"nvidia-a30","type":"string","x-open-region-cloud":"hws,hws_hk"},"handler":{"description":"函数执行入口\n规则:xx.xx,必须包含“. ”;自定义镜像函数handler为“-”\n举例:对于node.js函数:myfunction.handler,则表示函数的文件名为myfunction.js,执行的入口函数名为handler。","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"},"is_stateful_function":{"description":"是否支持有状态,如果需要支持,需要固定传参为true,v2版本支持","type":"boolean"},"log_config":{"$ref":"#/definitions/FuncLogConfig"},"lts_custom_tag":{"additionalProperties":{"type":"string"},"description":"自定义日志标签。函数执行时,可以按照自定义标签配置上报标签到云日志服务(LTS),用户可以通过标签对日志进行过滤筛选。","type":"object"},"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"},"network_controller":{"$ref":"#/definitions/NetworkControlConfig"},"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"},"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"},"timeout":{"description":"函数执行超时时间,超时函数将被强行停止,范围3~259200秒。","format":"int32","type":"integer"},"type":{"default":"v2","description":"函数版本;部分局点只支持v1函数,缺省值则为v1","enum":["v1","v2"],"type":"string"},"user_data":{"description":"用户自定义的name/value信息。 在函数中使用的参数。 举例:如函数要访问某个主机,可以设置自定义参数:Host={host_ip},最多定义20个,总长度不超过4KB。","example":"{\"host\":\"192.168.0.1\"}","type":"string"},"xrole":{"description":"函数配置委托。需要IAM支持,并在IAM界面创建委托,当函数需要访问其他服务时,必须提供该字段。配置后用户可以通过函数执行入口方法中的context参数获取具有委托中权限的token、ak、sk,用于访问其他云服务。如果用户函数不访问任何云服务,则不用提供委托名称。","type":"string"}},"required":["func_name","handler","memory_size","package","runtime","timeout"]},"CreateFunctionResponseBody":{"properties":{"allow_ephemeral_storage":{"description":"是否支持配置临时存储。","type":"boolean"},"apig_route_enable":{"description":"是否配置下沉apig路由规则。","example":true,"type":"boolean"},"app_xrole":{"description":"函数app使用的权限委托名称,需要IAM支持,并在IAM界面创建委托,当函数需要访问其他服务时,必须提供该字段。","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"},"custom_image":{"$ref":"#/definitions/CustomImage"},"depend_list":{"description":"依赖id列表","items":{"type":"string"},"type":"array"},"depend_version_list":{"description":"依赖版本id列表","items":{"type":"string"},"type":"array"},"dependencies":{"description":"函数依赖代码包列表。","items":{"$ref":"#/definitions/Dependency"},"type":"array"},"description":{"description":"函数描述。","type":"string"},"digest":{"description":"函数代码SHA512 hash值,用于判断函数是否变化。","type":"string"},"domain_id":{"description":"域名id。","type":"string"},"domain_names":{"description":"函数配置的需要支持域名解析的内网域名。","type":"string"},"enable_auth_in_header":{"description":"是否允许在请求头中添加鉴权信息,只支持自定义镜像函数(创建函数时不支持修改)","type":"boolean"},"enable_class_isolation":{"description":"类隔离开关,只支持JAVA运行时配置。开启类隔离后可以支持Kafka转储并提升类加载效率,但也可能会导致某些兼容性问题,请谨慎开启。","example":true,"type":"boolean"},"enable_cloud_debug":{"description":"适配CloudDebug场景,是否开启云调试(已废弃)","type":"string"},"enable_dynamic_memory":{"description":"是否启动动态内存配置","type":"boolean"},"encrypted_user_data":{"description":"用户自定义的name/value信息,用于需要加密的配置。","type":"string"},"enterprise_project_id":{"description":"企业项目ID,在企业用户创建函数时必填。","type":"string"},"ephemeral_storage":{"description":"临时存储大小。默认情况下会为函数的/tmp目录分配512MB的空间。您可以通过临时存储设置将函数的/tmp目录大小调整为10G。","enum":[512,10240],"type":"integer"},"extend_config":{"description":"函数扩展配置。","type":"string"},"func_id":{"description":"函数id,唯一标识函数。","type":"string"},"func_name":{"description":"函数名称。","type":"string"},"func_urn":{"description":"函数的URN(Uniform Resource Name),唯一标识函数。","type":"string"},"func_vpc":{"$ref":"#/definitions/FuncVpc"},"gpu_memory":{"description":"函数消耗的显存,只支持自定义运行时与自定义镜像函数配置GPU。\n单位MB。\n取值范围为:1024、2048、3072、4096、5120、6144、7168、8192、9216、10240、11264、12288、13312、14336、15360、16384。\n最小值为1024,最大值为16384。","format":"int32","type":"integer"},"gpu_type":{"description":"显卡类型。","example":"nvidia-a30","type":"string"},"handler":{"description":"函数执行入口\n规则:xx.xx,必须包含“. ”\n举例:对于node.js函数:myfunction.handler,则表示函数的文件名为myfunction.js,执行的入口函数名为handler。","type":"string"},"heartbeat_handler":{"description":"心跳函数函数的入口,规则:xx.xx,必须包含“. ”,只支持JAVA运行时配置。\n心跳函数入口需要与函数执行入口在同一文件下。在开启心跳函数配置时,此参数必填。","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"},"is_bridge_function":{"description":"是否为bridge函数","type":"boolean"},"is_return_stream":{"description":"是否返回流式数据(已废弃)","type":"boolean"},"is_stateful_function":{"description":"是否支持有状态,如果需要支持,需要固定传参为true,v2版本支持","type":"boolean"},"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"},"lts_custom_tag":{"additionalProperties":{"type":"string"},"description":"自定义日志标签。函数执行时,可以按照自定义标签配置上报标签到云日志服务(LTS),用户可以通过标签对日志进行过滤筛选。","type":"object"},"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"},"network_controller":{"$ref":"#/definitions/NetworkControlConfig"},"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"},"reserved_instance_count":{"description":"函数预留实例数量。","format":"int32","type":"integer"},"resource_id":{"description":"资源id。","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":"函数版本号。","type":"string"},"xrole":{"description":"函数使用的权限委托名称,需要IAM支持,并在IAM界面创建委托,当函数需要访问其他服务时,必须提供该字段。","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"]},"CustomImage":{"description":"用户容器镜像。","properties":{"args":{"description":"启动容器镜像的命令行参数","type":"string"},"command":{"description":"启动容器镜像的命令","type":"string"},"enabled":{"description":"是否启用","type":"boolean"},"gid":{"description":"镜像容器的用户组id","type":"string"},"image":{"description":"镜像地址","type":"string"},"uid":{"description":"镜像容器的用户id","type":"string"},"working_dir":{"description":"镜像容器工作目录","type":"string"}}},"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"}}},"FuncCode":{"description":"FuncCode结构返回体。","properties":{"file":{"description":"函数代码,如果不为空必须进行base64编码,为空时使用默认的代码。","type":"string"},"link":{"description":"函数代码链接。","type":"string"}}},"FuncLogConfig":{"description":"函数绑定日志配置。","properties":{"group_id":{"description":"函数绑定日志组ID。","type":"string"},"group_name":{"description":"函数绑定日志组名。","type":"string"},"stream_id":{"description":"函数绑定日志流ID。","type":"string"},"stream_name":{"description":"函数绑定日志流名。","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"]},"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"]},"NetworkControlConfig":{"description":"函数网络配置。","properties":{"disable_public_network":{"description":"禁止公网访问开关。","type":"boolean"},"trigger_access_vpcs":{"description":"指定触发函数vpc配置。","items":{"$ref":"#/definitions/VpcConfig"},"type":"array"}}},"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"]},"VpcConfig":{"description":"vpc信息。","properties":{"vpc_id":{"description":"vpc ID。","type":"string"},"vpc_name":{"description":"vpc名称。","type":"string"}}}},"description":null,"group_id":"cb46b925a4eb40a192520da4fc33b990","host":"functiongraph.cn-north-4.myhuaweicloud.com","id":"7331d6ac31094acb827ba3ae1070a0f1","info_version":"v2","method":"post","name":"CreateFunction","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..."},"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":{"post":{"description":"创建指定的函数。","operationId":"CreateFunction","parameters":[{"$ref":"#/parameters/project_id"},{"$ref":"#/parameters/X-Auth-Token"},{"$ref":"#/parameters/Content-Type"},{"description":"创建函数请求body体。","in":"body","name":"CreateFunctionRequestBody","required":true,"schema":{"$ref":"#/definitions/CreateFunctionRequestBody"},"x-order":3}],"responses":{"200":{"description":"ok","examples":{"application/json":{"code_filename":"index.py","code_size":100,"code_type":"inline","cpu":300,"digest":"1c8610d1870731a818a037f1d2adf3223e8ac351aeb293fb1f8eabd2e9820069a61ed8b5d38182e760adc33a307d0e957afc357f415cd8c9c3ff6f0426fd85cd","domain_id":"14ee2e3501124efcbca7998baa24xxxx","encrypted_user_data":"{\"password\":\"\"}","func_code":{},"func_name":"TestCreateFunctionInPythonSdk","func_urn":"urn:fss:xxxxxxxxx:c3b2459a6d5e4b548e6777e57852692d:function:default:TestCreateFunctionInPythonSdk:latest","handler":"index.handler","image_name":"latest-191025153727@zehht","last_modified":"2019-10-25T15:37:27+08:00","last_modified_utc":1571989047,"memory_size":128,"mount_config":{"func_mounts":[{"local_mount_path":"/mnt","mount_resource":"268xxx-d3xx-4cxx-98xx-d1dbxxx","mount_type":"sfsTurbo"}],"mount_user":{"user_group_id":-1,"user_id":-1}},"namespace":"46b6f338fc3445b8846c71dfb1fbxxxx","package":"default","project_name":"xxxxxxxxxx","runtime":"Python3.6","strategy_config":{"concurrency":0},"timeout":3,"version":"latest"}},"schema":{"$ref":"#/definitions/CreateFunctionResponseBody"}},"400":{"description":"Bad Request 请求错误。","examples":{"application/json":{"error_code":"FSS.0401","error_msg":"not permit"}},"schema":{"$ref":"#/definitions/ErrorResp"}},"401":{"description":"Unauthorized 鉴权失败。","examples":{"application/json":{"error_code":"FSS.0401","error_msg":"not permit"}},"schema":{"$ref":"#/definitions/ErrorResp"}},"403":{"description":"Forbidden 没有操作权限。","examples":{"application/json":{"error_code":"FSS.0401","error_msg":"not permit"}},"schema":{"$ref":"#/definitions/ErrorResp"}},"404":{"description":"Not Found 找不到资源。","schema":{"$ref":"#/definitions/ErrorResp"}},"500":{"description":"Internal Server Error 服务内部错误。","schema":{"$ref":"#/definitions/ErrorResp"}},"503":{"description":"Service Unavailable 服务不可用","schema":{"$ref":"#/definitions/ErrorResp"}}},"summary":"创建函数","tags":["函数生命周期管理"],"x-produc-type":"functiongraph","x-request-examples-1":{"code_type":"inline","encrypted_user_data":"{\"password\":\"1234\"}","func_code":{"file":"xxxxx","link":""},"func_name":"xxx","handler":"index.py","memory_size":128,"mount_config":{"func_mounts":[{"local_mount_path":"/mnt","mount_resource":"268xxx-d3xx-4cxx-98xx-d1dbxxx","mount_type":"sfsTurbo"}],"mount_user":{"user_group_id":-1,"user_id":-1}},"package":"xxx","runtime":"Python2.7","timeout":3,"type":"v2"},"x-request-examples-2":{"code_type":"obs","code_url":"https:xxx","func_name":"xxx","handler":"index.py","memory_size":128,"package":"xxx","runtime":"Python3.9","timeout":3,"type":"v2"},"x-request-examples-3":{"code_type":"obs","code_url":"https:xxx","custom_image":{"enabled":true,"image":"swr.xxx"},"func_name":"xxx","handler":"-","memory_size":128,"package":"xxx","runtime":"Custom Image","timeout":3,"type":"v2","xrole":"xxx"},"x-request-examples-description-1":"创建名为xxx的python2.7函数,内存大小为128MB,超时时间3s,添加加密环境变量password,添加磁盘挂载。","x-request-examples-description-2":"创建名为xxx的python3.9函数,内存大小为128MB,超时时间3s,代码由OBS上传。","x-request-examples-description-3":"创建名为xxx的自定义镜像函数,内存大小为128MB,超时时间3s,代码由SWR上传。","x-request-examples-url-1":"POST https://{Endpoint}/v2/{project_id}/fgs/functions","x-request-examples-url-2":"POST https://{Endpoint}/v2/{project_id}/fgs/functions","x-request-examples-url-3":"POST https://{Endpoint}/v2/{project_id}/fgs/functions","x-support-sdk":"Y"}}},"product_short":"FunctionGraph","region_id":"cn-north-4","schemes":["HTTPS"],"security_definitions":null,"summary":"创建函数","tags":"函数生命周期管理","uri":null,"version":"2.0"}