Publishes a specified version of routine code to a specified environment.


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 PublishRoutineCodeRevision

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

Envs Json Yes ["Production","Preset_Canary_Zhejiang"]

The environment to which you want to publish the code.

  • production: the name of the environment, including the environment name (SpecName) and the domain name whitelist (AllowedHosts).
  • Preset_Canary_xx: You can add canary release environments based on your business requirements. This parameter is optional.
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.

SelectCodeRevision String Yes 1620876959997924701

The version of the routine code that you want to publish.

Response parameters

Parameter Type Example Description
Content Map "CodeRevision": "1620876959997924701"

The version of the routine code that is published to the specified environment.

RequestId String A513734D-D17B-411E-864D-XXXX

The ID of the request.


Sample requests"test"&Envs=["Production","Preset_Canary_Zhejiang"]&SelectCodeRevision="1620876959997924701"&<Common request parameters>

Sample success responses

XML format


JSON format

  "RequestId": "A513734D-D17B-411E-864D-XXXX",
  "Content": {
  	"CodeRevision": "1620876959997924701"

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.