Uploads code to a routine for testing.

Note
  • Each time you upload code to a routine, a version is generated. The number of versions is counted by CodeRev. The uploaded code is used only for testing.
  • The code is automatically published to a staging environment.
  • Each routine can retain at most 10 versions. If the upper limit is reached, you must call the DeleteRoutineCodeRevision operation to manually delete versions that are no longer needed before new versions can be saved.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes UploadStagingRoutineCode

The operation that you want to perform. Set the value to UploadStagingRoutineCode.

Name String Yes test

The name of the routine. The name must be unique among the routines that belong to the same Alibaba Cloud account.

CodeDescription String No desc

The description of the version.

Response parameters

Parameter Type Example Description
Content Map OssPostConfig and CodeRevision

The parameters required by the code.

RequestId String DFA2027F-86C0-4421-9593-581A7993696C

The ID of the request.

Examples

Sample requests

http://dcdn.aliyuncs.com/?Action=UploadStagingRoutineCode&Name="test"&CodeDescription="desc"&<Common request parameters>

Sample success responses

XML format

<RequestId>DFA2027F-86C0-4421-9593-581A7993696C</RequestId>
<Content>
    <OssPostConfig>
        <OSSAccessKeyId>KiTr</OSSAccessKeyId>
        <Signature>+VaGBmeMjdKTD1E=</Signature>
        <callback>eyJjYWxsYmFja1VybCI6Imh0dHA6Ly9lci1ub2RlYXBpLmFsaXl1bmNzLmNvbS91cGxvYWRfY29kZV9vc3NfY2FsbGJhY2siLCJjYWxsYmFja0JvZHkiOiJPYmplY3Q9JHtvYmplY3R9JkNvZGVEZXNjcmlwdGlvbj0ke3g6Y29kZWRlc2NyaXB0aW9ufSIsImNhbGxiYWNrQm9keVR5cGUiOiJhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQifQo=</callback>
        <x:codeDescription>IkhlbGxvIFdvcmxkIg==</x:codeDescription>
        <Url>http://cdn-edgejs.oss-cn-hangzhou.aliyuncs.com</Url>
        <key>test.123.69188190343.js</key>
        <policy>eyJleHBpcmF0aW9uIjoiMjAyMS0wNS0yNlQxMzowNzo0OVoiLCJjb25kaXRpb25zIjpbWyJlcSIsIiRrZXkiLCJ0ZXN0LXNsYy4xMzc3MjkyNjI4ODEwMzI3LjE2MjIwMzQxNjkxODgxOTAzNDMuanMiXSxbImVxIiwiJGNhbGxiYWNrIiwiZXlKallXeHNZbUZqYTFWeWJDSTZJbWgwZEhBNkx5OWxjaTF1YjJSbFlYQnBMbUZzYVhsMWJtTnpMbU52YlM5MWNHeHZZV1JmWTI5a1pWOXZjM05mWTJGc2JHSmhZMnNpTENKallXeHNZbUZqYTBKdlpIa2lPaUpQWW1wbFkzUTlKSHR2WW1wbFkzUjlKa052WkdWRVpYTmpjbWx3ZEdsdmJqMGtlM2c2WTI5a1pXUmxjMk55YVhCMGFXOXVmU0lzSW1OaGJHeGlZV05yUW05a2VWUjVjR1VpT2lKaGNIQnNhV05oZEdsdmJpOTRMWGQzZHkxbWIzSnRMWFZ5YkdWdVkyOWtaV1FpZlFvPSJdLFsiZXEiLCIkeDpjb2RlZGVzY3JpcHRpb24iLCJJa2hsYkd4dklGZHZjbXhrSWc9PSJdLFsiY29udGVudC1sZW5ndGgtcmFuZ2UiLDEsNDE5NDMwNF1dfQ==</policy>
    </OssPostConfig>
    <CodeRevision>1622034169188190343</CodeRevision>
</Content>

JSON format

{
    "RequestId": "DFA2027F-86C0-4421-9593-581A7993696C",
    "Content": {
        "OssPostConfig": {
            "OSSAccessKeyId": "KiTr",
            "Signature": "+VaGBmeMjdKTD1E=",
            "callback": "eyJjYWxsYmFja1VybCI6Imh0dHA6Ly9lci1ub2RlYXBpLmFsaXl1bmNzLmNvbS91cGxvYWRfY29kZV9vc3NfY2FsbGJhY2siLCJjYWxsYmFja0JvZHkiOiJPYmplY3Q9JHtvYmplY3R9JkNvZGVEZXNjcmlwdGlvbj0ke3g6Y29kZWRlc2NyaXB0aW9ufSIsImNhbGxiYWNrQm9keVR5cGUiOiJhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQifQo=",
            "x:codeDescription": "IkhlbGxvIFdvcmxkIg==",
            "Url": "http://cdn-edgejs.oss-cn-hangzhou.aliyuncs.com",
            "key": "test.123.69188190343.js",
            "policy": "eyJleHBpcmF0aW9uIjoiMjAyMS0wNS0yNlQxMzowNzo0OVoiLCJjb25kaXRpb25zIjpbWyJlcSIsIiRrZXkiLCJ0ZXN0LXNsYy4xMzc3MjkyNjI4ODEwMzI3LjE2MjIwMzQxNjkxODgxOTAzNDMuanMiXSxbImVxIiwiJGNhbGxiYWNrIiwiZXlKallXeHNZbUZqYTFWeWJDSTZJbWgwZEhBNkx5OWxjaTF1YjJSbFlYQnBMbUZzYVhsMWJtTnpMbU52YlM5MWNHeHZZV1JmWTI5a1pWOXZjM05mWTJGc2JHSmhZMnNpTENKallXeHNZbUZqYTBKdlpIa2lPaUpQWW1wbFkzUTlKSHR2WW1wbFkzUjlKa052WkdWRVpYTmpjbWx3ZEdsdmJqMGtlM2c2WTI5a1pXUmxjMk55YVhCMGFXOXVmU0lzSW1OaGJHeGlZV05yUW05a2VWUjVjR1VpT2lKaGNIQnNhV05oZEdsdmJpOTRMWGQzZHkxbWIzSnRMWFZ5YkdWdVkyOWtaV1FpZlFvPSJdLFsiZXEiLCIkeDpjb2RlZGVzY3JpcHRpb24iLCJJa2hsYkd4dklGZHZjbXhrSWc9PSJdLFsiY29udGVudC1sZW5ndGgtcmFuZ2UiLDEsNDE5NDMwNF1dfQ=="
        },
        "CodeRevision": "1622034169188190343"
    }
}

Error codes

HttpCode Error code Error message Description
400 EdgeRoutine.GeneralError A server error occurred: %s The error message returned because an error %s occurred on the server. If the problem persists, submit a ticket.

For a list of error codes, visit the API Error Center.