Create Deployment
Endpoint
posthttps://<REGION>.cloud.appwrite.io/v1/functions/{functionId}/deployments
Description
Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.
This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the Appwrite Cloud Functions tutorial.
Use the "command" param to set the entry point used to execute your code.
Required scopes
Authentication
setProject() and a server API key (setKey()). For direct REST calls, send X-Appwrite-Project and X-Appwrite-Key.Path
Function ID.
Body
Entrypoint File.
Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
Automatically activate the deployment when it is finished building.
Deployment
Deployment ID.
Deployment creation date in Unix timestamp.
Deployment update date in Unix timestamp.
Resource ID.
Resource type.
The entrypoint file to use to execute the deployment code.
The code size in bytes.
The current build ID.
Whether the deployment should be automatically activated.
The deployment status.
The build stdout.
The build stderr.
from appwrite.client import Clientfrom appwrite.input_file import InputFilefrom appwrite.services.functions import Functions
client = Client()
(client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key)
functions = Functions(client)
result = functions.create_deployment('[FUNCTION_ID]', '[ENTRYPOINT]', InputFile.from_path('file.png'), False)Functions
Create Deployment
Endpoint
posthttps://<REGION>.cloud.appwrite.io/v1/functions/{functionId}/deployments
Description
Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.
This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the Appwrite Cloud Functions tutorial.
Use the "command" param to set the entry point used to execute your code.
Required scopes
Authentication
setProject() and a server API key (setKey()). For direct REST calls, send X-Appwrite-Project and X-Appwrite-Key.Path
Function ID.
Body
Entrypoint File.
Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
Automatically activate the deployment when it is finished building.
Deployment
Deployment ID.
Deployment creation date in Unix timestamp.
Deployment update date in Unix timestamp.
Resource ID.
Resource type.
The entrypoint file to use to execute the deployment code.
The code size in bytes.
The current build ID.
Whether the deployment should be automatically activated.
The deployment status.
The build stdout.
The build stderr.
from appwrite.client import Clientfrom appwrite.input_file import InputFilefrom appwrite.services.functions import Functions
client = Client()
(client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key)
functions = Functions(client)
result = functions.create_deployment('[FUNCTION_ID]', '[ENTRYPOINT]', InputFile.from_path('file.png'), False)