调用GenerateFunctionFileUploadMeta生成函数文件上传元信息。

说明 获取到上传元信息后,即可把函数文件上传到OSS。更多信息,可见OSS的服务端签名后直传描述。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String GenerateFunctionFileUploadMeta

系统规定参数。取值:GenerateFunctionFileUploadMeta

FileName String hello.zip

文件名

ProjectId String PE9FQC48

项目ID

RegionId String cn-shanghai

地域ID

返回数据

名称 类型 示例值 描述
RequestId String 629586FE-CB2E-4742-995E-121F952CEB72

请求ID

UploadMeta Struct

上传文件的元信息

ObjectKey String function/file/1288127240930711/PE9FQC48/B1226EA3-2518-4164-8D2D-82B91A077020/hello.zip

上传文件的标识

PostObjectPolicy Struct

上传文件的入参信息,想要了解更多,请参考OSS的PostObject描述。

AccessId String STS.NHm36Gt3rEesnNGi7spRPCMeD

临时的访问ID

Expire String 1537236687

PostPolicy的过期时长(毫秒)

Host String https://iovcc-yunfunction-qa.oss-cn-shanghai.aliyuncs.com

上传文件的目标地址

Policy String eyJleHBpcmF0aW9uIjoiMjAxOC0wOS0xOFQwMjoxMToyNy4wODZaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwXSxbInN0YXJ0cy13aXRoIiwiJGtleSIsImZ1bmN0aW9uL2ZpbGUvMTI4ODEyNzI0MDkzMDcxMS9QRTlGUUM0OCJdXX0=

Base64编码过的PostPolicy信息

Signature String XuG0kIHhWPbztVfDGA1HhzdKPJI=

签名信息,详见Post Signature

SecurityToken String CAIStQN1q6Ft5B2yfSjIr4vYeIzzmexT8qeYbGj2jTcmfN18rIjOpjz2IHFIeHRoBeocs/42n25S6/gSlokqEMRvGxCVNeJctboL2CqPSdWYl5Llx+Qp2MyLMDO/JUYlCllp1aGrIunGc9KBNnpA/00amMl0HFfPdlihNoLzxvwDR98LXw6+QCNbDdNNXGVLo9MbMn2jUpTINQXx0FLNEG1iuAd3lRmkgMbZ+MCH7QfEh1DX0/Ico5+LQqKpdM5xJpxyISncvsx/fbGT1zVLuVoYtvV3i7JP8nLWo9eTHl9a/xSBNa/N+5phMQlyeqk9HelKrfzx0qQi6ryKzdutl04cZrkKCn2YfK3x7vLvRLPLFN8ybuT8IG+fkILNZJjyrQgvJGMGMg1XfdE9K3h2TAUlDT/HLKS7+VfMJQmiT6XCiftmgcMvkA+0pYvRfwfWGvKh/Hc2A7RgPwRqFWZPhDG4K/VbKVwVIwM5XOrMd+gpMkAC85GPlBbJSyhtwktQu/DDfP7MssgdE96uAs4bidZHPskc6jB0FQmpG6jVi0AKf2d+Xa1fy7LwPJKg8r6ZzfV+qBVC8Ubq0BqAAWxX+0Nwa5DhRemsT1hWIFHzz7zvt8mvHXE42bOQsmHAlThYrG27r1IJ4PeiL17aiTPK0nW5aXpvjaskg+b42mR/YsI0T7v7xMuMj6btceXEBBMl3a82lDryxBtj6+N49U5Wn+bKXXAtz5/ti7LWHALboNLIOyJLWZeWOOMzyA63

RAM角色扮演的STS Token,详情参见STS临时授权

示例

请求示例

https://iovcc.cn-shanghai.aliyuncs.com/?FileName=hello.zip
&ProjectId=PE9FQC48
&<公共请求参数>

正常返回示例

XML格式

<GenerateFunctionFileUploadMetaResponse>
	  <RequestId>6F25F67C-F411-499F-BCE2-67CA563CB064</RequestId>
	  <UploadMeta>
		    <ObjectKey>function/file/1288127239930711/PE9FQC48/6F25F67C-F411-499F-BCE2-67CA563CB064/hello.zip</ObjectKey>
		    <PostObjectPolicy>
			      <AccessId>STS.NHm36Gt3rEesnNGi7spRPCMeD</AccessId>
			      <Expire>1537236687</Expire>
			      <Host>https://iovcc-yunfunction-online.oss-cn-shanghai.aliyuncs.com</Host>
			      <Policy>eyJleHBpcmF0aW9uIjoiMjAxOC0wOS0xOFQwMjoxMToyNy4wODZaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwXSxbInN0YXJ0cy13aXRoIiwiJGtleSIsImZ1bmN0aW9uL2ZpbGUvMTI4ODEyNzI0MDkzMDcxMS9QRTlGUUM0OCJdXX0=</Policy>
			      <Signature>XuG0kIHhWPbztVfDGA1HhzdKPJI=</Signature>
		    </PostObjectPolicy>
		    <SecurityToken>CAIStQN1q6Ft5B2yfSjIr4vYeIzzmexT8qeYbGj2jTcmfN18rIjOpjz2IHFIeHRoBeocs/42n25S6/gSlokqEMRvGxCVNeJctboL2CqPSdWYl5Llx+Qp2MyLMDO/JUYlCllp1aGrIunGc9KBNnpA/00amMl0HFfPdlihNoLzxvwDR98LXw6+QCNbDdNNXGVLo9MbMn2jUpTINQXx0FLNEG1iuAd3lRmkgMbZ+MCH7QfEh1DX0/Ico5+LQqKpdM5xJpxyISncvsx/fbGT1zVLuVoYtvV3i7JP8nLWo9eTHl9a/xSBNa/N+5phMQlyeqk9HelKrfzx0qQi6ryKzdutl04cZrkKCn2YfK3x7vLvRLPLFN8ybuT8IG+fkILNZJjyrQgvJGMGMg1XfdE9K3h2TAUlDT/HLKS7+VfMJQmiT6XCiftmgcMvkA+0pYvRfwfWGvKh/Hc2A7RgPwRqFWZPhDG4K/VbKVwVIwM5XOrMd+gpMkAC85GPlBbJSyhtwktQu/DDfP7MssgdE96uAs4bidZHPskc6jB0FQmpG6jVi0AKf2d+Xa1fy7LwPJKg8r6ZzfV+qBVC8Ubq0BqAAWxX+0Nwa5DhRemsT1hWIFHzz7zvt8mvHXE42bOQsmHAlThYrG27r1IJ4PeiL17aiTPK0nW5aXpvjaskg+b42mR/YsI0T7v7xMuMj6btceXEBBMl3a82lDryxBtj6+N49U5Wn+bKXXAtz5/ti7LWHALboNLIOyJLWZeWOOMzyA63</SecurityToken>
	  </UploadMeta>
</GenerateFunctionFileUploadMetaResponse>

JSON格式

{
    "RequestId":"6F25F67C-F411-499F-BCE2-67CA563CB064",
    "UploadMeta":{
        "ObjectKey":"function/file/1288127239930711/PE9FQC48/6F25F67C-F411-499F-BCE2-67CA563CB064/hello.zip",
        "PostObjectPolicy":{
            "AccessId":"STS.NHm36Gt3rEesnNGi7spRPCMeD",
            "Expire":"1537236687",
            "Host":"https://iovcc-yunfunction-online.oss-cn-shanghai.aliyuncs.com",
            "Policy":"eyJleHBpcmF0aW9uIjoiMjAxOC0wOS0xOFQwMjoxMToyNy4wODZaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwXSxbInN0YXJ0cy13aXRoIiwiJGtleSIsImZ1bmN0aW9uL2ZpbGUvMTI4ODEyNzI0MDkzMDcxMS9QRTlGUUM0OCJdXX0=",
            "Signature":"XuG0kIHhWPbztVfDGA1HhzdKPJI="
        },
        "SecurityToken":"CAIStQN1q6Ft5B2yfSjIr4vYeIzzmexT8qeYbGj2jTcmfN18rIjOpjz2IHFIeHRoBeocs/42n25S6/gSlokqEMRvGxCVNeJctboL2CqPSdWYl5Llx+Qp2MyLMDO/JUYlCllp1aGrIunGc9KBNnpA/00amMl0HFfPdlihNoLzxvwDR98LXw6+QCNbDdNNXGVLo9MbMn2jUpTINQXx0FLNEG1iuAd3lRmkgMbZ+MCH7QfEh1DX0/Ico5+LQqKpdM5xJpxyISncvsx/fbGT1zVLuVoYtvV3i7JP8nLWo9eTHl9a/xSBNa/N+5phMQlyeqk9HelKrfzx0qQi6ryKzdutl04cZrkKCn2YfK3x7vLvRLPLFN8ybuT8IG+fkILNZJjyrQgvJGMGMg1XfdE9K3h2TAUlDT/HLKS7+VfMJQmiT6XCiftmgcMvkA+0pYvRfwfWGvKh/Hc2A7RgPwRqFWZPhDG4K/VbKVwVIwM5XOrMd+gpMkAC85GPlBbJSyhtwktQu/DDfP7MssgdE96uAs4bidZHPskc6jB0FQmpG6jVi0AKf2d+Xa1fy7LwPJKg8r6ZzfV+qBVC8Ubq0BqAAWxX+0Nwa5DhRemsT1hWIFHzz7zvt8mvHXE42bOQsmHAlThYrG27r1IJ4PeiL17aiTPK0nW5aXpvjaskg+b42mR/YsI0T7v7xMuMj6btceXEBBMl3a82lDryxBtj6+N49U5Wn+bKXXAtz5/ti7LWHALboNLIOyJLWZeWOOMzyA63"
    }
}

错误码

访问错误中心查看更多错误码。