@@ -20,7 +20,7 @@ def list(self, queries = None, search = None):
20
20
'content-type' : 'application/json' ,
21
21
}, api_params )
22
22
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 ):
24
24
"""Create function"""
25
25
26
26
@@ -47,6 +47,7 @@ def create(self, function_id, name, runtime, execute = None, events = None, sche
47
47
api_params ['logging' ] = logging
48
48
api_params ['entrypoint' ] = entrypoint
49
49
api_params ['commands' ] = commands
50
+ api_params ['scopes' ] = scopes
50
51
api_params ['installationId' ] = installation_id
51
52
api_params ['providerRepositoryId' ] = provider_repository_id
52
53
api_params ['providerBranch' ] = provider_branch
@@ -55,7 +56,8 @@ def create(self, function_id, name, runtime, execute = None, events = None, sche
55
56
api_params ['templateRepository' ] = template_repository
56
57
api_params ['templateOwner' ] = template_owner
57
58
api_params ['templateRootDirectory' ] = template_root_directory
58
- api_params ['templateBranch' ] = template_branch
59
+ api_params ['templateVersion' ] = template_version
60
+ api_params ['specification' ] = specification
59
61
60
62
return self .client .call ('post' , api_path , {
61
63
'content-type' : 'application/json' ,
@@ -72,6 +74,17 @@ def list_runtimes(self):
72
74
'content-type' : 'application/json' ,
73
75
}, api_params )
74
76
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
+
75
88
def get (self , function_id ):
76
89
"""Get function"""
77
90
@@ -88,7 +101,7 @@ def get(self, function_id):
88
101
'content-type' : 'application/json' ,
89
102
}, api_params )
90
103
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 ):
92
105
"""Update function"""
93
106
94
107
@@ -112,11 +125,13 @@ def update(self, function_id, name, runtime = None, execute = None, events = Non
112
125
api_params ['logging' ] = logging
113
126
api_params ['entrypoint' ] = entrypoint
114
127
api_params ['commands' ] = commands
128
+ api_params ['scopes' ] = scopes
115
129
api_params ['installationId' ] = installation_id
116
130
api_params ['providerRepositoryId' ] = provider_repository_id
117
131
api_params ['providerBranch' ] = provider_branch
118
132
api_params ['providerSilentMode' ] = provider_silent_mode
119
133
api_params ['providerRootDirectory' ] = provider_root_directory
134
+ api_params ['specification' ] = specification
120
135
121
136
return self .client .call ('put' , api_path , {
122
137
'content-type' : 'application/json' ,
@@ -208,7 +223,7 @@ def get_deployment(self, function_id, deployment_id):
208
223
}, api_params )
209
224
210
225
def update_deployment (self , function_id , deployment_id ):
211
- """Update function deployment"""
226
+ """Update deployment"""
212
227
213
228
214
229
api_path = '/functions/{functionId}/deployments/{deploymentId}'
@@ -247,32 +262,49 @@ def delete_deployment(self, function_id, deployment_id):
247
262
'content-type' : 'application/json' ,
248
263
}, api_params )
249
264
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 """
252
267
253
268
254
- api_path = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId} '
269
+ api_path = '/functions/{functionId}/deployments/{deploymentId}/build '
255
270
api_params = {}
256
271
if function_id is None :
257
272
raise AppwriteException ('Missing required parameter: "function_id"' )
258
273
259
274
if deployment_id is None :
260
275
raise AppwriteException ('Missing required parameter: "deployment_id"' )
261
276
262
- if build_id is None :
263
- raise AppwriteException ('Missing required parameter: "build_id"' )
264
-
265
277
api_path = api_path .replace ('{functionId}' , function_id )
266
278
api_path = api_path .replace ('{deploymentId}' , deployment_id )
267
- api_path = api_path .replace ('{buildId}' , build_id )
268
279
280
+ api_params ['buildId' ] = build_id
269
281
270
282
return self .client .call ('post' , api_path , {
271
283
'content-type' : 'application/json' ,
272
284
}, api_params )
273
285
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"""
276
308
277
309
278
310
api_path = '/functions/{functionId}/deployments/{deploymentId}/download'
@@ -309,7 +341,7 @@ def list_executions(self, function_id, queries = None, search = None):
309
341
'content-type' : 'application/json' ,
310
342
}, api_params )
311
343
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 ):
313
345
"""Create execution"""
314
346
315
347
@@ -325,6 +357,7 @@ def create_execution(self, function_id, body = None, xasync = None, path = None,
325
357
api_params ['path' ] = path
326
358
api_params ['method' ] = method
327
359
api_params ['headers' ] = headers
360
+ api_params ['scheduledAt' ] = scheduled_at
328
361
329
362
return self .client .call ('post' , api_path , {
330
363
'content-type' : 'application/json' ,
@@ -350,6 +383,26 @@ def get_execution(self, function_id, execution_id):
350
383
'content-type' : 'application/json' ,
351
384
}, api_params )
352
385
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
+
353
406
def list_variables (self , function_id ):
354
407
"""List variables"""
355
408
0 commit comments