@@ -20,7 +20,7 @@ def list(self, queries = None, search = None):
2020 'content-type' : 'application/json' ,
2121 }, api_params )
2222
23- def create (self , function_id , name , runtime , execute = None , events = None , schedule = None , timeout = None , enabled = None , logging = None , entrypoint = None , commands = None , installation_id = None , provider_repository_id = None , provider_branch = None , provider_silent_mode = None , provider_root_directory = None , template_repository = None , template_owner = None , template_root_directory = None , template_branch = None ):
23+ def create (self , function_id , name , runtime , execute = None , events = None , schedule = None , timeout = None , enabled = None , logging = None , entrypoint = None , commands = None , scopes = None , installation_id = None , provider_repository_id = None , provider_branch = None , provider_silent_mode = None , provider_root_directory = None , template_repository = None , template_owner = None , template_root_directory = None , template_version = None , specification = None ):
2424 """Create function"""
2525
2626
@@ -47,6 +47,7 @@ def create(self, function_id, name, runtime, execute = None, events = None, sche
4747 api_params ['logging' ] = logging
4848 api_params ['entrypoint' ] = entrypoint
4949 api_params ['commands' ] = commands
50+ api_params ['scopes' ] = scopes
5051 api_params ['installationId' ] = installation_id
5152 api_params ['providerRepositoryId' ] = provider_repository_id
5253 api_params ['providerBranch' ] = provider_branch
@@ -55,7 +56,8 @@ def create(self, function_id, name, runtime, execute = None, events = None, sche
5556 api_params ['templateRepository' ] = template_repository
5657 api_params ['templateOwner' ] = template_owner
5758 api_params ['templateRootDirectory' ] = template_root_directory
58- api_params ['templateBranch' ] = template_branch
59+ api_params ['templateVersion' ] = template_version
60+ api_params ['specification' ] = specification
5961
6062 return self .client .call ('post' , api_path , {
6163 'content-type' : 'application/json' ,
@@ -72,6 +74,17 @@ def list_runtimes(self):
7274 'content-type' : 'application/json' ,
7375 }, api_params )
7476
77+ def list_specifications (self ):
78+ """List available function runtime specifications"""
79+
80+
81+ api_path = '/functions/specifications'
82+ api_params = {}
83+
84+ return self .client .call ('get' , api_path , {
85+ 'content-type' : 'application/json' ,
86+ }, api_params )
87+
7588 def get (self , function_id ):
7689 """Get function"""
7790
@@ -88,7 +101,7 @@ def get(self, function_id):
88101 'content-type' : 'application/json' ,
89102 }, api_params )
90103
91- def update (self , function_id , name , runtime = None , execute = None , events = None , schedule = None , timeout = None , enabled = None , logging = None , entrypoint = None , commands = None , installation_id = None , provider_repository_id = None , provider_branch = None , provider_silent_mode = None , provider_root_directory = None ):
104+ def update (self , function_id , name , runtime = None , execute = None , events = None , schedule = None , timeout = None , enabled = None , logging = None , entrypoint = None , commands = None , scopes = None , installation_id = None , provider_repository_id = None , provider_branch = None , provider_silent_mode = None , provider_root_directory = None , specification = None ):
92105 """Update function"""
93106
94107
@@ -112,11 +125,13 @@ def update(self, function_id, name, runtime = None, execute = None, events = Non
112125 api_params ['logging' ] = logging
113126 api_params ['entrypoint' ] = entrypoint
114127 api_params ['commands' ] = commands
128+ api_params ['scopes' ] = scopes
115129 api_params ['installationId' ] = installation_id
116130 api_params ['providerRepositoryId' ] = provider_repository_id
117131 api_params ['providerBranch' ] = provider_branch
118132 api_params ['providerSilentMode' ] = provider_silent_mode
119133 api_params ['providerRootDirectory' ] = provider_root_directory
134+ api_params ['specification' ] = specification
120135
121136 return self .client .call ('put' , api_path , {
122137 'content-type' : 'application/json' ,
@@ -208,7 +223,7 @@ def get_deployment(self, function_id, deployment_id):
208223 }, api_params )
209224
210225 def update_deployment (self , function_id , deployment_id ):
211- """Update function deployment"""
226+ """Update deployment"""
212227
213228
214229 api_path = '/functions/{functionId}/deployments/{deploymentId}'
@@ -247,32 +262,49 @@ def delete_deployment(self, function_id, deployment_id):
247262 'content-type' : 'application/json' ,
248263 }, api_params )
249264
250- def create_build (self , function_id , deployment_id , build_id ):
251- """Create build """
265+ def create_build (self , function_id , deployment_id , build_id = None ):
266+ """Rebuild deployment """
252267
253268
254- api_path = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId} '
269+ api_path = '/functions/{functionId}/deployments/{deploymentId}/build '
255270 api_params = {}
256271 if function_id is None :
257272 raise AppwriteException ('Missing required parameter: "function_id"' )
258273
259274 if deployment_id is None :
260275 raise AppwriteException ('Missing required parameter: "deployment_id"' )
261276
262- if build_id is None :
263- raise AppwriteException ('Missing required parameter: "build_id"' )
264-
265277 api_path = api_path .replace ('{functionId}' , function_id )
266278 api_path = api_path .replace ('{deploymentId}' , deployment_id )
267- api_path = api_path .replace ('{buildId}' , build_id )
268279
280+ api_params ['buildId' ] = build_id
269281
270282 return self .client .call ('post' , api_path , {
271283 'content-type' : 'application/json' ,
272284 }, api_params )
273285
274- def download_deployment (self , function_id , deployment_id ):
275- """Download Deployment"""
286+ def update_deployment_build (self , function_id , deployment_id ):
287+ """Cancel deployment"""
288+
289+
290+ api_path = '/functions/{functionId}/deployments/{deploymentId}/build'
291+ api_params = {}
292+ if function_id is None :
293+ raise AppwriteException ('Missing required parameter: "function_id"' )
294+
295+ if deployment_id is None :
296+ raise AppwriteException ('Missing required parameter: "deployment_id"' )
297+
298+ api_path = api_path .replace ('{functionId}' , function_id )
299+ api_path = api_path .replace ('{deploymentId}' , deployment_id )
300+
301+
302+ return self .client .call ('patch' , api_path , {
303+ 'content-type' : 'application/json' ,
304+ }, api_params )
305+
306+ def get_deployment_download (self , function_id , deployment_id ):
307+ """Download deployment"""
276308
277309
278310 api_path = '/functions/{functionId}/deployments/{deploymentId}/download'
@@ -309,7 +341,7 @@ def list_executions(self, function_id, queries = None, search = None):
309341 'content-type' : 'application/json' ,
310342 }, api_params )
311343
312- def create_execution (self , function_id , body = None , xasync = None , path = None , method = None , headers = None ):
344+ def create_execution (self , function_id , body = None , xasync = None , path = None , method = None , headers = None , scheduled_at = None ):
313345 """Create execution"""
314346
315347
@@ -325,6 +357,7 @@ def create_execution(self, function_id, body = None, xasync = None, path = None,
325357 api_params ['path' ] = path
326358 api_params ['method' ] = method
327359 api_params ['headers' ] = headers
360+ api_params ['scheduledAt' ] = scheduled_at
328361
329362 return self .client .call ('post' , api_path , {
330363 'content-type' : 'application/json' ,
@@ -350,6 +383,26 @@ def get_execution(self, function_id, execution_id):
350383 'content-type' : 'application/json' ,
351384 }, api_params )
352385
386+ def delete_execution (self , function_id , execution_id ):
387+ """Delete execution"""
388+
389+
390+ api_path = '/functions/{functionId}/executions/{executionId}'
391+ api_params = {}
392+ if function_id is None :
393+ raise AppwriteException ('Missing required parameter: "function_id"' )
394+
395+ if execution_id is None :
396+ raise AppwriteException ('Missing required parameter: "execution_id"' )
397+
398+ api_path = api_path .replace ('{functionId}' , function_id )
399+ api_path = api_path .replace ('{executionId}' , execution_id )
400+
401+
402+ return self .client .call ('delete' , api_path , {
403+ 'content-type' : 'application/json' ,
404+ }, api_params )
405+
353406 def list_variables (self , function_id ):
354407 """List variables"""
355408
0 commit comments