{"base_path":null,"components":null,"consumes":"[\"application/json\"]","definitions":{"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"}}},"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"]},"UpdateFunctionCodeRequestBody":{"properties":{"code_filename":{"description":"函数的文件名,当CodeType为jar/zip时必须提供该字段,inline和obs不需要提供。","type":"string"},"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"},"depend_version_list":{"description":"依赖版本id列表","items":{"type":"string"},"type":"array"},"func_code":{"$ref":"#/definitions/FuncCode"}},"required":["code_type","func_code"]},"UpdateFunctionCodeResponseBody":{"properties":{"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"},"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"},"digest":{"description":"函数代码SHA512 hash值,用于判断函数是否变化。","type":"string"},"domain_id":{"description":"域名id。","type":"string"},"func_code":{"$ref":"#/definitions/FuncCode"},"func_name":{"description":"函数名称。","type":"string"},"func_urn":{"description":"函数的URN(Uniform Resource Name),唯一标识函数。","type":"string"},"last_modified":{"description":"函数最后一次更新时间。","format":"date-time","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"}},"required":["code_size","code_type","digest","domain_id","func_name","func_urn","last_modified","runtime"]}},"description":null,"group_id":"cb46b925a4eb40a192520da4fc33b990","host":"functiongraph.cn-north-4.myhuaweicloud.com","id":"745dbc24160747f6aed02525a6718e18","info_version":"v2","method":"put","name":"UpdateFunctionCode","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}/code":{"put":{"description":"修改指定的函数的代码。","operationId":"UpdateFunctionCode","parameters":[{"$ref":"#/parameters/project_id"},{"$ref":"#/parameters/function_urn"},{"$ref":"#/parameters/X-Auth-Token"},{"$ref":"#/parameters/Content-Type"},{"description":"更新函数代码请求体","in":"body","name":"UpdateFunctionCodeRequestBody","required":true,"schema":{"$ref":"#/definitions/UpdateFunctionCodeRequestBody"}}],"responses":{"200":{"description":"OK","examples":{"application/json":{"code_filename":"index.js","code_size":245,"code_type":"inline","digest":"39d51ae334ffb239037e194159f4cc9cec31086719aa73db7d0a608343121a290f7115693e008bd01cb12b99a803856e83aa96173b26c528c41cfed18267e08f","domain_id":"14ee2e3501124efcbca7998baa24xxxx","func_code":{"file":"aW1wb3J0IGpzb24KZGVmIGhhbmRsZXIoZXZlbnQsIGNvbnRleHQpOgogICAgb3V0cHV0ID0gJ0hlbGxvIE1zZyBmb3IgbW9kaWZ5OiAnICsganNvbi5kdW1wcyhldmVudCkKICAgIGFrID0gY29udGV4dC5nZXRBY2Nlc3NLZXkoKQogICAgc2sgPSBjb250ZXh0LmdldFNlY3JldEtleSgpCiAgICB0b2tlbiA9IGNvbnRleHQuZ2V0VG9rZW4oKQogICAgcHJpbnQgJ2FrOicgKyBhawogICAgcHJpbnQgJ3NrOicgKyBzawogICAgcHJpbnQgJ3Rva2VuOicgKyB0b2tlbgogICAgcmV0dXJuIG91dHB1dAo+C0NLTqLwKImNCTgBMSn5SC+UbkysuKp1Bj7JQqxds+5p7La/ew4RBTp8IusZ/k2qmqvCDdoBY0ywYCl+RgctnLbTS6hLLj9sNyKoVXiXb1BLAQIeAwoAAAAIAAhYOU8ssPQsgwAAALYAAAAIAAAAAAAAAAAAAADzAgAAAABpbmRleC5weVBLBQYAAAAAAQABADYAAACpAAAAAAA=","link":""},"func_name":"test","func_urn":"urn:fss:xxxxxxxxxxxx:7aad83af3e8d42e99ac194e8419e2c9b:function:default:test:latest","last_modified":"2019-09-25T19:02:17+08:00","runtime":"Node.js6.10","strategy_config":{"concurrency":-1}}},"schema":{"$ref":"#/definitions/UpdateFunctionCodeResponseBody"}},"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.1052","error_msg":"Not found the function version"}},"schema":{"$ref":"#/definitions/ErrorResp"}},"500":{"description":"Internal Server Error 服务内部错误。","schema":{"$ref":"#/definitions/ErrorResp"}}},"summary":"修改函数代码","tags":["函数生命周期管理"],"x-produc-type":"functiongraph","x-request-examples-1":{"code_filename":"index.zip","code_type":"inline","func_code":{"file":"UEsDBAoAAAAIAPQ1M1gNImPLrAAAAAEBAAAIAAAAaW5kZXgucHlNjtEOgjAMRd/5igVfxDAlxhjDo0S/wB+YrMgMdMvWGYnh390wEfrU3nvb0xXjG85qLRU+Sk8NP0UhUb3RltjTaUwkNKwVKDuwbA0vQMrDAhK8KSsTFsoCeYvsMw2xUkeCvKu0hLRk+6LIZ0u5s3BwPFwwUEEG/yo6B4vEXcshyBG+lb437kfNFpEWhATrQmqGTkYVH0Pit8FEdCqM6VQtSGncxYPpPz5O3fgFUEsBAh4DCgAAAAgA9DUzWA0iY8usAAAAAQEAAAgAAAAAAAAAAAAAAPMCAAAAAGluZGV4LnB5UEsFBgAAAAABAAEANgAAANIAAAAAAA=="}},"x-request-examples-2":{"code_filename":"index.zip","code_type":"zip","func_code":{"file":"UEsDBAoAAAAIAPQ1M1gNImPLrAAAAAEBAAAIAAAAaW5kZXgucHlNjtEOgjAMRd/5igVfxDAlxhjDo0S/wB+YrMgMdMvWGYnh390wEfrU3nvb0xXjG85qLRU+Sk8NP0UhUb3RltjTaUwkNKwVKDuwbA0vQMrDAhK8KSsTFsoCeYvsMw2xUkeCvKu0hLRk+6LIZ0u5s3BwPFwwUEEG/yo6B4vEXcshyBG+lb437kfNFpEWhATrQmqGTkYVH0Pit8FEdCqM6VQtSGncxYPpPz5O3fgFUEsBAh4DCgAAAAgA9DUzWA0iY8usAAAAAQEAAAgAAAAAAAAAAAAAAPMCAAAAAGluZGV4LnB5UEsFBgAAAAABAAEANgAAANIAAAAAAA=="}},"x-request-examples-description-1":"以inline方式修改指定函数代码。","x-request-examples-description-2":"以zip方式修改指定函数代码。","x-request-examples-url-1":"PUT https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/code","x-request-examples-url-2":"PUT https://{Endpoint}/v2/{project_id}/fgs/functions/{function_urn}/code","x-support-sdk":"Y"}}},"product_short":"FunctionGraph","region_id":"cn-north-4","schemes":["HTTPS"],"security_definitions":null,"summary":"修改函数代码","tags":"函数生命周期管理","uri":null,"version":"2.0"}